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.3 (build 32945). 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    /// Original name from the loaded level; a mismatch rejects the request with 409.
17789    #[serde(rename = "expectedName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17790    pub expected_name: Option<String>,
17791    /// Ignored; changes to the hierarchy are always rejected.
17792    #[serde(default, skip_serializing_if = "Option::is_none")]
17793    #[deprecated = "deprecated in the ChurchTools API"]
17794    pub forcereorder: Option<bool>,
17795    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17796    pub name: Option<String>,
17797    /// A free ID between 1 and 99997 that preserves the hierarchy.
17798    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
17799    pub newid: Option<i64>,
17800    /// Fields not described by the spec, e.g. instance-specific DB fields.
17801    #[serde(flatten)]
17802    pub extra: serde_json::Map<String, serde_json::Value>,
17803}
17804
17805#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17806pub struct PatchSecuritylevelsIdResponse {
17807    #[serde(deserialize_with = "crate::lenient::number")]
17808    pub id: i64,
17809    #[serde(deserialize_with = "crate::lenient::string")]
17810    pub name: String,
17811    /// Fields not described by the spec, e.g. instance-specific DB fields.
17812    #[serde(flatten)]
17813    pub extra: serde_json::Map<String, serde_json::Value>,
17814}
17815
17816/// 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.
17817#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17818pub struct Permission {
17819    /// Numeric permission key from the internal authorization table
17820    #[serde(rename = "authId", deserialize_with = "crate::lenient::number")]
17821    pub auth_id: i64,
17822    /// 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.
17823    #[serde(rename = "dataId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
17824    pub data_id: Option<i64>,
17825    /// ID of the object the permission belongs to
17826    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
17827    pub domain_id: i64,
17828    /// 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.
17829    /// Allowed values: `group_role`, `group_type_role`, `person`, `status`.
17830    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
17831    pub domain_type: String,
17832    /// Whether this source applies through inheritance into subordinate groups; not a statement that the current response row was inherited.
17833    #[serde(rename = "isInherited")]
17834    pub is_inherited: bool,
17835    pub meta: PermissionModification,
17836    /// Optional reason why this permission was assigned
17837    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17838    pub reason: Option<String>,
17839    /// Whether the permission grants or revokes access
17840    /// Allowed values: `grant`, `revoke`.
17841    #[serde(deserialize_with = "crate::lenient::string")]
17842    pub r#type: String,
17843    /// Fields not described by the spec, e.g. instance-specific DB fields.
17844    #[serde(flatten)]
17845    pub extra: serde_json::Map<String, serde_json::Value>,
17846}
17847
17848#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17849pub struct PermissionAssignmentGroup {
17850    /// Group whose role grants the permission
17851    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
17852    pub group_id: i64,
17853    /// Group role IDs contributing to this assignment
17854    #[serde(rename = "groupRoleIds")]
17855    pub group_role_ids: Vec<i64>,
17856    /// Number of distinct non-archived persons reached by this assignment
17857    #[serde(rename = "personCount", deserialize_with = "crate::lenient::number")]
17858    pub person_count: i64,
17859    /// Fields not described by the spec, e.g. instance-specific DB fields.
17860    #[serde(flatten)]
17861    pub extra: serde_json::Map<String, serde_json::Value>,
17862}
17863
17864#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17865pub struct PermissionAssignmentGroupType {
17866    /// Group type whose roles grant the permission
17867    #[serde(rename = "groupTypeId", deserialize_with = "crate::lenient::number")]
17868    pub group_type_id: i64,
17869    /// Group type role IDs contributing to this assignment
17870    #[serde(rename = "groupTypeRoleIds")]
17871    pub group_type_role_ids: Vec<i64>,
17872    /// Number of distinct non-archived persons reached by this assignment
17873    #[serde(rename = "personCount", deserialize_with = "crate::lenient::number")]
17874    pub person_count: i64,
17875    /// Fields not described by the spec, e.g. instance-specific DB fields.
17876    #[serde(flatten)]
17877    pub extra: serde_json::Map<String, serde_json::Value>,
17878}
17879
17880#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17881pub struct PermissionAssignmentPerson {
17882    /// Person with a direct permission assignment
17883    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
17884    pub person_id: i64,
17885    /// Fields not described by the spec, e.g. instance-specific DB fields.
17886    #[serde(flatten)]
17887    pub extra: serde_json::Map<String, serde_json::Value>,
17888}
17889
17890#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17891pub struct PermissionAssignmentStatus {
17892    /// Number of distinct non-archived persons reached by this assignment
17893    #[serde(rename = "personCount", deserialize_with = "crate::lenient::number")]
17894    pub person_count: i64,
17895    /// Person status granting the permission
17896    #[serde(rename = "statusId", deserialize_with = "crate::lenient::number")]
17897    pub status_id: i64,
17898    /// Fields not described by the spec, e.g. instance-specific DB fields.
17899    #[serde(flatten)]
17900    pub extra: serde_json::Map<String, serde_json::Value>,
17901}
17902
17903/// 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.
17904#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17905pub struct PermissionAssignmentSummary {
17906    /// 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.
17907    pub assignments: PermissionAssignmentSummaryAssignments,
17908    /// Numeric permission key
17909    #[serde(rename = "authId", deserialize_with = "crate::lenient::number")]
17910    pub auth_id: i64,
17911    /// Selected permission value, or null for boolean permissions
17912    #[serde(rename = "dataId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
17913    pub data_id: Option<i64>,
17914    /// Total number of distinct non-archived persons with the effective permission
17915    #[serde(rename = "effectivePersonCount", deserialize_with = "crate::lenient::number")]
17916    pub effective_person_count: i64,
17917    /// Fields not described by the spec, e.g. instance-specific DB fields.
17918    #[serde(flatten)]
17919    pub extra: serde_json::Map<String, serde_json::Value>,
17920}
17921
17922/// 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.
17923#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17924pub struct PermissionAssignmentSummaryAssignments {
17925    #[serde(rename = "groupTypes")]
17926    pub group_types: Vec<PermissionAssignmentGroupType>,
17927    pub groups: Vec<PermissionAssignmentGroup>,
17928    pub persons: Vec<PermissionAssignmentPerson>,
17929    pub statuses: Vec<PermissionAssignmentStatus>,
17930    /// Fields not described by the spec, e.g. instance-specific DB fields.
17931    #[serde(flatten)]
17932    pub extra: serde_json::Map<String, serde_json::Value>,
17933}
17934
17935/// 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.
17936#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17937pub struct PermissionAssignmentTarget {
17938    /// Status, role template, concrete group role, or person ID. For group_role this is neither the group ID nor the role template ID.
17939    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
17940    pub domain_id: i64,
17941    /// 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.
17942    /// Allowed values: `group_role`, `group_type_role`, `person`, `status`.
17943    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
17944    pub domain_type: String,
17945    /// Display label localized in the current request language
17946    #[serde(deserialize_with = "crate::lenient::string")]
17947    pub label: String,
17948    /// Fields not described by the spec, e.g. instance-specific DB fields.
17949    #[serde(flatten)]
17950    pub extra: serde_json::Map<String, serde_json::Value>,
17951}
17952
17953#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17954pub struct PermissionBulkChange {
17955    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
17956    pub domain_id: i64,
17957    /// Allowed values: `group_role`, `group_type_role`, `person`, `status`.
17958    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
17959    pub domain_type: String,
17960    /// Fields not described by the spec, e.g. instance-specific DB fields.
17961    #[serde(flatten)]
17962    pub extra: serde_json::Map<String, serde_json::Value>,
17963}
17964
17965/// 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.
17966#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17967pub struct PermissionDefinition {
17968    /// 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.
17969    /// Allowed values: `group_role`, `group_type_role`, `person`, `status`.
17970    #[serde(rename = "assignmentDomains")]
17971    pub assignment_domains: Vec<String>,
17972    /// Numeric permission key
17973    #[serde(rename = "authId", deserialize_with = "crate::lenient::number")]
17974    pub auth_id: i64,
17975    /// Currently the same translated text as name; no separate explanatory description is supplied.
17976    #[serde(deserialize_with = "crate::lenient::string")]
17977    pub description: String,
17978    /// Permission key within its module
17979    #[serde(deserialize_with = "crate::lenient::string")]
17980    pub key: String,
17981    /// Translated display name
17982    #[serde(deserialize_with = "crate::lenient::string")]
17983    pub name: String,
17984    /// Selectable data IDs, beginning with the all entry (-1). Empty for permissions without a data field. Values follow the underlying catalog order.
17985    pub selections: Vec<PermissionDefinitionSelection>,
17986    /// 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.
17987    /// Allowed values: `boolean`, `maximum`, `multiple`.
17988    #[serde(rename = "valueType", deserialize_with = "crate::lenient::string")]
17989    pub value_type: String,
17990    /// Fields not described by the spec, e.g. instance-specific DB fields.
17991    #[serde(flatten)]
17992    pub extra: serde_json::Map<String, serde_json::Value>,
17993}
17994
17995/// Module containing at least one definition matching the requested scope. Modules follow the application module order; keys can include custom modules.
17996#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17997pub struct PermissionDefinitionModule {
17998    /// Technical module key
17999    #[serde(deserialize_with = "crate::lenient::string")]
18000    pub key: String,
18001    /// Translated module name
18002    #[serde(deserialize_with = "crate::lenient::string")]
18003    pub name: String,
18004    pub permissions: Vec<PermissionDefinition>,
18005    /// Fields not described by the spec, e.g. instance-specific DB fields.
18006    #[serde(flatten)]
18007    pub extra: serde_json::Map<String, serde_json::Value>,
18008}
18009
18010#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18011pub struct PermissionDefinitionSelection {
18012    /// Selection ID; -1 represents unrestricted access to all current and future values
18013    #[serde(rename = "dataId", deserialize_with = "crate::lenient::number")]
18014    pub data_id: i64,
18015    /// Allowed values: `all`, `value`.
18016    #[serde(deserialize_with = "crate::lenient::string")]
18017    pub kind: String,
18018    /// Translated selection name
18019    #[serde(deserialize_with = "crate::lenient::string")]
18020    pub name: String,
18021    /// Fields not described by the spec, e.g. instance-specific DB fields.
18022    #[serde(flatten)]
18023    pub extra: serde_json::Map<String, serde_json::Value>,
18024}
18025
18026/// 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.
18027#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18028pub struct PermissionDelete {
18029    /// Permission ID. status and person require values below 10000. Role domains also accept internal permission IDs. 10127 is obsolete and returns 410.
18030    #[serde(rename = "authId", deserialize_with = "crate::lenient::number")]
18031    pub auth_id: i64,
18032    /// 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.
18033    ///
18034    /// `None` leaves the field out, `Some(None)` sends `null`.
18035    #[serde(rename = "dataId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
18036    pub data_id: Option<Option<Vec<i64>>>,
18037    /// Select inherited-source rows when true, otherwise direct rows. Only role domains allow true.
18038    #[serde(rename = "isInherited", default, skip_serializing_if = "Option::is_none")]
18039    pub is_inherited: Option<bool>,
18040    /// Fields not described by the spec, e.g. instance-specific DB fields.
18041    #[serde(flatten)]
18042    pub extra: serde_json::Map<String, serde_json::Value>,
18043}
18044
18045#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18046pub struct PermissionModification {
18047    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
18048    #[serde(rename = "modifiedDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
18049    pub modified_date: Option<chrono::DateTime<chrono::Utc>>,
18050    /// ID of the person that last changed the stored assignment, or null when unavailable.
18051    #[serde(rename = "modifiedPid", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18052    pub modified_pid: Option<i64>,
18053    /// Fields not described by the spec, e.g. instance-specific DB fields.
18054    #[serde(flatten)]
18055    pub extra: serde_json::Map<String, serde_json::Value>,
18056}
18057
18058#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18059pub struct PermissionPersonSelection {
18060    /// Permission selection value, or null for permissions without selection values
18061    #[serde(rename = "dataId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18062    pub data_id: Option<i64>,
18063    /// 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.
18064    #[serde(rename = "personIds")]
18065    pub person_ids: Vec<i64>,
18066    /// Present when `include=origins` is requested
18067    #[serde(default, skip_serializing_if = "Option::is_none")]
18068    pub persons: Option<Vec<PermissionPersonWithOrigins>>,
18069    /// Fields not described by the spec, e.g. instance-specific DB fields.
18070    #[serde(flatten)]
18071    pub extra: serde_json::Map<String, serde_json::Value>,
18072}
18073
18074/// 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.
18075#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18076pub struct PermissionPersonSummaryEntry {
18077    /// Numeric permission key from the internal authorization table
18078    #[serde(rename = "authId", deserialize_with = "crate::lenient::number")]
18079    pub auth_id: i64,
18080    pub selections: Vec<PermissionPersonSummarySelection>,
18081    /// Fields not described by the spec, e.g. instance-specific DB fields.
18082    #[serde(flatten)]
18083    pub extra: serde_json::Map<String, serde_json::Value>,
18084}
18085
18086#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18087pub struct PermissionPersonSummarySelection {
18088    /// Configured selection ID, -1 for unrestricted access including future values, or null for a boolean permission.
18089    #[serde(rename = "dataId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18090    pub data_id: Option<i64>,
18091    /// Distinct matching non-archived persons. Counts overlap across selections; a maximum-level grant contributes to every configured level it reaches.
18092    #[serde(rename = "personCount", deserialize_with = "crate::lenient::number")]
18093    pub person_count: i64,
18094    /// Up to three sorted person IDs for an overview preview
18095    #[serde(rename = "previewPersonIds")]
18096    pub preview_person_ids: Vec<i64>,
18097    /// Fields not described by the spec, e.g. instance-specific DB fields.
18098    #[serde(flatten)]
18099    pub extra: serde_json::Map<String, serde_json::Value>,
18100}
18101
18102#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18103pub struct PermissionPersonWithOrigins {
18104    /// Sources that contribute the requested permission selection
18105    pub origins: Vec<serde_json::Value>,
18106    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
18107    pub person_id: i64,
18108    /// Fields not described by the spec, e.g. instance-specific DB fields.
18109    #[serde(flatten)]
18110    pub extra: serde_json::Map<String, serde_json::Value>,
18111}
18112
18113#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18114pub struct PermissionPersonWithOriginsOriginsItemVariant1 {
18115    /// If set, this group type role permission is revoked by the group role with this ID and does not contribute to the effective value
18116    #[serde(rename = "revokedByGroupRoleId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18117    pub revoked_by_group_role_id: Option<i64>,
18118    /// 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
18119    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
18120    pub value: serde_json::Value,
18121    /// Allowed values: `loggedIn`.
18122    #[serde(deserialize_with = "crate::lenient::string")]
18123    pub r#type: String,
18124    /// Fields not described by the spec, e.g. instance-specific DB fields.
18125    #[serde(flatten)]
18126    pub extra: serde_json::Map<String, serde_json::Value>,
18127}
18128
18129#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18130pub struct PermissionPersonWithOriginsOriginsItemVariant2 {
18131    /// If set, this group type role permission is revoked by the group role with this ID and does not contribute to the effective value
18132    #[serde(rename = "revokedByGroupRoleId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18133    pub revoked_by_group_role_id: Option<i64>,
18134    /// 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
18135    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
18136    pub value: serde_json::Value,
18137    /// Allowed values: `superAdmin`.
18138    #[serde(deserialize_with = "crate::lenient::string")]
18139    pub r#type: String,
18140    /// Fields not described by the spec, e.g. instance-specific DB fields.
18141    #[serde(flatten)]
18142    pub extra: serde_json::Map<String, serde_json::Value>,
18143}
18144
18145#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18146pub struct PermissionPersonWithOriginsOriginsItemVariant3 {
18147    /// If set, this group type role permission is revoked by the group role with this ID and does not contribute to the effective value
18148    #[serde(rename = "revokedByGroupRoleId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18149    pub revoked_by_group_role_id: Option<i64>,
18150    /// 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
18151    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
18152    pub value: serde_json::Value,
18153    /// Allowed values: `publicUser`.
18154    #[serde(deserialize_with = "crate::lenient::string")]
18155    pub r#type: String,
18156    /// Fields not described by the spec, e.g. instance-specific DB fields.
18157    #[serde(flatten)]
18158    pub extra: serde_json::Map<String, serde_json::Value>,
18159}
18160
18161#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18162pub struct PermissionPersonWithOriginsOriginsItemVariant4 {
18163    /// If set, this group type role permission is revoked by the group role with this ID and does not contribute to the effective value
18164    #[serde(rename = "revokedByGroupRoleId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18165    pub revoked_by_group_role_id: Option<i64>,
18166    /// 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
18167    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
18168    pub value: serde_json::Value,
18169    /// ID of the person the permission is set on directly
18170    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
18171    pub person_id: i64,
18172    /// Allowed values: `person`.
18173    #[serde(deserialize_with = "crate::lenient::string")]
18174    pub r#type: String,
18175    /// Fields not described by the spec, e.g. instance-specific DB fields.
18176    #[serde(flatten)]
18177    pub extra: serde_json::Map<String, serde_json::Value>,
18178}
18179
18180#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18181pub struct PermissionPersonWithOriginsOriginsItemVariant5 {
18182    /// If set, this group type role permission is revoked by the group role with this ID and does not contribute to the effective value
18183    #[serde(rename = "revokedByGroupRoleId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18184    pub revoked_by_group_role_id: Option<i64>,
18185    /// 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
18186    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
18187    pub value: serde_json::Value,
18188    /// ID of the person status that grants the permission
18189    #[serde(rename = "statusId", deserialize_with = "crate::lenient::number")]
18190    pub status_id: i64,
18191    /// Allowed values: `status`.
18192    #[serde(deserialize_with = "crate::lenient::string")]
18193    pub r#type: String,
18194    /// Fields not described by the spec, e.g. instance-specific DB fields.
18195    #[serde(flatten)]
18196    pub extra: serde_json::Map<String, serde_json::Value>,
18197}
18198
18199#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18200pub struct PermissionPersonWithOriginsOriginsItemVariant6 {
18201    /// If set, this group type role permission is revoked by the group role with this ID and does not contribute to the effective value
18202    #[serde(rename = "revokedByGroupRoleId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18203    pub revoked_by_group_role_id: Option<i64>,
18204    /// 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
18205    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
18206    pub value: serde_json::Value,
18207    /// Group of the membership that grants the permission. For inherited permissions this is the superior group, not the target group.
18208    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
18209    pub group_id: i64,
18210    /// ID of the group role (`cdb_group_role`) that grants the permission
18211    #[serde(rename = "groupRoleId", deserialize_with = "crate::lenient::number")]
18212    pub group_role_id: i64,
18213    /// ID of the group type role of the membership
18214    #[serde(rename = "groupTypeRoleId", deserialize_with = "crate::lenient::number")]
18215    pub group_type_role_id: i64,
18216    /// Whether the permission reaches the target group through inheritance from a superior group
18217    pub inherited: bool,
18218    /// Allowed values: `groupRole`.
18219    #[serde(deserialize_with = "crate::lenient::string")]
18220    pub r#type: String,
18221    /// Fields not described by the spec, e.g. instance-specific DB fields.
18222    #[serde(flatten)]
18223    pub extra: serde_json::Map<String, serde_json::Value>,
18224}
18225
18226#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18227pub struct PermissionPersonWithOriginsOriginsItemVariant7 {
18228    /// If set, this group type role permission is revoked by the group role with this ID and does not contribute to the effective value
18229    #[serde(rename = "revokedByGroupRoleId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18230    pub revoked_by_group_role_id: Option<i64>,
18231    /// 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
18232    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
18233    pub value: serde_json::Value,
18234    /// Group of the membership that grants the permission. For inherited permissions this is the superior group, not the target group.
18235    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
18236    pub group_id: i64,
18237    /// ID of the group type whose role grants the permission
18238    #[serde(rename = "groupTypeId", deserialize_with = "crate::lenient::number")]
18239    pub group_type_id: i64,
18240    /// ID of the group type role of the membership
18241    #[serde(rename = "groupTypeRoleId", deserialize_with = "crate::lenient::number")]
18242    pub group_type_role_id: i64,
18243    /// Whether the permission reaches the target group through inheritance from a superior group
18244    pub inherited: bool,
18245    /// Allowed values: `groupTypeRole`.
18246    #[serde(deserialize_with = "crate::lenient::string")]
18247    pub r#type: String,
18248    /// Fields not described by the spec, e.g. instance-specific DB fields.
18249    #[serde(flatten)]
18250    pub extra: serde_json::Map<String, serde_json::Value>,
18251}
18252
18253/// 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.
18254#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18255pub struct PermissionPersons {
18256    /// Numeric permission key from the internal authorization table
18257    #[serde(rename = "authId", deserialize_with = "crate::lenient::number")]
18258    pub auth_id: i64,
18259    /// Present when page, limit or include=origins enables pagination. Nested under data, not a top-level response meta field.
18260    #[serde(default, skip_serializing_if = "Option::is_none")]
18261    pub meta: Option<PermissionPersonsMeta>,
18262    /// Effective persons grouped by the requested permission selection values
18263    pub selections: Vec<PermissionPersonSelection>,
18264    /// Fields not described by the spec, e.g. instance-specific DB fields.
18265    #[serde(flatten)]
18266    pub extra: serde_json::Map<String, serde_json::Value>,
18267}
18268
18269/// Present when page, limit or include=origins enables pagination. Nested under data, not a top-level response meta field.
18270#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18271pub struct PermissionPersonsMeta {
18272    #[serde(deserialize_with = "crate::lenient::number")]
18273    pub limit: i64,
18274    #[serde(deserialize_with = "crate::lenient::number")]
18275    pub page: i64,
18276    #[serde(deserialize_with = "crate::lenient::number")]
18277    pub total: i64,
18278    /// Fields not described by the spec, e.g. instance-specific DB fields.
18279    #[serde(flatten)]
18280    pub extra: serde_json::Map<String, serde_json::Value>,
18281}
18282
18283/// Atomically replace all stored selection rows for one permission, inheritance mode and source owner. An empty dataId list removes the assignment.
18284#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18285pub struct PermissionReplace {
18286    /// Permission ID. status and person require values below 10000. Role domains also accept internal permission IDs. 10127 is obsolete and returns 410.
18287    #[serde(rename = "authId", deserialize_with = "crate::lenient::number")]
18288    pub auth_id: i64,
18289    /// Complete replacement selection. Use \[-1\] for unrestricted selection access or \[\] to remove the assignment.
18290    #[serde(rename = "dataId")]
18291    pub data_id: Vec<i64>,
18292    /// Select inherited-source rows when true, otherwise direct rows. Only role domains allow true.
18293    #[serde(rename = "isInherited", default, skip_serializing_if = "Option::is_none")]
18294    pub is_inherited: Option<bool>,
18295    /// Optional explanation for the replacement assignment.
18296    ///
18297    /// `None` leaves the field out, `Some(None)` sends `null`.
18298    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
18299    pub reason: Option<Option<String>>,
18300    /// Grant a permission, or revoke a contribution for a concrete group_role. revoke is rejected for all other source domains.
18301    /// Allowed values: `grant`, `revoke`.
18302    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18303    pub r#type: Option<String>,
18304    /// Fields not described by the spec, e.g. instance-specific DB fields.
18305    #[serde(flatten)]
18306    pub extra: serde_json::Map<String, serde_json::Value>,
18307}
18308
18309/// Add or update stored assignment rows. This is not full replacement of the owner’s permissions. Path parameters identify the source owner.
18310#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18311pub struct PermissionUpdate {
18312    /// Permission ID. status and person require values below 10000. Role domains also accept internal permission IDs. 10127 is obsolete and returns 410.
18313    #[serde(rename = "authId", deserialize_with = "crate::lenient::number")]
18314    pub auth_id: i64,
18315    /// 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.
18316    ///
18317    /// `None` leaves the field out, `Some(None)` sends `null`.
18318    #[serde(rename = "dataId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
18319    pub data_id: Option<Option<Vec<i64>>>,
18320    /// Select inherited-source rows when true, otherwise direct rows. Only role domains allow true.
18321    #[serde(rename = "isInherited", default, skip_serializing_if = "Option::is_none")]
18322    pub is_inherited: Option<bool>,
18323    /// Trimmed optional explanation. Empty/whitespace input becomes null. No maximum length is validated by the controller.
18324    ///
18325    /// `None` leaves the field out, `Some(None)` sends `null`.
18326    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
18327    pub reason: Option<Option<String>>,
18328    /// Grant a permission, or revoke a contribution for a concrete group_role. revoke is rejected for all other source domains.
18329    /// Allowed values: `grant`, `revoke`.
18330    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18331    pub r#type: Option<String>,
18332    /// Fields not described by the spec, e.g. instance-specific DB fields.
18333    #[serde(flatten)]
18334    pub extra: serde_json::Map<String, serde_json::Value>,
18335}
18336
18337/// 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.
18338#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18339pub struct PermissionWithOrigins {
18340    /// Permission key within the module. Group internal permissions start with `+`.
18341    #[serde(deserialize_with = "crate::lenient::string")]
18342    pub auth: String,
18343    /// Numeric permission key from the internal authorization table
18344    #[serde(rename = "authId", deserialize_with = "crate::lenient::number")]
18345    pub auth_id: i64,
18346    /// 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.
18347    #[serde(rename = "effectiveValue", default, skip_serializing_if = "serde_json::Value::is_null")]
18348    pub effective_value: serde_json::Value,
18349    /// Module the permission belongs to
18350    #[serde(deserialize_with = "crate::lenient::string")]
18351    pub module: String,
18352    pub origins: Vec<serde_json::Value>,
18353    /// Fields not described by the spec, e.g. instance-specific DB fields.
18354    #[serde(flatten)]
18355    pub extra: serde_json::Map<String, serde_json::Value>,
18356}
18357
18358/// 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.
18359#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18360pub struct Person {
18361    /// A simple date in ISO format, e.g. '2022-10-19'
18362    #[serde(default, skip_serializing_if = "Option::is_none")]
18363    pub acceptedsecurity: Option<chrono::NaiveDate>,
18364    #[serde(rename = "addressAddition", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18365    pub address_addition: Option<String>,
18366    /// 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.
18367    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18368    pub age: Option<i64>,
18369    #[serde(rename = "baptisedBy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18370    pub baptised_by: Option<String>,
18371    #[serde(rename = "birthName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18372    pub birth_name: Option<String>,
18373    /// A simple date in ISO format, e.g. '2022-10-19'
18374    #[serde(default, skip_serializing_if = "Option::is_none")]
18375    pub birthday: Option<chrono::NaiveDate>,
18376    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18377    pub birthplace: Option<String>,
18378    #[serde(rename = "campusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18379    pub campus_id: Option<i64>,
18380    #[serde(rename = "canChat", default, skip_serializing_if = "Option::is_none")]
18381    pub can_chat: Option<bool>,
18382    #[serde(rename = "chatActive", default, skip_serializing_if = "Option::is_none")]
18383    pub chat_active: Option<bool>,
18384    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18385    pub city: Option<String>,
18386    #[serde(rename = "cmsUserId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18387    pub cms_user_id: Option<String>,
18388    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18389    pub country: Option<String>,
18390    /// A simple date in ISO format, e.g. '2022-10-19'
18391    #[serde(rename = "dateOfBaptism", default, skip_serializing_if = "Option::is_none")]
18392    pub date_of_baptism: Option<chrono::NaiveDate>,
18393    /// A simple date in ISO format, e.g. '2022-10-19'
18394    #[serde(rename = "dateOfBelonging", default, skip_serializing_if = "Option::is_none")]
18395    pub date_of_belonging: Option<chrono::NaiveDate>,
18396    /// A simple date in ISO format, e.g. '2022-10-19'
18397    #[serde(rename = "dateOfDeath", default, skip_serializing_if = "Option::is_none")]
18398    pub date_of_death: Option<chrono::NaiveDate>,
18399    /// A simple date in ISO format, e.g. '2022-10-19'
18400    #[serde(rename = "dateOfEntry", default, skip_serializing_if = "Option::is_none")]
18401    pub date_of_entry: Option<chrono::NaiveDate>,
18402    /// A simple date in ISO format, e.g. '2022-10-19'
18403    #[serde(rename = "dateOfResign", default, skip_serializing_if = "Option::is_none")]
18404    pub date_of_resign: Option<chrono::NaiveDate>,
18405    /// List of department IDs
18406    #[serde(rename = "departmentIds", default, skip_serializing_if = "Option::is_none")]
18407    pub department_ids: Option<Vec<i64>>,
18408    /// Edit security level of the current person. The user can edit fields upto this level.
18409    #[serde(rename = "editSecurityLevelForPerson", deserialize_with = "crate::lenient::number")]
18410    pub edit_security_level_for_person: i64,
18411    /// Primary email address of the person.
18412    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18413    pub email: Option<String>,
18414    #[serde(default, skip_serializing_if = "Option::is_none")]
18415    pub emails: Option<Vec<PersonEmailsItem>>,
18416    #[serde(rename = "familyImageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18417    pub family_image_url: Option<String>,
18418    #[serde(rename = "familyStatusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18419    pub family_status_id: Option<i64>,
18420    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18421    pub fax: Option<String>,
18422    /// A simple date in ISO format, e.g. '2022-10-19'
18423    #[serde(rename = "firstContact", default, skip_serializing_if = "Option::is_none")]
18424    pub first_contact: Option<chrono::NaiveDate>,
18425    #[serde(rename = "firstName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18426    pub first_name: Option<String>,
18427    #[serde(rename = "growPathId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18428    pub grow_path_id: Option<i64>,
18429    #[serde(deserialize_with = "crate::lenient::string")]
18430    pub guid: String,
18431    #[serde(deserialize_with = "crate::lenient::number")]
18432    pub id: i64,
18433    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18434    pub image_url: Option<String>,
18435    /// Allowed values: `accepted`, `not_invited`, `pending`.
18436    #[serde(rename = "invitationStatus", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18437    pub invitation_status: Option<String>,
18438    #[serde(rename = "isArchived", default, skip_serializing_if = "Option::is_none")]
18439    pub is_archived: Option<bool>,
18440    /// This computed field is true iff a date of death is set for this person.
18441    #[serde(rename = "isDead", default, skip_serializing_if = "Option::is_none")]
18442    pub is_dead: Option<bool>,
18443    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18444    pub job: Option<String>,
18445    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
18446    #[serde(rename = "lastEditedDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
18447    pub last_edited_date: Option<chrono::DateTime<chrono::Utc>>,
18448    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
18449    #[serde(rename = "lastLogin", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
18450    pub last_login: Option<chrono::DateTime<chrono::Utc>>,
18451    #[serde(rename = "lastName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18452    pub last_name: Option<String>,
18453    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18454    pub latitude: Option<f64>,
18455    #[serde(rename = "latitudeLoose", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18456    pub latitude_loose: Option<f64>,
18457    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18458    pub longitude: Option<f64>,
18459    #[serde(rename = "longitudeLoose", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18460    pub longitude_loose: Option<f64>,
18461    #[serde(default, skip_serializing_if = "Option::is_none")]
18462    pub meta: Option<MetaDataEntityId>,
18463    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18464    pub mobile: Option<String>,
18465    #[serde(rename = "nationalityId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18466    pub nationality_id: Option<i64>,
18467    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18468    pub nickname: Option<String>,
18469    /// String with Optigem ID or empty string if no ID is set.
18470    #[serde(rename = "optigemId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18471    pub optigem_id: Option<String>,
18472    #[serde(rename = "phonePrivate", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18473    pub phone_private: Option<String>,
18474    #[serde(rename = "phoneWork", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18475    pub phone_work: Option<String>,
18476    #[serde(rename = "placeOfBaptism", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18477    pub place_of_baptism: Option<String>,
18478    #[serde(rename = "privacyPolicyAgreement", default, skip_serializing_if = "Option::is_none")]
18479    #[deprecated = "deprecated in the ChurchTools API"]
18480    pub privacy_policy_agreement: Option<PersonPrivacyPolicyAgreement>,
18481    /// A simple date in ISO format, e.g. '2022-10-19'
18482    #[serde(rename = "privacyPolicyAgreementDate", default, skip_serializing_if = "Option::is_none")]
18483    pub privacy_policy_agreement_date: Option<chrono::NaiveDate>,
18484    #[serde(rename = "privacyPolicyAgreementTypeId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18485    pub privacy_policy_agreement_type_id: Option<i64>,
18486    #[serde(rename = "privacyPolicyAgreementWhoId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18487    pub privacy_policy_agreement_who_id: Option<i64>,
18488    #[serde(rename = "referredBy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18489    pub referred_by: Option<String>,
18490    #[serde(rename = "referredTo", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18491    pub referred_to: Option<String>,
18492    /// Security level of the current person. The user sees fields upto this level.
18493    #[serde(rename = "securityLevelForPerson", deserialize_with = "crate::lenient::number")]
18494    pub security_level_for_person: i64,
18495    #[serde(rename = "sexId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18496    pub sex_id: Option<i64>,
18497    #[serde(rename = "statusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18498    pub status_id: Option<i64>,
18499    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18500    pub street: Option<String>,
18501    #[serde(default, skip_serializing_if = "Option::is_none")]
18502    pub tags: Option<Vec<Tag>>,
18503    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18504    pub title: Option<String>,
18505    /// Extensible visibility of a person.
18506    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18507    pub visibility: Option<String>,
18508    /// A simple date in ISO format, e.g. '2022-10-19'
18509    #[serde(rename = "weddingDate", default, skip_serializing_if = "Option::is_none")]
18510    pub wedding_date: Option<chrono::NaiveDate>,
18511    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18512    pub zip: Option<String>,
18513    /// Fields not described by the spec, e.g. instance-specific DB fields.
18514    #[serde(flatten)]
18515    pub extra: serde_json::Map<String, serde_json::Value>,
18516}
18517
18518#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18519pub struct PersonDuplicate {
18520    #[serde(deserialize_with = "crate::lenient::string")]
18521    pub key: String,
18522    pub p1: MetaDataPersonId,
18523    pub p2: MetaDataPersonId,
18524    #[serde(rename = "relationshipId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18525    pub relationship_id: Option<i64>,
18526    /// Fields not described by the spec, e.g. instance-specific DB fields.
18527    #[serde(flatten)]
18528    pub extra: serde_json::Map<String, serde_json::Value>,
18529}
18530
18531#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18532pub struct PersonEmail {
18533    #[serde(rename = "contactLabelId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18534    pub contact_label_id: Option<i64>,
18535    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18536    pub email: Option<String>,
18537    /// Marks the default eMail address.
18538    #[serde(rename = "isDefault", default, skip_serializing_if = "Option::is_none")]
18539    pub is_default: Option<bool>,
18540    /// Fields not described by the spec, e.g. instance-specific DB fields.
18541    #[serde(flatten)]
18542    pub extra: serde_json::Map<String, serde_json::Value>,
18543}
18544
18545#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18546pub struct PersonEmailsItem {
18547    #[serde(rename = "contactLabelId", deserialize_with = "crate::lenient::number")]
18548    pub contact_label_id: i64,
18549    #[serde(deserialize_with = "crate::lenient::string")]
18550    pub email: String,
18551    #[serde(rename = "isDefault")]
18552    pub is_default: bool,
18553    /// Fields not described by the spec, e.g. instance-specific DB fields.
18554    #[serde(flatten)]
18555    pub extra: serde_json::Map<String, serde_json::Value>,
18556}
18557
18558/// Download information for a newly generated personal data sheet. The PDF is a separate download, not the body of this API response.
18559#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18560pub struct PersonInformationExport {
18561    /// Absolute download URL of the generated PDF. The stored file is scheduled for deletion after one day; this is not a permanent document URL.
18562    #[serde(rename = "pdfLink", deserialize_with = "crate::lenient::string")]
18563    pub pdf_link: String,
18564    /// Fields not described by the spec, e.g. instance-specific DB fields.
18565    #[serde(flatten)]
18566    pub extra: serde_json::Map<String, serde_json::Value>,
18567}
18568
18569/// 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.
18570#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18571pub struct PersonMasterData {
18572    /// Age-range classifications for groups.
18573    #[serde(rename = "ageGroups")]
18574    pub age_groups: Vec<AgeGroup>,
18575    /// Profiles of type campus only, ordered by sortKey; church profiles are excluded.
18576    pub campuses: Vec<Campus>,
18577    /// Visibility categories for person comments.
18578    #[serde(rename = "commentViewers")]
18579    pub comment_viewers: Vec<CommentViewer>,
18580    /// Labels for contact information.
18581    #[serde(rename = "contactLabels")]
18582    pub contact_labels: Vec<ContactLabel>,
18583    /// Department definitions used in person/group organization.
18584    pub departments: Vec<Department>,
18585    /// Categories used to organize groups.
18586    #[serde(rename = "groupCategories")]
18587    pub group_categories: Vec<GroupCategory>,
18588    /// Reusable meeting feedback form definitions, not meeting dates.
18589    #[serde(rename = "groupMeetingTemplates")]
18590    pub group_meeting_templates: Vec<MeetingTemplate>,
18591    /// Lifecycle status definitions for groups.
18592    #[serde(rename = "groupStatuses")]
18593    pub group_statuses: Vec<GroupStatus>,
18594    /// Group-type definitions controlling available group features.
18595    #[serde(rename = "groupTypes")]
18596    pub group_types: Vec<GroupType>,
18597    /// Growth-path definitions associated with membership roles.
18598    #[serde(rename = "growPaths")]
18599    pub grow_paths: Vec<GrowPath>,
18600    /// Person relationship definitions, including directional labels.
18601    #[serde(rename = "relationshipTypes")]
18602    pub relationship_types: Vec<RelationshipType>,
18603    /// Membership role definitions across group types, ordered by role type and sortKey. Group-specific role settings are returned elsewhere.
18604    pub roles: Vec<Role>,
18605    /// Sex/gender master-data choices.
18606    pub sexes: Vec<Sex>,
18607    /// Person status definitions; distinct from group status and membership workflow state.
18608    pub statuses: Vec<Status>,
18609    /// Audience classifications for groups.
18610    #[serde(rename = "targetGroups")]
18611    pub target_groups: Vec<TargetGroup>,
18612    /// Fields not described by the spec, e.g. instance-specific DB fields.
18613    #[serde(flatten)]
18614    pub extra: serde_json::Map<String, serde_json::Value>,
18615}
18616
18617#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18618pub struct PersonMergeGroupDiff {
18619    /// 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.
18620    /// Allowed values: `active`, `requested`, `to_delete`, `waiting`.
18621    #[serde(rename = "groupMemberStatus", deserialize_with = "crate::lenient::string")]
18622    pub group_member_status: String,
18623    /// ID of the group
18624    #[serde(deserialize_with = "crate::lenient::number")]
18625    pub id: i64,
18626    /// Name of the member role
18627    #[serde(deserialize_with = "crate::lenient::string")]
18628    pub role: String,
18629    /// ID of the member role
18630    #[serde(rename = "roleId", deserialize_with = "crate::lenient::number")]
18631    pub role_id: i64,
18632    /// Name of the group
18633    #[serde(deserialize_with = "crate::lenient::string")]
18634    pub title: String,
18635    /// Name of the group type
18636    #[serde(deserialize_with = "crate::lenient::string")]
18637    pub r#type: String,
18638    /// Fields not described by the spec, e.g. instance-specific DB fields.
18639    #[serde(flatten)]
18640    pub extra: serde_json::Map<String, serde_json::Value>,
18641}
18642
18643#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18644pub struct PersonMergeGroupsDiff {
18645    /// IDs of groups in which both persons are members
18646    pub both: Vec<i64>,
18647    /// Groups in which the duplicate person is involved
18648    pub new: Vec<PersonMergeGroupDiff>,
18649    /// Groups in which the original person is involved
18650    pub old: Vec<PersonMergeGroupDiff>,
18651    /// Fields not described by the spec, e.g. instance-specific DB fields.
18652    #[serde(flatten)]
18653    pub extra: serde_json::Map<String, serde_json::Value>,
18654}
18655
18656#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18657pub struct PersonMergeInfo {
18658    #[serde(rename = "groupsDiff")]
18659    pub groups_diff: PersonMergeGroupsDiff,
18660    #[serde(rename = "personDiff")]
18661    pub person_diff: Vec<PersonMergePersonDiff>,
18662    /// Fields not described by the spec, e.g. instance-specific DB fields.
18663    #[serde(flatten)]
18664    pub extra: serde_json::Map<String, serde_json::Value>,
18665}
18666
18667#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18668pub struct PersonMergePersonDiff {
18669    /// Translation key of the person field
18670    #[serde(deserialize_with = "crate::lenient::string")]
18671    pub key: String,
18672    /// Name of the person field
18673    #[serde(deserialize_with = "crate::lenient::string")]
18674    pub name: String,
18675    /// Value from the duplicate person
18676    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
18677    pub new: serde_json::Value,
18678    /// Value from the original person
18679    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
18680    pub old: serde_json::Value,
18681    /// Whether the difference should be included in change logs
18682    #[serde(rename = "printDiff")]
18683    pub print_diff: bool,
18684    /// Fields not described by the spec, e.g. instance-specific DB fields.
18685    #[serde(flatten)]
18686    pub extra: serde_json::Map<String, serde_json::Value>,
18687}
18688
18689/// Password inputs are not trimmed. The minimum length can be configured by the installation.
18690#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18691pub struct PersonPasswordUpdate {
18692    /// New password satisfying the installation’s length and strength rules.
18693    #[serde(rename = "newPassword", deserialize_with = "crate::lenient::string")]
18694    pub new_password: String,
18695    /// Must exactly match newPassword.
18696    #[serde(rename = "newPasswordConfirm", deserialize_with = "crate::lenient::string")]
18697    pub new_password_confirm: String,
18698    /// Current password, or an empty string for a password-reset session or initial setup without a password.
18699    #[serde(rename = "oldPassword", deserialize_with = "crate::lenient::string")]
18700    pub old_password: String,
18701    /// Fields not described by the spec, e.g. instance-specific DB fields.
18702    #[serde(flatten)]
18703    pub extra: serde_json::Map<String, serde_json::Value>,
18704}
18705
18706#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18707pub struct PersonPostStatistics {
18708    #[serde(rename = "countBanned", deserialize_with = "crate::lenient::number")]
18709    pub count_banned: f64,
18710    #[serde(rename = "countExpirationFuture", deserialize_with = "crate::lenient::number")]
18711    pub count_expiration_future: f64,
18712    #[serde(rename = "countExpirationPast", deserialize_with = "crate::lenient::number")]
18713    pub count_expiration_past: f64,
18714    #[serde(rename = "countPublicationFuture", deserialize_with = "crate::lenient::number")]
18715    pub count_publication_future: f64,
18716    #[serde(rename = "countPublished", deserialize_with = "crate::lenient::number")]
18717    pub count_published: f64,
18718    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18719    #[deprecated = "deprecated in the ChurchTools API"]
18720    pub total: Option<f64>,
18721    /// Fields not described by the spec, e.g. instance-specific DB fields.
18722    #[serde(flatten)]
18723    pub extra: serde_json::Map<String, serde_json::Value>,
18724}
18725
18726/// 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.
18727#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18728pub struct PersonPrivacyPolicy {
18729    /// Minimum age for independent consent and self-registration, even when registration is disabled.
18730    #[serde(rename = "minimumAge", deserialize_with = "crate::lenient::number")]
18731    pub minimum_age: i64,
18732    pub owner: PersonPrivacyPolicyOwner,
18733    pub relationships: Vec<PersonPrivacyPolicyRelationshipsItem>,
18734    /// Whether the configured banner should be shown for outstanding own or child consent.
18735    #[serde(rename = "showBanner")]
18736    pub show_banner: bool,
18737    /// Configured own-consent confirmation text.
18738    #[serde(deserialize_with = "crate::lenient::string")]
18739    pub text: String,
18740    /// Configured child-consent confirmation text.
18741    #[serde(rename = "textRelations", deserialize_with = "crate::lenient::string")]
18742    pub text_relations: String,
18743    /// Suggested consent type: self-confirmation.
18744    #[serde(rename = "typeId", deserialize_with = "crate::lenient::number")]
18745    pub type_id: i64,
18746    /// Suggested consent-giver category: the person themselves.
18747    #[serde(rename = "whoId", deserialize_with = "crate::lenient::number")]
18748    pub who_id: i64,
18749    /// Fields not described by the spec, e.g. instance-specific DB fields.
18750    #[serde(flatten)]
18751    pub extra: serde_json::Map<String, serde_json::Value>,
18752}
18753
18754#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18755pub struct PersonPrivacyPolicyAgreement {
18756    /// A simple date in ISO format, e.g. '2022-10-19'
18757    #[serde(default, skip_serializing_if = "Option::is_none")]
18758    pub date: Option<chrono::NaiveDate>,
18759    #[serde(rename = "typeId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18760    pub type_id: Option<i64>,
18761    #[serde(rename = "whoId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18762    pub who_id: Option<i64>,
18763    /// Fields not described by the spec, e.g. instance-specific DB fields.
18764    #[serde(flatten)]
18765    pub extra: serde_json::Map<String, serde_json::Value>,
18766}
18767
18768/// Outcome for one child marked accepted in the request. The HTTP 200 response can include non-successful outcomes.
18769#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18770pub struct PersonPrivacyPolicyChildResult {
18771    /// Localized error text for error outcomes; empty string otherwise.
18772    #[serde(deserialize_with = "crate::lenient::string")]
18773    pub error: String,
18774    #[serde(deserialize_with = "crate::lenient::number")]
18775    pub id: i64,
18776    /// Per-child outcome.
18777    /// Allowed values: `error`, `not allowed`, `success`.
18778    #[serde(deserialize_with = "crate::lenient::string")]
18779    pub r#type: String,
18780    /// Fields not described by the spec, e.g. instance-specific DB fields.
18781    #[serde(flatten)]
18782    pub extra: serde_json::Map<String, serde_json::Value>,
18783}
18784
18785/// Child-consent selection consumed by the service. Nested fields are not validated by the controller; supply all fields with the documented types.
18786#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18787pub struct PersonPrivacyPolicyChildUpdate {
18788    /// Whether to request consent for this child.
18789    pub accepted: bool,
18790    /// Birthday as YYYY-MM-DD when adding one, otherwise an empty string. This endpoint does not perform structured date validation.
18791    #[serde(deserialize_with = "crate::lenient::string")]
18792    pub birthday: String,
18793    /// Whether the submitted birthday should be written.
18794    #[serde(rename = "editBirthday")]
18795    pub edit_birthday: bool,
18796    /// Person ID of the child.
18797    #[serde(deserialize_with = "crate::lenient::number")]
18798    pub id: i64,
18799    /// Fields not described by the spec, e.g. instance-specific DB fields.
18800    #[serde(flatten)]
18801    pub extra: serde_json::Map<String, serde_json::Value>,
18802}
18803
18804#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18805pub struct PersonPrivacyPolicyOwner {
18806    pub accepted: bool,
18807    /// Stored consent timestamp, or null. Not normalized to a UTC timestamp by this transformer.
18808    #[serde(rename = "acceptedDate", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18809    pub accepted_date: Option<String>,
18810    /// Stored label of the consent type, not its ID or a translated label; null without a type. A legacy zero ID can remain 0.
18811    #[serde(rename = "acceptedType", default, skip_serializing_if = "serde_json::Value::is_null")]
18812    pub accepted_type: serde_json::Value,
18813    /// Consent-giver category ID, or null.
18814    #[serde(rename = "acceptedWho", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18815    pub accepted_who: Option<i64>,
18816    /// Age in years, or 0 when the birthday is unknown.
18817    #[serde(deserialize_with = "crate::lenient::number")]
18818    pub age: i64,
18819    /// UI flag based on enabled consent banner and the configured minimumAge; not a complete authorization decision.
18820    #[serde(rename = "allowedToAccept")]
18821    pub allowed_to_accept: bool,
18822    /// True when no birthday is stored, independently of consent status.
18823    #[serde(rename = "editBirthday")]
18824    pub edit_birthday: bool,
18825    #[serde(rename = "firstName", deserialize_with = "crate::lenient::string")]
18826    pub first_name: String,
18827    #[serde(deserialize_with = "crate::lenient::number")]
18828    pub id: i64,
18829    /// Image URL of the person.
18830    #[serde(deserialize_with = "crate::lenient::string")]
18831    pub image: String,
18832    #[serde(rename = "lastName", deserialize_with = "crate::lenient::string")]
18833    pub last_name: String,
18834    /// Fields not described by the spec, e.g. instance-specific DB fields.
18835    #[serde(flatten)]
18836    pub extra: serde_json::Map<String, serde_json::Value>,
18837}
18838
18839/// Child-side person of a parent/child relationship, with consent flags. Relationships can include adults; their flags normally prevent child-consent actions.
18840#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18841pub struct PersonPrivacyPolicyRelationshipsItem {
18842    pub accepted: bool,
18843    /// Stored consent timestamp, or null. Not normalized to a UTC timestamp by this transformer.
18844    #[serde(rename = "acceptedDate", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18845    pub accepted_date: Option<String>,
18846    /// Stored consent-type label, or an empty string if none is found.
18847    #[serde(rename = "acceptedType", deserialize_with = "crate::lenient::string")]
18848    pub accepted_type: String,
18849    /// Consent-giver category ID, or null.
18850    #[serde(rename = "acceptedWho", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18851    pub accepted_who: Option<i64>,
18852    #[serde(deserialize_with = "crate::lenient::number")]
18853    pub age: i64,
18854    #[serde(rename = "allowedToAccept")]
18855    pub allowed_to_accept: bool,
18856    #[serde(rename = "allowedToDecline")]
18857    pub allowed_to_decline: bool,
18858    /// Stored date of death, if any.
18859    #[serde(rename = "dateOfDeath", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18860    pub date_of_death: Option<String>,
18861    #[serde(rename = "editBirthday")]
18862    pub edit_birthday: bool,
18863    #[serde(rename = "firstName", deserialize_with = "crate::lenient::string")]
18864    pub first_name: String,
18865    #[serde(deserialize_with = "crate::lenient::string")]
18866    pub guid: String,
18867    #[serde(deserialize_with = "crate::lenient::number")]
18868    pub id: i64,
18869    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18870    pub image: Option<String>,
18871    /// Archive status of the related person.
18872    #[serde(rename = "isArchived")]
18873    pub is_archived: bool,
18874    #[serde(rename = "lastName", deserialize_with = "crate::lenient::string")]
18875    pub last_name: String,
18876    #[serde(rename = "relationshipType")]
18877    pub relationship_type: PersonPrivacyPolicyRelationshipsItemRelationshipType,
18878    /// Fields not described by the spec, e.g. instance-specific DB fields.
18879    #[serde(flatten)]
18880    pub extra: serde_json::Map<String, serde_json::Value>,
18881}
18882
18883#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18884pub struct PersonPrivacyPolicyRelationshipsItemRelationshipType {
18885    #[serde(rename = "degreeOfRelationship", deserialize_with = "crate::lenient::string")]
18886    pub degree_of_relationship: String,
18887    /// ID of this relationship instance, not the relationship type.
18888    #[serde(deserialize_with = "crate::lenient::number")]
18889    pub id: i64,
18890    #[serde(rename = "relationshipName", deserialize_with = "crate::lenient::string")]
18891    pub relationship_name: String,
18892    #[serde(rename = "relationshipTypeId", deserialize_with = "crate::lenient::number")]
18893    pub relationship_type_id: i64,
18894    /// Fields not described by the spec, e.g. instance-specific DB fields.
18895    #[serde(flatten)]
18896    pub extra: serde_json::Map<String, serde_json::Value>,
18897}
18898
18899/// 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.
18900#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18901pub struct PersonPrivacyPolicyUpdate {
18902    /// 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.
18903    ///
18904    /// `None` leaves the field out, `Some(None)` sends `null`.
18905    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
18906    pub birthday: Option<Option<String>>,
18907    /// Whether to process the persons array.
18908    #[serde(rename = "childrenAccepted")]
18909    pub children_accepted: bool,
18910    /// Whether to process consent for the URL person.
18911    #[serde(rename = "ownAccepted")]
18912    pub own_accepted: bool,
18913    /// Child selections; use an empty array when not processing children.
18914    pub persons: Vec<PersonPrivacyPolicyChildUpdate>,
18915    /// Consent-type catalog ID used for own consent; typically the typeId from GET. Child consent always uses self-confirmation (2).
18916    #[serde(rename = "typeId", deserialize_with = "crate::lenient::number")]
18917    pub type_id: i64,
18918    /// Consent-giver catalog ID used for own consent; typically the whoId from GET. Child consent always uses parent (2).
18919    #[serde(rename = "whoId", deserialize_with = "crate::lenient::number")]
18920    pub who_id: i64,
18921    /// Fields not described by the spec, e.g. instance-specific DB fields.
18922    #[serde(flatten)]
18923    pub extra: serde_json::Map<String, serde_json::Value>,
18924}
18925
18926#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18927pub struct PersonProperties {
18928    #[serde(rename = "canChat")]
18929    pub can_chat: bool,
18930    #[serde(rename = "hasEmail")]
18931    pub has_email: bool,
18932    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18933    pub image_url: Option<String>,
18934    /// Allowed values: `accepted`, `not_invited`, `pending`.
18935    #[serde(rename = "invitationStatus", deserialize_with = "crate::lenient::string")]
18936    pub invitation_status: String,
18937    #[serde(rename = "isArchived")]
18938    pub is_archived: bool,
18939    #[serde(rename = "isDead")]
18940    pub is_dead: bool,
18941    /// Extensible visibility of a person.
18942    #[serde(deserialize_with = "crate::lenient::string")]
18943    pub visibility: String,
18944    /// Fields not described by the spec, e.g. instance-specific DB fields.
18945    #[serde(flatten)]
18946    pub extra: serde_json::Map<String, serde_json::Value>,
18947}
18948
18949/// 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.
18950#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18951pub struct PersonRelationship {
18952    /// Name of type, what this relative is for the user.
18953    #[serde(rename = "degreeOfRelationship", deserialize_with = "crate::lenient::string")]
18954    pub degree_of_relationship: String,
18955    /// ID of the relationship
18956    #[serde(deserialize_with = "crate::lenient::number")]
18957    pub id: i64,
18958    /// Name of Relationship
18959    #[serde(rename = "relationshipName", deserialize_with = "crate::lenient::string")]
18960    pub relationship_name: String,
18961    /// ID of relationship type
18962    #[serde(rename = "relationshipTypeId", deserialize_with = "crate::lenient::number")]
18963    pub relationship_type_id: i64,
18964    /// Person as Domain Object
18965    pub relative: DomainObjectPerson,
18966    /// Fields not described by the spec, e.g. instance-specific DB fields.
18967    #[serde(flatten)]
18968    pub extra: serde_json::Map<String, serde_json::Value>,
18969}
18970
18971/// 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.
18972#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18973pub struct PersonServiceRequestUpdate {
18974    /// Legacy alias for isAccepted. Prefer isAccepted in new integrations.
18975    #[serde(default, skip_serializing_if = "Option::is_none")]
18976    #[deprecated = "deprecated in the ChurchTools API"]
18977    pub agreed: Option<bool>,
18978    /// 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.
18979    ///
18980    /// `None` leaves the field out, `Some(None)` sends `null`.
18981    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
18982    pub comment: Option<Option<String>>,
18983    /// Accepted for compatibility; this flag does not control notifications in the current implementation. Notifications follow the assignment workflow.
18984    #[serde(default, skip_serializing_if = "Option::is_none")]
18985    pub inform_person: Option<bool>,
18986    /// true creates a confirmed assignment; false creates an assignment awaiting confirmation. false does not decline it.
18987    #[serde(rename = "isAccepted", default, skip_serializing_if = "Option::is_none")]
18988    pub is_accepted: Option<bool>,
18989    /// Fields not described by the spec, e.g. instance-specific DB fields.
18990    #[serde(flatten)]
18991    pub extra: serde_json::Map<String, serde_json::Value>,
18992}
18993
18994/// 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.
18995#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18996pub struct PersonSetting {
18997    /// Setting key within the module namespace.
18998    #[serde(deserialize_with = "crate::lenient::string")]
18999    pub attribute: String,
19000    /// Stored namespace. Read results are not restricted to the modules writable through this API.
19001    #[serde(deserialize_with = "crate::lenient::string")]
19002    pub module: String,
19003    /// 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.
19004    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
19005    pub value: serde_json::Value,
19006    /// Fields not described by the spec, e.g. instance-specific DB fields.
19007    #[serde(flatten)]
19008    pub extra: serde_json::Map<String, serde_json::Value>,
19009}
19010
19011/// 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.
19012///
19013/// Supported module/attribute pairs and value categories:
19014///
19015/// | Module | Attributes (value type) |
19016/// | --- | --- |
19017/// | churchcore | `saml-id` (numeric), `hidden-hints` (array), `hidden-hints-temporarily` (string), `alpha-consent` (numeric), `language` (string), `tour-completion-stats` (array) |
19018/// | churchhome | `startpageWidgets` (array), `hiddenStartpageWidgets` (array) |
19019/// | churchdb | `group-custom-views` (string), `favorite-groups` (array), `mailerBCC` (numeric), `sendBCCMail` (numeric), `signature` (string), `labelTemplateSelection` (string) |
19020/// | churchcal | `filterGemeindekalendar` (string), `filterGruppenKalender` (string), `filterPersonalKalender` (string), `currentBirthdayScope` (string) |
19021/// | churchservice | `file_attachToAllEvents` (numeric), `agendaExportSettings` (array) |
19022/// | 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) |
19023/// | 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) |
19024/// | wiki | `showMarkdownHints` (numeric) |
19025/// | global | `recent-searches` (array), `recent-persons` (array), `recent-groups` (array), `recent-wiki_pages` (array), `recent-songs` (array), `recent-appointments` (array), `simulatedPersons` (array), `station` (string) |
19026/// | app | `excluded-calendars` (array), `excluded-widgets` (array), `sorted-widgets` (array) |
19027/// | push | `birthday-type` (string), `disableGroupSignUpNotifications` (numeric), `groupSignUpNotificationsAgeGroupIds` (array), `groupSignUpNotificationsTargetGroupIds` (array), `groupSignUpNotificationsCategoryIds` (array) |
19028#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19029pub struct PersonSettingUpdate {
19030    /// Value of the selected setting, using its required type. Calendar filters require a string containing a JSON array, not a JSON array directly.
19031    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
19032    pub value: serde_json::Value,
19033    /// Fields not described by the spec, e.g. instance-specific DB fields.
19034    #[serde(flatten)]
19035    pub extra: serde_json::Map<String, serde_json::Value>,
19036}
19037
19038/// 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.
19039#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19040pub struct PersonTwoFactorEnabled {
19041    #[serde(deserialize_with = "crate::lenient::string")]
19042    pub attribute: String,
19043    #[serde(deserialize_with = "crate::lenient::string")]
19044    pub module: String,
19045    /// Whether the person has enabled TOTP authentication. False if no setting exists.
19046    pub value: bool,
19047    /// Fields not described by the spec, e.g. instance-specific DB fields.
19048    #[serde(flatten)]
19049    pub extra: serde_json::Map<String, serde_json::Value>,
19050}
19051
19052/// 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.
19053#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19054pub struct PersonTwoFactorForce {
19055    #[serde(deserialize_with = "crate::lenient::string")]
19056    pub attribute: String,
19057    #[serde(deserialize_with = "crate::lenient::string")]
19058    pub module: String,
19059    /// Explicit person-level requirement. Group-role requirements are not included.
19060    pub value: bool,
19061    /// Fields not described by the spec, e.g. instance-specific DB fields.
19062    #[serde(flatten)]
19063    pub extra: serde_json::Map<String, serde_json::Value>,
19064}
19065
19066#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19067pub struct PersonTwoFactorForceUpdate {
19068    /// Whether the person must configure two-factor authentication.
19069    pub value: bool,
19070    /// Fields not described by the spec, e.g. instance-specific DB fields.
19071    #[serde(flatten)]
19072    pub extra: serde_json::Map<String, serde_json::Value>,
19073}
19074
19075#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19076pub struct PersonTwoFactorVerify {
19077    /// 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.
19078    #[serde(deserialize_with = "crate::lenient::string")]
19079    pub code: String,
19080    /// ID of the current person whose initialized secret is checked.
19081    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
19082    pub person_id: i64,
19083    /// Fields not described by the spec, e.g. instance-specific DB fields.
19084    #[serde(flatten)]
19085    pub extra: serde_json::Map<String, serde_json::Value>,
19086}
19087
19088/// Fields applicable to upate a person
19089#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19090pub struct PersonUpdateable {
19091    #[serde(rename = "addressAddition", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19092    pub address_addition: Option<String>,
19093    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19094    pub age: Option<i64>,
19095    #[serde(rename = "baptisedBy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19096    pub baptised_by: Option<String>,
19097    #[serde(rename = "birthName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19098    pub birth_name: Option<String>,
19099    /// `None` leaves the field out, `Some(None)` sends `null`.
19100    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19101    pub birthday: Option<Option<chrono::NaiveDate>>,
19102    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19103    pub birthplace: Option<String>,
19104    #[serde(rename = "campusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19105    pub campus_id: Option<i64>,
19106    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19107    pub city: Option<String>,
19108    #[serde(rename = "cmsUserId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19109    pub cms_user_id: Option<String>,
19110    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19111    pub country: Option<String>,
19112    /// `None` leaves the field out, `Some(None)` sends `null`.
19113    #[serde(rename = "dateOfBaptism", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19114    pub date_of_baptism: Option<Option<chrono::NaiveDate>>,
19115    /// `None` leaves the field out, `Some(None)` sends `null`.
19116    #[serde(rename = "dateOfBelonging", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19117    pub date_of_belonging: Option<Option<chrono::NaiveDate>>,
19118    /// `None` leaves the field out, `Some(None)` sends `null`.
19119    #[serde(rename = "dateOfDeath", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19120    pub date_of_death: Option<Option<chrono::NaiveDate>>,
19121    /// `None` leaves the field out, `Some(None)` sends `null`.
19122    #[serde(rename = "dateOfEntry", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
19123    pub date_of_entry: Option<Option<chrono::DateTime<chrono::Utc>>>,
19124    /// `None` leaves the field out, `Some(None)` sends `null`.
19125    #[serde(rename = "dateOfResign", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
19126    pub date_of_resign: Option<Option<chrono::DateTime<chrono::Utc>>>,
19127    /// Department IDs. At least one department MUST be set for a person. The last department ID cannot be deleted.
19128    #[serde(rename = "departmentIds", default, skip_serializing_if = "Option::is_none")]
19129    pub department_ids: Option<Vec<i64>>,
19130    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19131    pub email: Option<String>,
19132    /// Save many eMail addresses for person. If `emails` is present in request `email` is ignored.
19133    #[serde(default, skip_serializing_if = "Option::is_none")]
19134    pub emails: Option<Vec<PersonEmail>>,
19135    /// `None` leaves the field out, `Some(None)` sends `null`.
19136    #[serde(rename = "familyStatusId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19137    pub family_status_id: Option<Option<i64>>,
19138    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19139    pub fax: Option<String>,
19140    /// `None` leaves the field out, `Some(None)` sends `null`.
19141    #[serde(rename = "firstContact", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
19142    pub first_contact: Option<Option<chrono::DateTime<chrono::Utc>>>,
19143    #[serde(rename = "firstName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19144    pub first_name: Option<String>,
19145    #[serde(rename = "growPathId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19146    pub grow_path_id: Option<i64>,
19147    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19148    pub job: Option<String>,
19149    #[serde(rename = "lastName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19150    pub last_name: Option<String>,
19151    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19152    pub mobile: Option<String>,
19153    /// `None` leaves the field out, `Some(None)` sends `null`.
19154    #[serde(rename = "nationalityId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19155    pub nationality_id: Option<Option<i64>>,
19156    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19157    pub nickname: Option<String>,
19158    #[serde(rename = "optigemId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19159    pub optigem_id: Option<String>,
19160    #[serde(rename = "phonePrivate", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19161    pub phone_private: Option<String>,
19162    #[serde(rename = "phoneWork", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19163    pub phone_work: Option<String>,
19164    #[serde(rename = "placeOfBaptism", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19165    pub place_of_baptism: Option<String>,
19166    /// This object can be optional or required. Depending on your ChurchTools data security settings.
19167    #[serde(rename = "privacyPolicyAgreement", default, skip_serializing_if = "Option::is_none")]
19168    pub privacy_policy_agreement: Option<PatchPersonsIdBodyPrivacyPolicyAgreement>,
19169    #[serde(rename = "referredBy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19170    pub referred_by: Option<String>,
19171    #[serde(rename = "referredTo", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19172    pub referred_to: Option<String>,
19173    /// `None` leaves the field out, `Some(None)` sends `null`.
19174    #[serde(rename = "sexId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19175    pub sex_id: Option<Option<i64>>,
19176    #[serde(rename = "statusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19177    pub status_id: Option<i64>,
19178    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19179    pub street: Option<String>,
19180    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19181    pub title: Option<String>,
19182    /// Visibility accepted when creating or updating a person.
19183    /// Allowed values: `hidden`, `visible`.
19184    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19185    pub visibility: Option<String>,
19186    /// `None` leaves the field out, `Some(None)` sends `null`.
19187    #[serde(rename = "weddingDate", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19188    pub wedding_date: Option<Option<chrono::NaiveDate>>,
19189    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19190    pub zip: Option<String>,
19191    /// Fields not described by the spec, e.g. instance-specific DB fields.
19192    #[serde(flatten)]
19193    pub extra: serde_json::Map<String, serde_json::Value>,
19194}
19195
19196/// Entry in a recursive placeholder menu. Items with `items` are menu groups; items with `placeholder` and `label` are selectable placeholders.
19197#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19198pub struct PlaceholderItem {
19199    /// 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.
19200    #[serde(default, skip_serializing_if = "Option::is_none")]
19201    pub items: Option<Vec<PlaceholderItemItemsItem>>,
19202    /// Translated label shown for a selectable placeholder
19203    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19204    pub label: Option<String>,
19205    /// Optional shorter label shown in nested placeholder menus
19206    #[serde(rename = "menuLabel", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19207    pub menu_label: Option<String>,
19208    /// Translated name of a placeholder menu group
19209    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19210    pub name: Option<String>,
19211    /// Placeholder expression to insert into a template
19212    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19213    pub placeholder: Option<String>,
19214    /// Fields not described by the spec, e.g. instance-specific DB fields.
19215    #[serde(flatten)]
19216    pub extra: serde_json::Map<String, serde_json::Value>,
19217}
19218
19219#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19220pub struct PlaceholderItemItemsItem {
19221    /// Further nested placeholder menu entries.
19222    #[serde(default, skip_serializing_if = "Option::is_none")]
19223    pub items: Option<Vec<std::collections::BTreeMap<String, serde_json::Value>>>,
19224    /// Translated label shown for a selectable placeholder
19225    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19226    pub label: Option<String>,
19227    /// Optional shorter label shown in nested placeholder menus
19228    #[serde(rename = "menuLabel", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19229    pub menu_label: Option<String>,
19230    /// Translated name of a placeholder menu group
19231    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19232    pub name: Option<String>,
19233    /// Placeholder expression to insert into a template
19234    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19235    pub placeholder: Option<String>,
19236    /// Fields not described by the spec, e.g. instance-specific DB fields.
19237    #[serde(flatten)]
19238    pub extra: serde_json::Map<String, serde_json::Value>,
19239}
19240
19241#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19242pub struct PlaceholderMenuGroup {
19243    /// Selectable placeholders and further menu groups.
19244    pub items: Vec<PlaceholderItem>,
19245    /// Translated menu-section label.
19246    #[serde(deserialize_with = "crate::lenient::string")]
19247    pub name: String,
19248    /// Fields not described by the spec, e.g. instance-specific DB fields.
19249    #[serde(flatten)]
19250    pub extra: serde_json::Map<String, serde_json::Value>,
19251}
19252
19253#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19254pub struct PollForNewsResult {
19255    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
19256    pub domain_id: i64,
19257    /// Allowed values: `agenda`, `agenda_item`, `appointment`, `booking`, `calendar`, `event`, `event_service`, `follow_up`, `group`, `group_meeting`, `person`, `resource`, `routine`.
19258    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
19259    pub domain_type: String,
19260    /// The person id of the person that changed the object
19261    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
19262    pub person_id: i64,
19263    /// Fields not described by the spec, e.g. instance-specific DB fields.
19264    #[serde(flatten)]
19265    pub extra: serde_json::Map<String, serde_json::Value>,
19266}
19267
19268/// 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.
19269#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19270pub struct PossibleEventPerson {
19271    /// Absences overlapping the event interval. Candidates with an absence are retained and receive a score penalty.
19272    pub absences: Vec<Absence>,
19273    /// Connected groups through whose active, visible-role memberships this person was found. A group can occur more than once.
19274    #[serde(rename = "connectedGroups")]
19275    pub connected_groups: Vec<DomainObjectGroup>,
19276    /// Latest valid assignment in the same service group starting strictly before this event, within the loaded history window. Null if none was found.
19277    #[serde(rename = "lastService", default, skip_serializing_if = "Option::is_none")]
19278    pub last_service: Option<ServiceCandidateAssignment>,
19279    /// 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.
19280    #[serde(rename = "monthlyUtilization", deserialize_with = "crate::lenient::map")]
19281    pub monthly_utilization: std::collections::BTreeMap<String, i64>,
19282    /// Next valid assignment in the same service group starting strictly after this event, within the loaded history window. Null if none was found.
19283    #[serde(rename = "nextService", default, skip_serializing_if = "Option::is_none")]
19284    pub next_service: Option<ServiceCandidateAssignment>,
19285    /// Whether a person linked as a partner (relationship type 2) has an assignment in this event. The lookup includes historical and unconfirmed records.
19286    #[serde(rename = "partnerServices")]
19287    pub partner_services: bool,
19288    /// Person as Domain Object
19289    pub person: DomainObjectPerson,
19290    /// Advisory suitability score. Zero when there are no hints. This is not a probability or a guarantee that assignment will succeed.
19291    #[serde(deserialize_with = "crate::lenient::number")]
19292    pub score: i64,
19293    /// Reasons contributing to the score. An empty array is allowed.
19294    #[serde(rename = "scoreHints")]
19295    pub score_hints: Vec<ServiceCandidateScoreHint>,
19296    #[serde(rename = "serviceGroupPreferences", default, skip_serializing_if = "Option::is_none")]
19297    pub service_group_preferences: Option<ServiceGroupPersonPreference>,
19298    /// Whether servicesOnSameDay is nonempty.
19299    #[serde(rename = "serviceOnSameDay")]
19300    pub service_on_same_day: bool,
19301    /// 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.
19302    #[serde(rename = "servicesOnSameDay")]
19303    pub services_on_same_day: Vec<ServiceCandidateAssignment>,
19304    /// 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.
19305    #[serde(rename = "servicesPreviouslyDeclined")]
19306    pub services_previously_declined: Vec<ServiceCandidateAssignment>,
19307    /// Fields not described by the spec, e.g. instance-specific DB fields.
19308    #[serde(flatten)]
19309    pub extra: serde_json::Map<String, serde_json::Value>,
19310}
19311
19312#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19313pub struct PossiblePostGroup {
19314    #[serde(rename = "favoriteGroup")]
19315    pub favorite_group: bool,
19316    #[serde(rename = "featuredGroup")]
19317    pub featured_group: bool,
19318    pub group: DomainObjectGroup,
19319    #[serde(rename = "roleName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19320    pub role_name: Option<String>,
19321    /// Allowed values: `postPossible`, `signupAndPostPossible`.
19322    #[serde(deserialize_with = "crate::lenient::string")]
19323    pub r#type: String,
19324    /// Fields not described by the spec, e.g. instance-specific DB fields.
19325    #[serde(flatten)]
19326    pub extra: serde_json::Map<String, serde_json::Value>,
19327}
19328
19329#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19330pub struct Post {
19331    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19332    pub content: Option<String>,
19333    #[serde(rename = "expirationDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
19334    pub expiration_date: Option<chrono::DateTime<chrono::Utc>>,
19335    #[serde(rename = "publicationDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
19336    pub publication_date: Option<chrono::DateTime<chrono::Utc>>,
19337    #[serde(deserialize_with = "crate::lenient::string")]
19338    pub title: String,
19339    /// Allowed values: `group_intern`, `group_visible`.
19340    #[serde(deserialize_with = "crate::lenient::string")]
19341    pub visibility: String,
19342    /// Person as Domain Object
19343    pub actor: DomainObjectPerson,
19344    #[serde(default, skip_serializing_if = "Option::is_none")]
19345    pub comments: Option<Vec<PostComment>>,
19346    #[serde(rename = "commentsActive")]
19347    pub comments_active: bool,
19348    /// 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.
19349    #[serde(rename = "expirationPerson", default, skip_serializing_if = "Option::is_none")]
19350    pub expiration_person: Option<DomainObjectPerson>,
19351    /// ID of the person who last set or changed the expiration date.
19352    #[serde(rename = "expirationPid", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19353    pub expiration_pid: Option<i64>,
19354    pub group: DomainObjectGroup,
19355    /// The visibility of a group.
19356    /// Allowed values: `hidden`, `intern`, `public`, `restricted`.
19357    #[serde(rename = "groupVisibility", deserialize_with = "crate::lenient::string")]
19358    pub group_visibility: String,
19359    #[serde(deserialize_with = "crate::lenient::string")]
19360    pub guid: String,
19361    #[serde(deserialize_with = "crate::lenient::number")]
19362    pub id: i64,
19363    pub images: Vec<String>,
19364    #[serde(rename = "imagesMeta")]
19365    pub images_meta: Vec<PostImageMeta>,
19366    #[serde(default, skip_serializing_if = "Option::is_none")]
19367    pub instance: Option<PostInstance>,
19368    #[serde(rename = "isBanned")]
19369    pub is_banned: bool,
19370    /// Last edit timestamp only when later than publicationDate; otherwise null.
19371    #[serde(rename = "lastEditedDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
19372    pub last_edited_date: Option<chrono::DateTime<chrono::Utc>>,
19373    #[serde(default, skip_serializing_if = "Option::is_none")]
19374    pub linkings: Option<Vec<LinkingOpenGraph>>,
19375    pub meta: MetaDataEntityId,
19376    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
19377    #[serde(rename = "publishedDate", serialize_with = "crate::datetime::serialize_utc")]
19378    pub published_date: chrono::DateTime<chrono::Utc>,
19379    #[serde(default, skip_serializing_if = "Option::is_none")]
19380    pub reactions: Option<Vec<PostReaction>>,
19381    /// Fields not described by the spec, e.g. instance-specific DB fields.
19382    #[serde(flatten)]
19383    pub extra: serde_json::Map<String, serde_json::Value>,
19384}
19385
19386#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19387pub struct PostActionsBody {
19388    /// One or more domain types to filter actions by.
19389    /// Allowed values: `group_membership`, `person`.
19390    pub domain_type: Vec<String>,
19391    /// Optional filter criteria to further narrow the returned actions. The structure depends on the domain type.
19392    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
19393    pub filter: Option<std::collections::BTreeMap<String, serde_json::Value>>,
19394    /// Fields not described by the spec, e.g. instance-specific DB fields.
19395    #[serde(flatten)]
19396    pub extra: serde_json::Map<String, serde_json::Value>,
19397}
19398
19399#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19400pub struct PostCaptchaBody {
19401    #[serde(deserialize_with = "crate::lenient::string")]
19402    pub solution: String,
19403    /// Fields not described by the spec, e.g. instance-specific DB fields.
19404    #[serde(flatten)]
19405    pub extra: serde_json::Map<String, serde_json::Value>,
19406}
19407
19408#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19409pub struct PostCaptchaResponse {
19410    #[serde(rename = "isValid")]
19411    pub is_valid: bool,
19412    /// Fields not described by the spec, e.g. instance-specific DB fields.
19413    #[serde(flatten)]
19414    pub extra: serde_json::Map<String, serde_json::Value>,
19415}
19416
19417#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19418pub struct PostComment {
19419    #[serde(deserialize_with = "crate::lenient::string")]
19420    pub content: String,
19421    #[serde(deserialize_with = "crate::lenient::number")]
19422    pub id: i64,
19423    pub meta: MetaDataEntityId,
19424    #[serde(rename = "parentCommentId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19425    pub parent_comment_id: Option<i64>,
19426    /// Person as Domain Object
19427    pub person: DomainObjectPerson,
19428    #[serde(rename = "postId", deserialize_with = "crate::lenient::number")]
19429    pub post_id: i64,
19430    pub reactions: Vec<PostCommentReaction>,
19431    /// Fields not described by the spec, e.g. instance-specific DB fields.
19432    #[serde(flatten)]
19433    pub extra: serde_json::Map<String, serde_json::Value>,
19434}
19435
19436#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19437pub struct PostCommentCreate {
19438    #[serde(deserialize_with = "crate::lenient::string")]
19439    pub content: String,
19440    /// `None` leaves the field out, `Some(None)` sends `null`.
19441    #[serde(rename = "parentCommentId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19442    pub parent_comment_id: Option<Option<i64>>,
19443    #[serde(rename = "postId", deserialize_with = "crate::lenient::number")]
19444    pub post_id: i64,
19445    /// Fields not described by the spec, e.g. instance-specific DB fields.
19446    #[serde(flatten)]
19447    pub extra: serde_json::Map<String, serde_json::Value>,
19448}
19449
19450#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19451pub struct PostCommentReaction {
19452    #[serde(rename = "commentId", deserialize_with = "crate::lenient::number")]
19453    pub comment_id: i64,
19454    #[serde(deserialize_with = "crate::lenient::string")]
19455    pub emoji: String,
19456    pub meta: MetaDataEntityId,
19457    #[serde(default, skip_serializing_if = "Option::is_none")]
19458    pub person: Option<DomainObjectPerson>,
19459    /// Fields not described by the spec, e.g. instance-specific DB fields.
19460    #[serde(flatten)]
19461    pub extra: serde_json::Map<String, serde_json::Value>,
19462}
19463
19464#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19465pub struct PostCommentReactionCreate {
19466    #[serde(deserialize_with = "crate::lenient::string")]
19467    pub emoji: String,
19468    /// Fields not described by the spec, e.g. instance-specific DB fields.
19469    #[serde(flatten)]
19470    pub extra: serde_json::Map<String, serde_json::Value>,
19471}
19472
19473#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19474pub struct PostCreate {
19475    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19476    pub content: Option<String>,
19477    /// `None` leaves the field out, `Some(None)` sends `null`.
19478    #[serde(rename = "expirationDate", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
19479    pub expiration_date: Option<Option<chrono::DateTime<chrono::Utc>>>,
19480    /// `None` leaves the field out, `Some(None)` sends `null`.
19481    #[serde(rename = "publicationDate", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
19482    pub publication_date: Option<Option<chrono::DateTime<chrono::Utc>>>,
19483    #[serde(deserialize_with = "crate::lenient::string")]
19484    pub title: String,
19485    /// Allowed values: `group_intern`, `group_visible`.
19486    #[serde(deserialize_with = "crate::lenient::string")]
19487    pub visibility: String,
19488    #[serde(rename = "commentsActive", default, skip_serializing_if = "Option::is_none")]
19489    pub comments_active: Option<bool>,
19490    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
19491    pub group_id: i64,
19492    #[serde(rename = "imageIds", default, skip_serializing_if = "Option::is_none")]
19493    pub image_ids: Option<Vec<i64>>,
19494    /// Fields not described by the spec, e.g. instance-specific DB fields.
19495    #[serde(flatten)]
19496    pub extra: serde_json::Map<String, serde_json::Value>,
19497}
19498
19499#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19500pub struct PostExternalloginsSamlMetadataParseData {
19501    pub descriptors: Vec<SamlIdpMetadataDescriptor>,
19502    /// Fields not described by the spec, e.g. instance-specific DB fields.
19503    #[serde(flatten)]
19504    pub extra: serde_json::Map<String, serde_json::Value>,
19505}
19506
19507#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19508pub struct PostFeatureusageBody {
19509    #[serde(default, skip_serializing_if = "Option::is_none")]
19510    pub data: Option<Vec<FeatureUsage>>,
19511    /// Fields not described by the spec, e.g. instance-specific DB fields.
19512    #[serde(flatten)]
19513    pub extra: serde_json::Map<String, serde_json::Value>,
19514}
19515
19516#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19517pub struct PostFinanceEubpSubmissionsIdGenerateData {
19518    /// URL to download the generated ZIP file
19519    #[serde(rename = "downloadUrl", deserialize_with = "crate::lenient::string")]
19520    pub download_url: String,
19521    /// Fields not described by the spec, e.g. instance-specific DB fields.
19522    #[serde(flatten)]
19523    pub extra: serde_json::Map<String, serde_json::Value>,
19524}
19525
19526#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19527pub struct PostGroupsBody {
19528    /// Campus Id if group is connected to a campus
19529    #[serde(rename = "campusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19530    pub campus_id: Option<i64>,
19531    /// Need to be true, if another group with that name already exists
19532    #[serde(default, skip_serializing_if = "Option::is_none")]
19533    pub force: Option<bool>,
19534    /// ID of group category
19535    #[serde(rename = "groupCategoryId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19536    pub group_category_id: Option<i64>,
19537    /// 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.
19538    #[serde(rename = "groupStatusId", deserialize_with = "crate::lenient::number")]
19539    pub group_status_id: i64,
19540    /// Id of group type
19541    #[serde(rename = "groupTypeId", deserialize_with = "crate::lenient::number")]
19542    pub group_type_id: i64,
19543    /// Group name
19544    #[serde(deserialize_with = "crate::lenient::string")]
19545    pub name: String,
19546    /// Group ID of parent group
19547    #[serde(rename = "parentGroupId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19548    pub parent_group_id: Option<i64>,
19549    /// put yourself in this role
19550    #[serde(rename = "roleId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19551    pub role_id: Option<i64>,
19552    /// The visibility of a group.
19553    /// Allowed values: `hidden`, `intern`, `public`, `restricted`.
19554    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19555    pub visibility: Option<String>,
19556    /// Fields not described by the spec, e.g. instance-specific DB fields.
19557    #[serde(flatten)]
19558    pub extra: serde_json::Map<String, serde_json::Value>,
19559}
19560
19561#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19562pub struct PostGroupsGroupIdMeetingsMeetingIdMembersMissingBody {
19563    /// Attendance state to assign to currently unsure records.
19564    /// Allowed values: `absent`, `present`.
19565    #[serde(deserialize_with = "crate::lenient::string")]
19566    pub status: String,
19567    /// Fields not described by the spec, e.g. instance-specific DB fields.
19568    #[serde(flatten)]
19569    pub extra: serde_json::Map<String, serde_json::Value>,
19570}
19571
19572#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19573pub struct PostGroupsIdMeetingsBody {
19574    /// Start of the meeting in UTC.
19575    #[serde(rename = "startDate", serialize_with = "crate::datetime::serialize_utc")]
19576    pub start_date: chrono::DateTime<chrono::Utc>,
19577    /// Fields not described by the spec, e.g. instance-specific DB fields.
19578    #[serde(flatten)]
19579    pub extra: serde_json::Map<String, serde_json::Value>,
19580}
19581
19582#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19583pub struct PostImageMeta {
19584    #[serde(rename = "aspectRatio", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19585    pub aspect_ratio: Option<f64>,
19586    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::string")]
19587    pub image_url: String,
19588    /// Fields not described by the spec, e.g. instance-specific DB fields.
19589    #[serde(flatten)]
19590    pub extra: serde_json::Map<String, serde_json::Value>,
19591}
19592
19593#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19594pub struct PostInstallationSyncOidcBody {
19595    /// Compact RS256 JWS containing the configuration.
19596    #[serde(rename = "configurationToken", deserialize_with = "crate::lenient::string")]
19597    pub configuration_token: String,
19598    /// Fields not described by the spec, e.g. instance-specific DB fields.
19599    #[serde(flatten)]
19600    pub extra: serde_json::Map<String, serde_json::Value>,
19601}
19602
19603#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19604pub struct PostInstallationSyncOidcData {
19605    #[serde(rename = "externalLoginId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19606    pub external_login_id: Option<i64>,
19607    #[serde(rename = "installationId", deserialize_with = "crate::lenient::string")]
19608    pub installation_id: String,
19609    #[serde(deserialize_with = "crate::lenient::number")]
19610    pub revision: i64,
19611    /// Fields not described by the spec, e.g. instance-specific DB fields.
19612    #[serde(flatten)]
19613    pub extra: serde_json::Map<String, serde_json::Value>,
19614}
19615
19616#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19617pub struct PostInstance {
19618    #[serde(deserialize_with = "crate::lenient::string")]
19619    pub guid: String,
19620    #[serde(rename = "siteName", deserialize_with = "crate::lenient::string")]
19621    pub site_name: String,
19622    #[serde(rename = "siteUrl", deserialize_with = "crate::lenient::string")]
19623    pub site_url: String,
19624    /// Fields not described by the spec, e.g. instance-specific DB fields.
19625    #[serde(flatten)]
19626    pub extra: serde_json::Map<String, serde_json::Value>,
19627}
19628
19629#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19630pub struct PostLabelsData {
19631    /// Absolute URL of the generated file, scheduled to expire after one day.
19632    #[serde(deserialize_with = "crate::lenient::string")]
19633    pub pdf: String,
19634    /// Fields not described by the spec, e.g. instance-specific DB fields.
19635    #[serde(flatten)]
19636    pub extra: serde_json::Map<String, serde_json::Value>,
19637}
19638
19639/// Two-factor completion result. The legacy disabled-two-factor branch returns only status and does not complete login.
19640#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19641pub struct PostLoginTwofactorSetupActivateData {
19642    #[serde(rename = "redirectTo", deserialize_with = "crate::lenient::string")]
19643    pub redirect_to: String,
19644    #[serde(deserialize_with = "crate::lenient::string")]
19645    pub status: String,
19646    /// Fields not described by the spec, e.g. instance-specific DB fields.
19647    #[serde(flatten)]
19648    pub extra: serde_json::Map<String, serde_json::Value>,
19649}
19650
19651#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19652pub struct PostMarkdownCheckBody {
19653    /// Validates the provided Markdown content against the specified scope's rules and restrictions.
19654    /// This ensures the content adheres to the allowed formatting and elements for the given context.
19655    /// Allowed values: `description`, `document`, `plaintext`, `richline`.
19656    #[serde(rename = "inputScope", deserialize_with = "crate::lenient::string")]
19657    pub input_scope: String,
19658    /// The Markdown text to be processed
19659    #[serde(deserialize_with = "crate::lenient::string")]
19660    pub markdown: String,
19661    /// Fields not described by the spec, e.g. instance-specific DB fields.
19662    #[serde(flatten)]
19663    pub extra: serde_json::Map<String, serde_json::Value>,
19664}
19665
19666#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19667pub struct PostMarkdownCheckData {
19668    /// 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.
19669    #[serde(rename = "isValid")]
19670    pub is_valid: bool,
19671    /// Array of validation error messages
19672    pub reason: Vec<PostMarkdownCheckDataReasonItem>,
19673    /// Fields not described by the spec, e.g. instance-specific DB fields.
19674    #[serde(flatten)]
19675    pub extra: serde_json::Map<String, serde_json::Value>,
19676}
19677
19678#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19679pub struct PostMarkdownCheckDataReasonItem {
19680    /// The details of the validation error
19681    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19682    pub message: Option<String>,
19683    /// The invalid line from the Markdown source
19684    #[serde(rename = "sourceLineContent", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19685    pub source_line_content: Option<String>,
19686    /// The invalid line number in the Markdown source
19687    #[serde(rename = "sourceLineNumber", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19688    pub source_line_number: Option<i64>,
19689    /// Fields not described by the spec, e.g. instance-specific DB fields.
19690    #[serde(flatten)]
19691    pub extra: serde_json::Map<String, serde_json::Value>,
19692}
19693
19694#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19695pub struct PostNpsBody {
19696    #[serde(deserialize_with = "crate::lenient::number")]
19697    pub score: i64,
19698    /// Fields not described by the spec, e.g. instance-specific DB fields.
19699    #[serde(flatten)]
19700    pub extra: serde_json::Map<String, serde_json::Value>,
19701}
19702
19703#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19704pub struct PostNpsResponse {
19705    #[serde(deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
19706    pub date: Option<chrono::DateTime<chrono::Utc>>,
19707    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19708    pub score: Option<i64>,
19709    /// Fields not described by the spec, e.g. instance-specific DB fields.
19710    #[serde(flatten)]
19711    pub extra: serde_json::Map<String, serde_json::Value>,
19712}
19713
19714#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19715pub struct PostPermissionsBulkBody {
19716    pub changes: Vec<PermissionBulkChange>,
19717    /// Fields not described by the spec, e.g. instance-specific DB fields.
19718    #[serde(flatten)]
19719    pub extra: serde_json::Map<String, serde_json::Value>,
19720}
19721
19722/// Required IDs must be resolved from this installation's masterdata; optional fields may be omitted.
19723#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19724pub struct PostPersonsBody {
19725    #[serde(rename = "addressAddition", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19726    pub address_addition: Option<String>,
19727    #[serde(rename = "baptisedBy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19728    pub baptised_by: Option<String>,
19729    #[serde(rename = "birthName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19730    pub birth_name: Option<String>,
19731    /// `None` leaves the field out, `Some(None)` sends `null`.
19732    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19733    pub birthday: Option<Option<chrono::NaiveDate>>,
19734    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19735    pub birthplace: Option<String>,
19736    /// ID of a campus returned by `GET /person/masterdata`.
19737    #[serde(rename = "campusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19738    pub campus_id: Option<i64>,
19739    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19740    pub city: Option<String>,
19741    #[serde(rename = "cmsUserId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19742    pub cms_user_id: Option<String>,
19743    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19744    pub country: Option<String>,
19745    /// `None` leaves the field out, `Some(None)` sends `null`.
19746    #[serde(rename = "dateOfBaptism", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19747    pub date_of_baptism: Option<Option<chrono::NaiveDate>>,
19748    /// `None` leaves the field out, `Some(None)` sends `null`.
19749    #[serde(rename = "dateOfBelonging", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19750    pub date_of_belonging: Option<Option<chrono::NaiveDate>>,
19751    /// `None` leaves the field out, `Some(None)` sends `null`.
19752    #[serde(rename = "dateOfDeath", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19753    pub date_of_death: Option<Option<chrono::NaiveDate>>,
19754    /// `None` leaves the field out, `Some(None)` sends `null`.
19755    #[serde(rename = "dateOfEntry", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
19756    pub date_of_entry: Option<Option<chrono::DateTime<chrono::Utc>>>,
19757    /// `None` leaves the field out, `Some(None)` sends `null`.
19758    #[serde(rename = "dateOfResign", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
19759    pub date_of_resign: Option<Option<chrono::DateTime<chrono::Utc>>>,
19760    /// Department IDs returned by `GET /person/masterdata`. At least one department must be set.
19761    #[serde(rename = "departmentIds")]
19762    pub department_ids: Vec<i64>,
19763    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19764    pub email: Option<String>,
19765    /// Save many eMail addresses for person. If `emails` is present in request `email` is ignored.
19766    #[serde(default, skip_serializing_if = "Option::is_none")]
19767    pub emails: Option<Vec<PersonEmail>>,
19768    /// `None` leaves the field out, `Some(None)` sends `null`.
19769    #[serde(rename = "familyStatusId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19770    pub family_status_id: Option<Option<i64>>,
19771    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19772    pub fax: Option<String>,
19773    /// `None` leaves the field out, `Some(None)` sends `null`.
19774    #[serde(rename = "firstContact", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
19775    pub first_contact: Option<Option<chrono::DateTime<chrono::Utc>>>,
19776    #[serde(rename = "firstName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19777    pub first_name: Option<String>,
19778    #[serde(rename = "growPathId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19779    pub grow_path_id: Option<i64>,
19780    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19781    pub job: Option<String>,
19782    #[serde(rename = "lastName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19783    pub last_name: Option<String>,
19784    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19785    pub mobile: Option<String>,
19786    /// `None` leaves the field out, `Some(None)` sends `null`.
19787    #[serde(rename = "nationalityId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19788    pub nationality_id: Option<Option<i64>>,
19789    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19790    pub nickname: Option<String>,
19791    #[serde(rename = "optigemId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19792    pub optigem_id: Option<String>,
19793    #[serde(rename = "phonePrivate", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19794    pub phone_private: Option<String>,
19795    #[serde(rename = "phoneWork", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19796    pub phone_work: Option<String>,
19797    #[serde(rename = "placeOfBaptism", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19798    pub place_of_baptism: Option<String>,
19799    /// 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.
19800    #[serde(rename = "privacyPolicyAgreement", default, skip_serializing_if = "Option::is_none")]
19801    #[deprecated = "Use the three flat `privacyPolicyAgreement*` fields instead."]
19802    pub privacy_policy_agreement: Option<CheckinPersonDataCreatePrivacyPolicyAgreement>,
19803    /// Date of the privacy policy agreement. Required together with agreement type and person when `privacy_policy_fields_mandatory` is enabled.
19804    #[serde(rename = "privacyPolicyAgreementDate", default, skip_serializing_if = "Option::is_none")]
19805    pub privacy_policy_agreement_date: Option<chrono::NaiveDate>,
19806    /// 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.
19807    #[serde(rename = "privacyPolicyAgreementTypeId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19808    pub privacy_policy_agreement_type_id: Option<i64>,
19809    /// 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.
19810    #[serde(rename = "privacyPolicyAgreementWhoId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19811    pub privacy_policy_agreement_who_id: Option<i64>,
19812    #[serde(rename = "referredBy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19813    pub referred_by: Option<String>,
19814    #[serde(rename = "referredTo", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19815    pub referred_to: Option<String>,
19816    /// `None` leaves the field out, `Some(None)` sends `null`.
19817    #[serde(rename = "sexId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19818    pub sex_id: Option<Option<i64>>,
19819    /// ID of a person status returned by `GET /person/masterdata`.
19820    #[serde(rename = "statusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19821    pub status_id: Option<i64>,
19822    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19823    pub street: Option<String>,
19824    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19825    pub title: Option<String>,
19826    /// Visibility accepted when creating or updating a person.
19827    /// Allowed values: `hidden`, `visible`.
19828    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19829    pub visibility: Option<String>,
19830    /// `None` leaves the field out, `Some(None)` sends `null`.
19831    #[serde(rename = "weddingDate", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19832    pub wedding_date: Option<Option<chrono::NaiveDate>>,
19833    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19834    pub zip: Option<String>,
19835    /// Fields not described by the spec, e.g. instance-specific DB fields.
19836    #[serde(flatten)]
19837    pub extra: serde_json::Map<String, serde_json::Value>,
19838}
19839
19840#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19841pub struct PostPersonsPersonIdArchiveBody {
19842    /// if true the person is archived, if false the archive operation is undone
19843    #[serde(default, skip_serializing_if = "Option::is_none")]
19844    pub archived: Option<bool>,
19845    /// Fields not described by the spec, e.g. instance-specific DB fields.
19846    #[serde(flatten)]
19847    pub extra: serde_json::Map<String, serde_json::Value>,
19848}
19849
19850#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19851pub struct PostPersonsPersonIdRelationshipsBody {
19852    #[serde(rename = "otherPersonId", deserialize_with = "crate::lenient::number")]
19853    pub other_person_id: i64,
19854    #[serde(rename = "relationshipTypeId", deserialize_with = "crate::lenient::number")]
19855    pub relationship_type_id: i64,
19856    /// Fields not described by the spec, e.g. instance-specific DB fields.
19857    #[serde(flatten)]
19858    pub extra: serde_json::Map<String, serde_json::Value>,
19859}
19860
19861#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19862pub struct PostPersonsPropertiesBody {
19863    /// Person IDs for which properties should be returned
19864    #[serde(default, skip_serializing_if = "Option::is_none")]
19865    pub ids: Option<Vec<i64>>,
19866    /// Fields not described by the spec, e.g. instance-specific DB fields.
19867    #[serde(flatten)]
19868    pub extra: serde_json::Map<String, serde_json::Value>,
19869}
19870
19871#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19872pub struct PostProbesBody {
19873    /// One or more domain types to filter probes by.
19874    /// Allowed values: `person`.
19875    pub domain_type: Vec<String>,
19876    /// Optional domain-specific filter criteria.
19877    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
19878    pub filter: Option<std::collections::BTreeMap<String, serde_json::Value>>,
19879    /// Fields not described by the spec, e.g. instance-specific DB fields.
19880    #[serde(flatten)]
19881    pub extra: serde_json::Map<String, serde_json::Value>,
19882}
19883
19884#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19885pub struct PostPublicgroupsGroupIdMailToLeadersData {
19886    #[serde(deserialize_with = "crate::lenient::string")]
19887    pub success: String,
19888    /// Fields not described by the spec, e.g. instance-specific DB fields.
19889    #[serde(flatten)]
19890    pub extra: serde_json::Map<String, serde_json::Value>,
19891}
19892
19893#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19894pub struct PostPublicgroupsGroupIdSignupResponse {
19895    /// The hash of the group homepage. This allows the client to return to the group homepage.
19896    #[serde(rename = "groupHomepageHash", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19897    pub group_homepage_hash: Option<String>,
19898    /// Neutral notice that the anonymous requester should check their email. It does not disclose whether a person matched.
19899    #[serde(rename = "verificationNotice")]
19900    pub verification_notice: bool,
19901    /// Fields not described by the spec, e.g. instance-specific DB fields.
19902    #[serde(flatten)]
19903    pub extra: serde_json::Map<String, serde_json::Value>,
19904}
19905
19906#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19907pub struct PostPublicgroupsGroupIdTokenDataVariant2 {
19908    #[serde(deserialize_with = "crate::lenient::string")]
19909    pub success: String,
19910    /// Fields not described by the spec, e.g. instance-specific DB fields.
19911    #[serde(flatten)]
19912    pub extra: serde_json::Map<String, serde_json::Value>,
19913}
19914
19915#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19916pub struct PostPublicgroupsSignupConfirmConfirmationTokenData {
19917    #[serde(rename = "groupHomepageHash", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19918    pub group_homepage_hash: Option<String>,
19919    #[serde(rename = "groupId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19920    pub group_id: Option<i64>,
19921    #[serde(rename = "groupName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19922    pub group_name: Option<String>,
19923    /// Allowed values: `active`, `requested`, `waiting`.
19924    #[serde(rename = "membershipStatus", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19925    pub membership_status: Option<String>,
19926    /// Allowed values: `closed`, `expired`, `success`.
19927    #[serde(deserialize_with = "crate::lenient::string")]
19928    pub state: String,
19929    /// Fields not described by the spec, e.g. instance-specific DB fields.
19930    #[serde(flatten)]
19931    pub extra: serde_json::Map<String, serde_json::Value>,
19932}
19933
19934#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19935pub struct PostQueuesQueueData {
19936    /// Messages from Worker
19937    #[serde(default, skip_serializing_if = "Option::is_none")]
19938    pub messages: Option<Vec<String>>,
19939    /// Name of Queue
19940    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19941    pub queue: Option<String>,
19942    /// Fields not described by the spec, e.g. instance-specific DB fields.
19943    #[serde(flatten)]
19944    pub extra: serde_json::Map<String, serde_json::Value>,
19945}
19946
19947#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19948pub struct PostReaction {
19949    #[serde(deserialize_with = "crate::lenient::string")]
19950    pub emoji: String,
19951    #[serde(default, skip_serializing_if = "Option::is_none")]
19952    pub meta: Option<MetaDataEntityId>,
19953    /// Person as Domain Object
19954    pub person: DomainObjectPerson,
19955    #[serde(rename = "postId", deserialize_with = "crate::lenient::number")]
19956    pub post_id: i64,
19957    /// Fields not described by the spec, e.g. instance-specific DB fields.
19958    #[serde(flatten)]
19959    pub extra: serde_json::Map<String, serde_json::Value>,
19960}
19961
19962#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19963pub struct PostResetPasswordData {
19964    /// Translated confirmation messages intended for display; wording depends on the user language.
19965    pub infos: Vec<String>,
19966    /// Fields not described by the spec, e.g. instance-specific DB fields.
19967    #[serde(flatten)]
19968    pub extra: serde_json::Map<String, serde_json::Value>,
19969}
19970
19971#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19972pub struct PostSecuritylevelsIdBody {
19973    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19974    pub name: Option<String>,
19975    /// Fields not described by the spec, e.g. instance-specific DB fields.
19976    #[serde(flatten)]
19977    pub extra: serde_json::Map<String, serde_json::Value>,
19978}
19979
19980#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19981pub struct PostSecuritylevelsIdResponse {
19982    #[serde(deserialize_with = "crate::lenient::number")]
19983    pub id: i64,
19984    #[serde(deserialize_with = "crate::lenient::string")]
19985    pub name: String,
19986    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
19987    pub sort_key: i64,
19988    /// Fields not described by the spec, e.g. instance-specific DB fields.
19989    #[serde(flatten)]
19990    pub extra: serde_json::Map<String, serde_json::Value>,
19991}
19992
19993#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19994pub struct PostSimulateBody {
19995    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
19996    pub person_id: i64,
19997    /// Fields not described by the spec, e.g. instance-specific DB fields.
19998    #[serde(flatten)]
19999    pub extra: serde_json::Map<String, serde_json::Value>,
20000}
20001
20002#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20003pub struct PostSummarySubscriptionOptions {
20004    /// Which posts to include in the email summary.
20005    /// Allowed values: `all`, `featured_groups`, `my_campus`, `my_groups`.
20006    #[serde(deserialize_with = "crate::lenient::string")]
20007    pub filter: String,
20008    /// Delivery weekdays, Sunday=0 through Saturday=6.
20009    pub weekdays: Vec<i64>,
20010    /// Fields not described by the spec, e.g. instance-specific DB fields.
20011    #[serde(flatten)]
20012    pub extra: serde_json::Map<String, serde_json::Value>,
20013}
20014
20015#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20016pub struct PostTwofactorTotpData {
20017    #[serde(deserialize_with = "crate::lenient::string")]
20018    pub status: String,
20019    /// Fields not described by the spec, e.g. instance-specific DB fields.
20020    #[serde(flatten)]
20021    pub extra: serde_json::Map<String, serde_json::Value>,
20022}
20023
20024#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20025pub struct PostUpdate {
20026    #[serde(rename = "commentsActive", default, skip_serializing_if = "Option::is_none")]
20027    pub comments_active: Option<bool>,
20028    /// `None` leaves the field out, `Some(None)` sends `null`.
20029    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20030    pub content: Option<Option<String>>,
20031    /// `None` leaves the field out, `Some(None)` sends `null`.
20032    #[serde(rename = "expirationDate", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
20033    pub expiration_date: Option<Option<chrono::DateTime<chrono::Utc>>>,
20034    #[serde(rename = "imageIds", default, skip_serializing_if = "Option::is_none")]
20035    pub image_ids: Option<Vec<i64>>,
20036    /// `None` leaves the field out, `Some(None)` sends `null`.
20037    #[serde(rename = "publicationDate", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
20038    pub publication_date: Option<Option<chrono::DateTime<chrono::Utc>>>,
20039    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20040    pub title: Option<String>,
20041    /// Allowed values: `group_intern`, `group_visible`.
20042    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20043    pub visibility: Option<String>,
20044    /// Fields not described by the spec, e.g. instance-specific DB fields.
20045    #[serde(flatten)]
20046    pub extra: serde_json::Map<String, serde_json::Value>,
20047}
20048
20049/// A printer designated to print check-in codes
20050#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20051pub struct Printer {
20052    /// Whether this printer is active and available for check-in printing.
20053    pub active: bool,
20054    #[serde(deserialize_with = "crate::lenient::number")]
20055    pub id: i64,
20056    /// Human-readable location of the printer.
20057    #[serde(deserialize_with = "crate::lenient::string")]
20058    pub location: String,
20059    pub meta: MetaDataEntityId,
20060    /// Human-readable printer name.
20061    #[serde(deserialize_with = "crate::lenient::string")]
20062    pub title: String,
20063    /// Fields not described by the spec, e.g. instance-specific DB fields.
20064    #[serde(flatten)]
20065    pub extra: serde_json::Map<String, serde_json::Value>,
20066}
20067
20068/// An operation that can evaluate domain objects as a predicate.
20069#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20070pub struct Probe {
20071    #[serde(rename = "actionMetaData")]
20072    pub action_meta_data: ActionMetaData,
20073    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
20074    pub domain_type: String,
20075    /// Domain types for which this probe can evaluate entities.
20076    #[serde(rename = "domainTypes")]
20077    pub domain_types: Vec<String>,
20078    #[serde(default, skip_serializing_if = "Option::is_none")]
20079    pub group: Option<ActionGroup>,
20080    /// Allowed values: `probe-group-meeting-attendance`, `probe-group-membership`, `probe-person-avatar`, `probe-person-email`, `probe-person-field`.
20081    #[serde(deserialize_with = "crate::lenient::string")]
20082    pub key: String,
20083    /// Fields not described by the spec, e.g. instance-specific DB fields.
20084    #[serde(flatten)]
20085    pub extra: serde_json::Map<String, serde_json::Value>,
20086}
20087
20088#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20089pub struct ProbeInvocation {
20090    /// Probe-specific configuration.
20091    #[serde(deserialize_with = "crate::lenient::map")]
20092    pub data: std::collections::BTreeMap<String, serde_json::Value>,
20093    /// Allowed values: `probe-group-meeting-attendance`, `probe-group-membership`, `probe-person-avatar`, `probe-person-email`, `probe-person-field`.
20094    #[serde(deserialize_with = "crate::lenient::string")]
20095    pub probe: String,
20096    /// Fields not described by the spec, e.g. instance-specific DB fields.
20097    #[serde(flatten)]
20098    pub extra: serde_json::Map<String, serde_json::Value>,
20099}
20100
20101/// A logical probe expression. The complete expression may be at most 10 levels deep and contain at most 100 expression nodes.
20102#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20103pub struct ProbeLogicalExpression {
20104    /// 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.
20105    pub children: Vec<std::collections::BTreeMap<String, serde_json::Value>>,
20106    /// Allowed values: `and`, `not`, `or`, `xor`.
20107    #[serde(deserialize_with = "crate::lenient::string")]
20108    pub operator: String,
20109    /// Fields not described by the spec, e.g. instance-specific DB fields.
20110    #[serde(flatten)]
20111    pub extra: serde_json::Map<String, serde_json::Value>,
20112}
20113
20114/// 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.
20115#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20116pub struct ProbeTraversalExpression {
20117    pub data: ProbeTraversalExpressionData,
20118    #[serde(deserialize_with = "crate::lenient::string")]
20119    pub quantifier: String,
20120    #[serde(deserialize_with = "crate::lenient::string")]
20121    pub traversal: String,
20122    /// 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.
20123    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
20124    pub r#where: Option<std::collections::BTreeMap<String, serde_json::Value>>,
20125    /// Fields not described by the spec, e.g. instance-specific DB fields.
20126    #[serde(flatten)]
20127    pub extra: serde_json::Map<String, serde_json::Value>,
20128}
20129
20130#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20131pub struct ProbeTraversalExpressionData {
20132    /// Allowed values: `person-a-to-person-b`, `person-b-to-person-a`.
20133    #[serde(deserialize_with = "crate::lenient::string")]
20134    pub direction: String,
20135    #[serde(rename = "relationshipTypeId", deserialize_with = "crate::lenient::number")]
20136    pub relationship_type_id: i64,
20137    /// Fields not described by the spec, e.g. instance-specific DB fields.
20138    #[serde(flatten)]
20139    pub extra: serde_json::Map<String, serde_json::Value>,
20140}
20141
20142/// Profiles are representing campuses and the church itself.
20143#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20144pub struct Profile {
20145    #[serde(rename = "@deprecated", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
20146    pub deprecated: Option<std::collections::BTreeMap<String, String>>,
20147    #[serde(default, skip_serializing_if = "Option::is_none")]
20148    pub address: Option<Address>,
20149    /// Will be the same for all profiles.
20150    #[serde(default, skip_serializing_if = "Option::is_none")]
20151    pub association: Option<Association>,
20152    #[serde(default, skip_serializing_if = "Option::is_none")]
20153    pub banner: Option<DomainObjectFile>,
20154    #[serde(default, skip_serializing_if = "Option::is_none")]
20155    pub denomination: Option<Denomination>,
20156    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20157    pub description: Option<String>,
20158    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20159    pub email: Option<String>,
20160    #[serde(rename = "finderUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20161    pub finder_url: Option<String>,
20162    pub gallery: Vec<DomainObjectFile>,
20163    pub groups: Vec<ProfileGroupsItem>,
20164    #[serde(deserialize_with = "crate::lenient::string")]
20165    pub guid: String,
20166    #[serde(deserialize_with = "crate::lenient::number")]
20167    pub id: i64,
20168    #[serde(rename = "isPublished")]
20169    pub is_published: bool,
20170    /// Indicates whether registration is currently available for this profile. Only present when registration is active.
20171    #[serde(rename = "isRegistrationOpen", default, skip_serializing_if = "Option::is_none")]
20172    pub is_registration_open: Option<bool>,
20173    #[serde(default, skip_serializing_if = "Option::is_none")]
20174    pub logo: Option<DomainObjectFile>,
20175    pub meta: MetaDataEntityId,
20176    #[serde(deserialize_with = "crate::lenient::string")]
20177    pub name: String,
20178    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
20179    pub name_translated: String,
20180    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20181    pub phone: Option<String>,
20182    /// church: Church profile for this installation; campus: one specific campus profile
20183    /// Allowed values: `campus`, `church`.
20184    #[serde(rename = "profileType", deserialize_with = "crate::lenient::string")]
20185    pub profile_type: String,
20186    /// Use `serviceBanner_new` instead.
20187    #[serde(rename = "serviceBanner", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20188    #[deprecated = "Use `serviceBanner_new` instead."]
20189    pub service_banner: Option<String>,
20190    #[serde(rename = "serviceBanner_new", default, skip_serializing_if = "Option::is_none")]
20191    pub service_banner_new: Option<DomainObjectFile>,
20192    #[serde(default, skip_serializing_if = "Option::is_none")]
20193    pub services: Option<Vec<ProfileServicesItem>>,
20194    #[serde(rename = "shortName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20195    pub short_name: Option<String>,
20196    #[serde(deserialize_with = "crate::lenient::string")]
20197    pub shorty: String,
20198    #[serde(rename = "signUpGroup", default, skip_serializing_if = "Option::is_none")]
20199    pub sign_up_group: Option<ProfileSignUpGroupVariant1>,
20200    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20201    pub slug: Option<String>,
20202    #[serde(rename = "socialMedia", deserialize_with = "crate::lenient::map")]
20203    pub social_media: std::collections::BTreeMap<String, String>,
20204    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
20205    pub sort_key: i64,
20206    pub tags: Vec<ProfileTagsItem>,
20207    pub team: Vec<ProfileTeamItem>,
20208    #[serde(rename = "teamTitle", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20209    pub team_title: Option<String>,
20210    #[serde(deserialize_with = "crate::lenient::number")]
20211    pub visitors: i64,
20212    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20213    pub website: Option<String>,
20214    /// Fields not described by the spec, e.g. instance-specific DB fields.
20215    #[serde(flatten)]
20216    pub extra: serde_json::Map<String, serde_json::Value>,
20217}
20218
20219#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20220pub struct ProfileAddressUpdate {
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 addition: 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 city: Option<Option<String>>,
20227    /// `None` leaves the field out, `Some(None)` sends `null`.
20228    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20229    pub country: Option<Option<String>>,
20230    /// `None` leaves the field out, `Some(None)` sends `null`.
20231    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20232    pub district: Option<Option<String>>,
20233    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
20234    pub latitude: serde_json::Value,
20235    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
20236    pub longitude: serde_json::Value,
20237    /// Alias for `name` in the API request.
20238    ///
20239    /// `None` leaves the field out, `Some(None)` sends `null`.
20240    #[serde(rename = "meetingAt", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20241    pub meeting_at: 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 name: Option<Option<String>>,
20245    /// `None` leaves the field out, `Some(None)` sends `null`.
20246    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20247    pub street: Option<Option<String>>,
20248    /// `None` leaves the field out, `Some(None)` sends `null`.
20249    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20250    pub zip: Option<Option<String>>,
20251    /// Fields not described by the spec, e.g. instance-specific DB fields.
20252    #[serde(flatten)]
20253    pub extra: serde_json::Map<String, serde_json::Value>,
20254}
20255
20256#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20257pub struct ProfileGroupsItem {
20258    pub group: DomainObjectGroup,
20259    #[serde(rename = "groupHomepageApi", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20260    pub group_homepage_api: Option<String>,
20261    #[serde(rename = "groupHomepageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20262    pub group_homepage_url: Option<String>,
20263    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
20264    pub sort_key: i64,
20265    /// Fields not described by the spec, e.g. instance-specific DB fields.
20266    #[serde(flatten)]
20267    pub extra: serde_json::Map<String, serde_json::Value>,
20268}
20269
20270#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20271pub struct ProfileServicesItem {
20272    #[serde(deserialize_with = "crate::lenient::number")]
20273    pub day: i64,
20274    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20275    pub note: Option<String>,
20276    /// Allowed values: `biweekly`, `every_fourth_week`, `every_third_week`, `monthly`, `weekly`.
20277    #[serde(deserialize_with = "crate::lenient::string")]
20278    pub repetition: String,
20279    #[serde(deserialize_with = "crate::lenient::string")]
20280    pub time: String,
20281    /// Fields not described by the spec, e.g. instance-specific DB fields.
20282    #[serde(flatten)]
20283    pub extra: serde_json::Map<String, serde_json::Value>,
20284}
20285
20286#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20287pub struct ProfileSignUpGroupVariant1 {
20288    pub group: DomainObjectGroup,
20289    #[serde(rename = "groupHomepageApi", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20290    pub group_homepage_api: Option<String>,
20291    #[serde(rename = "groupHomepageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20292    pub group_homepage_url: Option<String>,
20293    /// Fields not described by the spec, e.g. instance-specific DB fields.
20294    #[serde(flatten)]
20295    pub extra: serde_json::Map<String, serde_json::Value>,
20296}
20297
20298#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20299pub struct ProfileTagsItem {
20300    #[serde(deserialize_with = "crate::lenient::string")]
20301    pub key: String,
20302    #[serde(deserialize_with = "crate::lenient::string")]
20303    pub name: String,
20304    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
20305    pub name_translated: String,
20306    /// Fields not described by the spec, e.g. instance-specific DB fields.
20307    #[serde(flatten)]
20308    pub extra: serde_json::Map<String, serde_json::Value>,
20309}
20310
20311#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20312pub struct ProfileTeamItem {
20313    #[serde(deserialize_with = "crate::lenient::string")]
20314    pub note: String,
20315    /// Person as Domain Object
20316    pub person: DomainObjectPerson,
20317    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
20318    pub sort_key: i64,
20319    /// Fields not described by the spec, e.g. instance-specific DB fields.
20320    #[serde(flatten)]
20321    pub extra: serde_json::Map<String, serde_json::Value>,
20322}
20323
20324#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20325pub struct ProfileUpdate {
20326    /// `None` leaves the field out, `Some(None)` sends `null`.
20327    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20328    pub address: Option<Option<ProfileAddressUpdate>>,
20329    /// `None` leaves the field out, `Some(None)` sends `null`.
20330    #[serde(rename = "associationId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20331    pub association_id: Option<Option<i64>>,
20332    /// Either exact denomination key or denomination object with name property.
20333    /// Allowed values: `denomination.catholic`, `denomination.ecumenical`, `denomination.free.evangelical`, `denomination.none`, `denomination.orthodox`, `denomination.protestant`.
20334    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
20335    pub denomination: serde_json::Value,
20336    /// `None` leaves the field out, `Some(None)` sends `null`.
20337    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20338    pub description: Option<Option<String>>,
20339    /// `None` leaves the field out, `Some(None)` sends `null`.
20340    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20341    pub email: Option<Option<String>>,
20342    /// List of group IDs shown on the profile.
20343    #[serde(default, skip_serializing_if = "Option::is_none")]
20344    pub groups: Option<Vec<i64>>,
20345    #[serde(rename = "isPublished", default, skip_serializing_if = "Option::is_none")]
20346    pub is_published: Option<bool>,
20347    #[serde(deserialize_with = "crate::lenient::string")]
20348    pub name: String,
20349    /// `None` leaves the field out, `Some(None)` sends `null`.
20350    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20351    pub phone: Option<Option<String>>,
20352    #[serde(default, skip_serializing_if = "Option::is_none")]
20353    pub services: Option<Vec<ProfileUpdateServicesItem>>,
20354    /// `None` leaves the field out, `Some(None)` sends `null`.
20355    #[serde(rename = "shortName", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20356    pub short_name: Option<Option<String>>,
20357    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20358    pub shorty: Option<String>,
20359    /// Group ID used for profile sign-up or null to disable sign-up.
20360    ///
20361    /// `None` leaves the field out, `Some(None)` sends `null`.
20362    #[serde(rename = "signUpGroupId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20363    pub sign_up_group_id: Option<Option<i64>>,
20364    /// `None` leaves the field out, `Some(None)` sends `null`.
20365    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20366    pub slug: Option<Option<String>>,
20367    /// Key-Value Pair, where key is the name of the network and value is the absolute link
20368    #[serde(rename = "socialMedia", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
20369    pub social_media: Option<std::collections::BTreeMap<String, String>>,
20370    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
20371    pub sort_key: Option<i64>,
20372    /// List of tags.
20373    #[serde(default, skip_serializing_if = "Option::is_none")]
20374    pub tags: Option<Vec<String>>,
20375    #[serde(default, skip_serializing_if = "Option::is_none")]
20376    pub team: Option<Vec<ProfileUpdateTeamItem>>,
20377    /// `None` leaves the field out, `Some(None)` sends `null`.
20378    #[serde(rename = "teamTitle", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20379    pub team_title: Option<Option<String>>,
20380    /// Single integer, which represents a range.
20381    /// Allowed values: `0`, `1`, `100`, `1000`, `250`, `50`, `500`.
20382    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
20383    pub visitors: Option<i64>,
20384    /// `None` leaves the field out, `Some(None)` sends `null`.
20385    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20386    pub website: Option<Option<String>>,
20387    /// Campus profile ID. For `/profiles/church`, this is ignored.
20388    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
20389    pub id: Option<i64>,
20390    /// Fields not described by the spec, e.g. instance-specific DB fields.
20391    #[serde(flatten)]
20392    pub extra: serde_json::Map<String, serde_json::Value>,
20393}
20394
20395#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20396pub struct ProfileUpdateDenominationVariant2 {
20397    /// Allowed values: `denomination.catholic`, `denomination.ecumenical`, `denomination.free.evangelical`, `denomination.none`, `denomination.orthodox`, `denomination.protestant`.
20398    #[serde(deserialize_with = "crate::lenient::string")]
20399    pub name: String,
20400    /// Fields not described by the spec, e.g. instance-specific DB fields.
20401    #[serde(flatten)]
20402    pub extra: serde_json::Map<String, serde_json::Value>,
20403}
20404
20405#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20406pub struct ProfileUpdateServicesItem {
20407    #[serde(deserialize_with = "crate::lenient::number")]
20408    pub day: i64,
20409    /// `None` leaves the field out, `Some(None)` sends `null`.
20410    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20411    pub note: Option<Option<String>>,
20412    /// Allowed values: `biweekly`, `every_fourth_week`, `every_third_week`, `monthly`, `weekly`.
20413    #[serde(deserialize_with = "crate::lenient::string")]
20414    pub repetition: String,
20415    #[serde(deserialize_with = "crate::lenient::string")]
20416    pub time: String,
20417    /// Fields not described by the spec, e.g. instance-specific DB fields.
20418    #[serde(flatten)]
20419    pub extra: serde_json::Map<String, serde_json::Value>,
20420}
20421
20422#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20423pub struct ProfileUpdateTeamItem {
20424    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20425    pub note: Option<String>,
20426    /// DomainObject
20427    #[serde(default, skip_serializing_if = "Option::is_none")]
20428    pub person: Option<ProfileUpdateTeamItemPerson>,
20429    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
20430    pub person_id: i64,
20431    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
20432    pub sort_key: Option<i64>,
20433    /// Fields not described by the spec, e.g. instance-specific DB fields.
20434    #[serde(flatten)]
20435    pub extra: serde_json::Map<String, serde_json::Value>,
20436}
20437
20438/// DomainObject
20439#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20440pub struct ProfileUpdateTeamItemPerson {
20441    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::number")]
20442    pub domain_identifier: i64,
20443    /// Fields not described by the spec, e.g. instance-specific DB fields.
20444    #[serde(flatten)]
20445    pub extra: serde_json::Map<String, serde_json::Value>,
20446}
20447
20448/// Information about a public group, e.g. to be displayed on a group homepage.
20449#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20450pub struct PublicGroup {
20451    /// Compatibility aliases emitted by the transformer.
20452    #[serde(rename = "@deprecated")]
20453    pub deprecated: PublicGroupDeprecated,
20454    /// If true, group sign is allowed even if group is full.
20455    #[serde(rename = "allowWaitinglist")]
20456    pub allow_waitinglist: bool,
20457    /// If true, group sign up requests will be accepted automatically.
20458    #[serde(rename = "autoAccept")]
20459    pub auto_accept: bool,
20460    /// Indicates if the current user (either logged in or not) can sign up. This summarizes the information in signUpConditions.
20461    #[serde(rename = "canSignUp")]
20462    pub can_sign_up: bool,
20463    /// 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.
20464    #[serde(default, skip_serializing_if = "Option::is_none")]
20465    pub children: Option<Vec<i64>>,
20466    /// Occupied seats, accounting for membership status and role seat-counting rules; not necessarily the number of membership rows.
20467    #[serde(rename = "currentMemberCount", deserialize_with = "crate::lenient::number")]
20468    pub current_member_count: i64,
20469    /// The public group ID.
20470    #[serde(deserialize_with = "crate::lenient::number")]
20471    pub id: i64,
20472    /// General information about the group.
20473    pub information: PublicGroupInformation,
20474    /// Maximum number of members until the group is considered as full.
20475    #[serde(rename = "maxMemberCount", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
20476    pub max_member_count: Option<i64>,
20477    /// Name of the group, e.g. to be displayed as title.
20478    #[serde(deserialize_with = "crate::lenient::string")]
20479    pub name: String,
20480    /// Use `requestedSeatsCount` instead.
20481    #[serde(rename = "requestedPlacesCount", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
20482    #[deprecated = "Use `requestedSeatsCount` instead."]
20483    pub requested_places_count: Option<i64>,
20484    /// Number of requested seats
20485    #[serde(rename = "requestedSeatsCount", deserialize_with = "crate::lenient::number")]
20486    pub requested_seats_count: i64,
20487    /// Use `requestedWaitinglistSeatsCount` instead.
20488    #[serde(rename = "requestedWaitinglistPlacesCount", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
20489    #[deprecated = "Use `requestedWaitinglistSeatsCount` instead."]
20490    pub requested_waitinglist_places_count: Option<i64>,
20491    /// Number of requested seats with waiting list position
20492    #[serde(rename = "requestedWaitinglistSeatsCount", deserialize_with = "crate::lenient::number")]
20493    pub requested_waitinglist_seats_count: i64,
20494    pub settings: PublicGroupSettings,
20495    #[serde(rename = "showPublicCannotViewGroup")]
20496    pub show_public_cannot_view_group: bool,
20497    /// 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.
20498    #[serde(rename = "signUpConditions")]
20499    pub sign_up_conditions: GroupSignUpConditions,
20500    /// Whether a normal signup occupies a seat, based on its assigned role and membership status.
20501    #[serde(rename = "signUpCountsTowardsSeats")]
20502    pub sign_up_counts_towards_seats: bool,
20503    /// Text which can be displayed as a headline for the sign up section
20504    #[serde(rename = "signUpHeadline", deserialize_with = "crate::lenient::string")]
20505    pub sign_up_headline: String,
20506    /// 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.
20507    #[serde(rename = "signUpPersons", default, skip_serializing_if = "Option::is_none")]
20508    pub sign_up_persons: Option<Vec<PublicGroupSignUpPersonsItem>>,
20509    /// Maximum number of persons on the waiting list.
20510    #[serde(rename = "waitinglistMaxPersons", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
20511    pub waitinglist_max_persons: Option<i64>,
20512    /// Fields not described by the spec, e.g. instance-specific DB fields.
20513    #[serde(flatten)]
20514    pub extra: serde_json::Map<String, serde_json::Value>,
20515}
20516
20517/// Public group meeting place. If showStreet=false, street/addition and precise latitude/longitude aliases are omitted; loose coordinates and the remaining location metadata remain.
20518#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20519pub struct PublicGroupAddress {
20520    #[serde(rename = "@deprecated")]
20521    pub deprecated: StoredAddressDeprecated,
20522    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20523    pub addition: Option<String>,
20524    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20525    pub city: Option<String>,
20526    /// 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`.
20527    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
20528    pub color: serde_json::Value,
20529    /// A country's ISO-code
20530    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20531    pub country: Option<String>,
20532    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20533    pub district: Option<String>,
20534    /// The identifier of the domain object. This field is set automatically from the path parameter and should not be included in the request body.
20535    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::string")]
20536    pub domain_identifier: String,
20537    /// The domain type of the address. This field is set automatically from the path parameter and should not be included in the request body.
20538    /// Allowed values: `appointment`, `campus`, `church`, `group`.
20539    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
20540    pub domain_type: String,
20541    /// Use `latitude` instead
20542    #[serde(rename = "geoLat", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20543    #[deprecated = "Use `latitude` instead"]
20544    pub geo_lat: Option<String>,
20545    /// Use `longitude` instead
20546    #[serde(rename = "geoLng", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20547    #[deprecated = "Use `longitude` instead"]
20548    pub geo_lng: Option<String>,
20549    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20550    pub icon: Option<String>,
20551    #[serde(deserialize_with = "crate::lenient::number")]
20552    pub id: i64,
20553    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20554    pub latitude: Option<String>,
20555    /// Use `latitude` instead
20556    #[serde(rename = "latitudeLoose", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20557    #[deprecated = "Use `latitude` instead"]
20558    pub latitude_loose: Option<String>,
20559    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20560    pub longitude: Option<String>,
20561    /// Use `longitude` instead
20562    #[serde(rename = "longitudeLoose", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20563    #[deprecated = "Use `longitude` instead"]
20564    pub longitude_loose: Option<String>,
20565    /// 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`.
20566    #[serde(rename = "markerColor", default, skip_serializing_if = "serde_json::Value::is_null")]
20567    #[deprecated = "deprecated in the ChurchTools API"]
20568    pub marker_color: serde_json::Value,
20569    /// Use `icon` instead
20570    #[serde(rename = "markerIcon", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20571    #[deprecated = "Use `icon` instead"]
20572    pub marker_icon: Option<String>,
20573    #[serde(rename = "markerUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20574    #[deprecated = "deprecated in the ChurchTools API"]
20575    pub marker_url: Option<String>,
20576    /// Use `name` instead
20577    #[serde(rename = "meetingAt", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20578    #[deprecated = "Use `name` instead"]
20579    pub meeting_at: Option<String>,
20580    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20581    pub name: Option<String>,
20582    /// Use `zip` instead
20583    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20584    #[deprecated = "Use `zip` instead"]
20585    pub postalcode: Option<String>,
20586    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20587    pub street: Option<String>,
20588    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20589    pub zip: Option<String>,
20590    /// Fields not described by the spec, e.g. instance-specific DB fields.
20591    #[serde(flatten)]
20592    pub extra: serde_json::Map<String, serde_json::Value>,
20593}
20594
20595/// Compatibility aliases emitted by the transformer.
20596#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20597pub struct PublicGroupDeprecated {
20598    #[serde(rename = "requestedPlacesCount", deserialize_with = "crate::lenient::string")]
20599    pub requested_places_count: String,
20600    #[serde(rename = "requestedWaitinglistPlacesCount", deserialize_with = "crate::lenient::string")]
20601    pub requested_waitinglist_places_count: String,
20602    /// Fields not described by the spec, e.g. instance-specific DB fields.
20603    #[serde(flatten)]
20604    pub extra: serde_json::Map<String, serde_json::Value>,
20605}
20606
20607/// Single public-group response, including eligible signup persons.
20608#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20609pub struct PublicGroupDetail {
20610    /// Compatibility aliases emitted by the transformer.
20611    #[serde(rename = "@deprecated")]
20612    pub deprecated: PublicGroupDeprecated,
20613    /// If true, group sign is allowed even if group is full.
20614    #[serde(rename = "allowWaitinglist")]
20615    pub allow_waitinglist: bool,
20616    /// If true, group sign up requests will be accepted automatically.
20617    #[serde(rename = "autoAccept")]
20618    pub auto_accept: bool,
20619    /// Indicates if the current user (either logged in or not) can sign up. This summarizes the information in signUpConditions.
20620    #[serde(rename = "canSignUp")]
20621    pub can_sign_up: bool,
20622    /// 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.
20623    #[serde(default, skip_serializing_if = "Option::is_none")]
20624    pub children: Option<Vec<i64>>,
20625    /// Occupied seats, accounting for membership status and role seat-counting rules; not necessarily the number of membership rows.
20626    #[serde(rename = "currentMemberCount", deserialize_with = "crate::lenient::number")]
20627    pub current_member_count: i64,
20628    /// The public group ID.
20629    #[serde(deserialize_with = "crate::lenient::number")]
20630    pub id: i64,
20631    /// General information about the group.
20632    pub information: PublicGroupInformation,
20633    /// Maximum number of members until the group is considered as full.
20634    #[serde(rename = "maxMemberCount", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
20635    pub max_member_count: Option<i64>,
20636    /// Name of the group, e.g. to be displayed as title.
20637    #[serde(deserialize_with = "crate::lenient::string")]
20638    pub name: String,
20639    /// Use `requestedSeatsCount` instead.
20640    #[serde(rename = "requestedPlacesCount", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
20641    #[deprecated = "Use `requestedSeatsCount` instead."]
20642    pub requested_places_count: Option<i64>,
20643    /// Number of requested seats
20644    #[serde(rename = "requestedSeatsCount", deserialize_with = "crate::lenient::number")]
20645    pub requested_seats_count: i64,
20646    /// Use `requestedWaitinglistSeatsCount` instead.
20647    #[serde(rename = "requestedWaitinglistPlacesCount", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
20648    #[deprecated = "Use `requestedWaitinglistSeatsCount` instead."]
20649    pub requested_waitinglist_places_count: Option<i64>,
20650    /// Number of requested seats with waiting list position
20651    #[serde(rename = "requestedWaitinglistSeatsCount", deserialize_with = "crate::lenient::number")]
20652    pub requested_waitinglist_seats_count: i64,
20653    pub settings: PublicGroupSettings,
20654    #[serde(rename = "showPublicCannotViewGroup")]
20655    pub show_public_cannot_view_group: bool,
20656    /// 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.
20657    #[serde(rename = "signUpConditions")]
20658    pub sign_up_conditions: GroupSignUpConditions,
20659    /// Whether a normal signup occupies a seat, based on its assigned role and membership status.
20660    #[serde(rename = "signUpCountsTowardsSeats")]
20661    pub sign_up_counts_towards_seats: bool,
20662    /// Text which can be displayed as a headline for the sign up section
20663    #[serde(rename = "signUpHeadline", deserialize_with = "crate::lenient::string")]
20664    pub sign_up_headline: String,
20665    /// 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.
20666    #[serde(rename = "signUpPersons")]
20667    pub sign_up_persons: Vec<PublicGroupSignUpPersonsItem>,
20668    /// Maximum number of persons on the waiting list.
20669    #[serde(rename = "waitinglistMaxPersons", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
20670    pub waitinglist_max_persons: Option<i64>,
20671    /// Fields not described by the spec, e.g. instance-specific DB fields.
20672    #[serde(flatten)]
20673    pub extra: serde_json::Map<String, serde_json::Value>,
20674}
20675
20676#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20677pub struct PublicGroupFormField {
20678    /// Configured default, including checkbox booleans; not necessarily a string.
20679    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
20680    pub default: serde_json::Value,
20681    /// Allowed values: `api`, `checkbox`, `date`, `datetime`, `multiselect`, `number`, `radioselect`, `select`, `text`, `textarea`.
20682    #[serde(rename = "fieldTypeCode", default, skip_serializing_if = "serde_json::Value::is_null")]
20683    pub field_type_code: serde_json::Value,
20684    /// 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.
20685    #[serde(deserialize_with = "crate::lenient::number")]
20686    pub id: i64,
20687    /// A human readable label for the form field.
20688    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20689    pub label: Option<String>,
20690    /// Maximum length when available.
20691    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
20692    pub length: Option<i64>,
20693    /// If this is true, the field is required.
20694    pub mandatory: bool,
20695    /// The field's internal name. Not intended to be displayed.
20696    #[serde(deserialize_with = "crate::lenient::string")]
20697    pub name: String,
20698    /// A note for the user filling out the form, e.g. to explain why certain information is required.
20699    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20700    pub note: Option<String>,
20701    /// Provides the set of allowed options for select fields.
20702    #[serde(default, skip_serializing_if = "Option::is_none")]
20703    pub options: Option<Vec<PublicGroupFormFieldOptionsItem>>,
20704    /// Person field is locked, for example an email captured by the token.
20705    #[serde(default, skip_serializing_if = "Option::is_none")]
20706    pub readonly: Option<bool>,
20707    /// Form fields should be sorted by this key ascending.
20708    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
20709    pub sort_key: i64,
20710    /// Field domain; combine with id to identify a submitted field.
20711    /// Allowed values: `comment`, `custom`, `person`, `privacy`, `privacyForChild`, `privacyForOther`, `privacyForSelf`, `relation`.
20712    #[serde(deserialize_with = "crate::lenient::string")]
20713    pub r#type: String,
20714    /// Fields not described by the spec, e.g. instance-specific DB fields.
20715    #[serde(flatten)]
20716    pub extra: serde_json::Map<String, serde_json::Value>,
20717}
20718
20719#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20720pub struct PublicGroupFormFieldOptionsItem {
20721    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
20722    pub id: serde_json::Value,
20723    #[serde(deserialize_with = "crate::lenient::string")]
20724    pub name: String,
20725    /// Fields not described by the spec, e.g. instance-specific DB fields.
20726    #[serde(flatten)]
20727    pub extra: serde_json::Map<String, serde_json::Value>,
20728}
20729
20730#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20731pub struct PublicGroupFormResult {
20732    #[serde(rename = "acceptPrivacyForChildForm")]
20733    pub accept_privacy_for_child_form: Vec<PublicGroupFormField>,
20734    #[serde(rename = "acceptPrivacyForOtherForm")]
20735    pub accept_privacy_for_other_form: Vec<PublicGroupFormField>,
20736    #[serde(rename = "acceptPrivacyForSelfForm")]
20737    pub accept_privacy_for_self_form: Vec<PublicGroupFormField>,
20738    #[serde(rename = "addChildForm", default, skip_serializing_if = "Option::is_none")]
20739    pub add_child_form: Option<Vec<PublicGroupFormField>>,
20740    #[serde(rename = "addOtherForm", default, skip_serializing_if = "Option::is_none")]
20741    pub add_other_form: Option<Vec<PublicGroupFormField>>,
20742    #[serde(rename = "addSpouseForm", default, skip_serializing_if = "Option::is_none")]
20743    pub add_spouse_form: Option<Vec<PublicGroupFormField>>,
20744    /// If the user is not yet signed in, this specifies the email address the user has provided.
20745    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20746    pub email: Option<String>,
20747    /// List of form fields.
20748    pub form: Vec<PublicGroupFormField>,
20749    /// Information about a public group, e.g. to be displayed on a group homepage.
20750    pub group: PublicGroup,
20751    /// If the user is signed in, this specifies the user ID of the requester.
20752    #[serde(rename = "requesterId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
20753    pub requester_id: Option<i64>,
20754    /// 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.
20755    #[serde(rename = "signUpPersons")]
20756    pub sign_up_persons: Vec<PublicGroupFormResultSignUpPersonsItem>,
20757    /// The sign up token.
20758    #[serde(deserialize_with = "crate::lenient::string")]
20759    pub token: String,
20760    /// Fields not described by the spec, e.g. instance-specific DB fields.
20761    #[serde(flatten)]
20762    pub extra: serde_json::Map<String, serde_json::Value>,
20763}
20764
20765#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20766pub struct PublicGroupFormResultSignUpPersonsItem {
20767    /// List of form field values
20768    #[serde(rename = "formData")]
20769    pub form_data: Vec<PublicGroupFormResultSignUpPersonsItemFormDataItem>,
20770    #[serde(rename = "hasAcceptedPrivacy")]
20771    pub has_accepted_privacy: bool,
20772    /// Person as Domain Object
20773    pub person: DomainObjectPerson,
20774    /// Relation of this sign-up person to the requester.
20775    /// Allowed values: `child`, `other`, `spouse`.
20776    #[serde(rename = "relationType", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20777    pub relation_type: Option<String>,
20778    /// 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.
20779    /// Allowed values: `CLICKED`, `IN_GROUP`, `NOT_CLICKED`, `REQUESTED`.
20780    #[serde(deserialize_with = "crate::lenient::string")]
20781    pub status: String,
20782    /// Fields not described by the spec, e.g. instance-specific DB fields.
20783    #[serde(flatten)]
20784    pub extra: serde_json::Map<String, serde_json::Value>,
20785}
20786
20787#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20788pub struct PublicGroupFormResultSignUpPersonsItemFormDataItem {
20789    #[serde(deserialize_with = "crate::lenient::string")]
20790    pub name: String,
20791    /// Stored person-field value; may be null or a scalar/list/object depending on the field.
20792    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
20793    pub value: serde_json::Value,
20794    /// Fields not described by the spec, e.g. instance-specific DB fields.
20795    #[serde(flatten)]
20796    pub extra: serde_json::Map<String, serde_json::Value>,
20797}
20798
20799/// General information about the group.
20800#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20801pub struct PublicGroupInformation {
20802    /// List of target age groups for this group.
20803    #[serde(rename = "ageGroups")]
20804    pub age_groups: Vec<AgeGroup>,
20805    #[serde(default, skip_serializing_if = "Option::is_none")]
20806    pub campus: Option<Campus>,
20807    /// Color key used for displaying the group.
20808    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20809    pub color: Option<String>,
20810    #[serde(rename = "dateOfFoundation", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
20811    pub date_of_foundation: Option<chrono::DateTime<chrono::Utc>>,
20812    #[serde(rename = "groupCategory", default, skip_serializing_if = "Option::is_none")]
20813    pub group_category: Option<GroupCategory>,
20814    /// Meeting places are returned regardless of the showMap UI flag. showStreet controls removal of street/addition/precise coordinates.
20815    #[serde(rename = "groupPlaces")]
20816    pub group_places: Vec<PublicGroupAddress>,
20817    #[serde(rename = "groupStatusId", deserialize_with = "crate::lenient::number")]
20818    pub group_status_id: i64,
20819    /// Whether the group image was generated with AI.
20820    #[serde(rename = "imageAiGenerated", default, skip_serializing_if = "Option::is_none")]
20821    pub image_ai_generated: Option<bool>,
20822    /// Annotation text for the group image if provided.
20823    #[serde(rename = "imageAnnotation", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20824    pub image_annotation: Option<String>,
20825    /// Link to the original source of the group image if provided.
20826    #[serde(rename = "imageAnnotationLink", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20827    pub image_annotation_link: Option<String>,
20828    /// Alternative text describing the group image if provided.
20829    #[serde(rename = "imageDescription", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20830    pub image_description: Option<String>,
20831    /// URL to a group image if provided.
20832    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20833    pub image_url: Option<String>,
20834    /// List of person objects of all group leaders if the group is set to display leaders.
20835    #[serde(default, skip_serializing_if = "Option::is_none")]
20836    pub leader: Option<Vec<DomainObjectPerson>>,
20837    /// Free text field when group meetings take place.
20838    #[serde(rename = "meetingTime", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20839    pub meeting_time: Option<String>,
20840    /// The group description.
20841    #[serde(deserialize_with = "crate::lenient::string")]
20842    pub note: String,
20843    #[serde(rename = "targetGroup", default, skip_serializing_if = "Option::is_none")]
20844    pub target_group: Option<TargetGroup>,
20845    /// Meeting weekday master data, or null.
20846    #[serde(default, skip_serializing_if = "Option::is_none")]
20847    pub weekday: Option<Weekday>,
20848    /// Fields not described by the spec, e.g. instance-specific DB fields.
20849    #[serde(flatten)]
20850    pub extra: serde_json::Map<String, serde_json::Value>,
20851}
20852
20853#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20854pub struct PublicGroupLeaderMailCreate {
20855    /// E-Mail Address of the sender.
20856    #[serde(deserialize_with = "crate::lenient::string")]
20857    pub email: String,
20858    /// Message to be sent.
20859    #[serde(deserialize_with = "crate::lenient::string")]
20860    pub message: String,
20861    /// Name of the sender.
20862    #[serde(deserialize_with = "crate::lenient::string")]
20863    pub name: String,
20864    /// Required when normal group signup access is unavailable.
20865    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20866    pub token: Option<String>,
20867    /// Fields not described by the spec, e.g. instance-specific DB fields.
20868    #[serde(flatten)]
20869    pub extra: serde_json::Map<String, serde_json::Value>,
20870}
20871
20872#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20873pub struct PublicGroupPossibleRequesters {
20874    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20875    pub email: Option<String>,
20876    #[serde(rename = "groupName", deserialize_with = "crate::lenient::string")]
20877    pub group_name: String,
20878    #[serde(rename = "possibleRequesters")]
20879    pub possible_requesters: Vec<PublicGroupSignUpPersonsItem>,
20880    /// Fields not described by the spec, e.g. instance-specific DB fields.
20881    #[serde(flatten)]
20882    pub extra: serde_json::Map<String, serde_json::Value>,
20883}
20884
20885#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20886pub struct PublicGroupSettings {
20887    #[serde(rename = "allowChildRegistration")]
20888    pub allow_child_registration: bool,
20889    #[serde(rename = "allowOtherRegistration")]
20890    pub allow_other_registration: bool,
20891    #[serde(rename = "allowSameEmailRegistration", default, skip_serializing_if = "Option::is_none")]
20892    pub allow_same_email_registration: Option<bool>,
20893    /// Use `allowSameEmailRegistration` instead.
20894    #[serde(rename = "allowSameemailRegistration", default, skip_serializing_if = "Option::is_none")]
20895    #[deprecated = "Use `allowSameEmailRegistration` instead."]
20896    pub allow_sameemail_registration: Option<bool>,
20897    #[serde(rename = "allowSpouseRegistration")]
20898    pub allow_spouse_registration: bool,
20899    /// Controls email verification for anonymous group signups.
20900    /// Allowed values: `all`, `existing`, `none`.
20901    #[serde(rename = "emailVerificationMode", deserialize_with = "crate::lenient::string")]
20902    pub email_verification_mode: String,
20903    #[serde(rename = "hideContactLeader")]
20904    pub hide_contact_leader: bool,
20905    #[serde(rename = "hideLogin")]
20906    pub hide_login: bool,
20907    #[serde(rename = "showStreet")]
20908    pub show_street: bool,
20909    /// Last signup-notification timestamp, or null.
20910    #[serde(rename = "signUpNotificationSent", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
20911    pub sign_up_notification_sent: Option<chrono::DateTime<chrono::Utc>>,
20912    /// Fields not described by the spec, e.g. instance-specific DB fields.
20913    #[serde(flatten)]
20914    pub extra: serde_json::Map<String, serde_json::Value>,
20915}
20916
20917/// Select memberships to withdraw. Use an existing requester’s sign-up token, or omit token and use the current user’s permissions.
20918#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20919pub struct PublicGroupSignOutRequest {
20920    /// 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.
20921    #[serde(rename = "personIds")]
20922    pub person_ids: Vec<i64>,
20923    /// 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.
20924    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20925    pub token: Option<String>,
20926    /// Fields not described by the spec, e.g. instance-specific DB fields.
20927    #[serde(flatten)]
20928    pub extra: serde_json::Map<String, serde_json::Value>,
20929}
20930
20931#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20932pub struct PublicGroupSignUpPersonsItem {
20933    /// Person as Domain Object
20934    pub person: DomainObjectPerson,
20935    /// Existing membership/request status, or NOT_CLICKED for an eligible person not yet requested. CLICKED is a client state and is not returned.
20936    /// Allowed values: `IN_GROUP`, `NOT_CLICKED`, `REQUESTED`.
20937    #[serde(deserialize_with = "crate::lenient::string")]
20938    pub status: String,
20939    /// Fields not described by the spec, e.g. instance-specific DB fields.
20940    #[serde(flatten)]
20941    pub extra: serde_json::Map<String, serde_json::Value>,
20942}
20943
20944#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20945pub struct PublicGroupSignoutData {
20946    pub group: DomainObjectGroup,
20947    #[serde(rename = "groupHasAutoAccept")]
20948    pub group_has_auto_accept: bool,
20949    #[serde(rename = "leaderSignOutPersons", default, skip_serializing_if = "Option::is_none")]
20950    pub leader_sign_out_persons: Option<Vec<DomainObjectPerson>>,
20951    /// Only present for the special no-person-created requester.
20952    #[serde(rename = "noUserCreated", default, skip_serializing_if = "Option::is_none")]
20953    pub no_user_created: Option<bool>,
20954    #[serde(default, skip_serializing_if = "Option::is_none")]
20955    pub requester: Option<DomainObjectPerson>,
20956    #[serde(rename = "requesterEmail", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20957    pub requester_email: Option<String>,
20958    #[serde(rename = "selfSignOutPersons", default, skip_serializing_if = "Option::is_none")]
20959    pub self_sign_out_persons: Option<Vec<DomainObjectPerson>>,
20960    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20961    pub token: Option<String>,
20962    /// Fields not described by the spec, e.g. instance-specific DB fields.
20963    #[serde(flatten)]
20964    pub extra: serde_json::Map<String, serde_json::Value>,
20965}
20966
20967#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20968pub struct PublicGroupSignupCreate {
20969    /// One entry per signup person; the controller does not enforce a nonempty list.
20970    pub forms: Vec<PublicGroupSignupCreateFormsItem>,
20971    /// Required when any new spouse, child or other-person form is included.
20972    #[serde(rename = "hasAcceptedPrivacyForOther", default, skip_serializing_if = "Option::is_none")]
20973    pub has_accepted_privacy_for_other: Option<bool>,
20974    /// Url used in the mail sent to the user.
20975    #[serde(rename = "signOutUrlTemplate", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20976    pub sign_out_url_template: Option<String>,
20977    /// The sign up token.
20978    #[serde(deserialize_with = "crate::lenient::string")]
20979    pub token: String,
20980    /// Fields not described by the spec, e.g. instance-specific DB fields.
20981    #[serde(flatten)]
20982    pub extra: serde_json::Map<String, serde_json::Value>,
20983}
20984
20985#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20986pub struct PublicGroupSignupCreateFormsItem {
20987    /// The form data for the current person.
20988    pub form: Vec<PublicGroupSignupCreateFormsItemFormItem>,
20989    /// The person ID the current form applies to. Can be empty if a single new user is about to sign up.
20990    #[serde(rename = "personId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
20991    pub person_id: Option<i64>,
20992    /// Fields not described by the spec, e.g. instance-specific DB fields.
20993    #[serde(flatten)]
20994    pub extra: serde_json::Map<String, serde_json::Value>,
20995}
20996
20997#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20998pub struct PublicGroupSignupCreateFormsItemFormItem {
20999    /// Field ID paired with its type; use the IDs from the form response.
21000    #[serde(deserialize_with = "crate::lenient::number")]
21001    pub id: i64,
21002    /// Allowed values: `comment`, `custom`, `person`, `privacy`, `privacyForChild`, `privacyForOther`, `privacyForSelf`, `relation`.
21003    #[serde(deserialize_with = "crate::lenient::string")]
21004    pub r#type: String,
21005    /// Value according to the dynamic field definition: scalar, null, or an array for multiple choices.
21006    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
21007    pub value: serde_json::Value,
21008    /// Fields not described by the spec, e.g. instance-specific DB fields.
21009    #[serde(flatten)]
21010    pub extra: serde_json::Map<String, serde_json::Value>,
21011}
21012
21013#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21014pub struct PublicGroupToken {
21015    /// Provide eMail
21016    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21017    pub email: Option<String>,
21018    /// 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.
21019    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
21020    pub group: serde_json::Value,
21021    /// Provided PersonId
21022    #[serde(rename = "requesterId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21023    pub requester_id: Option<i64>,
21024    /// Sign Up Token
21025    #[serde(deserialize_with = "crate::lenient::string")]
21026    pub token: String,
21027    /// Link To Sign Up Form
21028    #[serde(deserialize_with = "crate::lenient::string")]
21029    pub url: String,
21030    /// Fields not described by the spec, e.g. instance-specific DB fields.
21031    #[serde(flatten)]
21032    pub extra: serde_json::Map<String, serde_json::Value>,
21033}
21034
21035#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21036pub struct PublicGroupTokenCreate {
21037    /// Array of person ids, which are clicked on group detail page. Those persons, will be also checked on the form site.
21038    /// The `clicked` field will be saved only in combination with `personId`.
21039    #[serde(default, skip_serializing_if = "Option::is_none")]
21040    pub clicked: Option<Vec<i64>>,
21041    /// 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.
21042    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21043    pub email: Option<String>,
21044    /// The hash of the group homepage. If specified, the user can return to the group homepage after the sign up was successful.
21045    #[serde(rename = "groupHomepageHash", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21046    pub group_homepage_hash: Option<String>,
21047    /// Current logged-in person ID; an arbitrary person cannot be selected here.
21048    #[serde(rename = "personId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21049    pub person_id: Option<i64>,
21050    /// Email link template. $groupId and $token are replaced; omission uses the ChurchTools public signup page.
21051    #[serde(rename = "signUpUrlTemplate", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21052    pub sign_up_url_template: Option<String>,
21053    /// Fields not described by the spec, e.g. instance-specific DB fields.
21054    #[serde(flatten)]
21055    pub extra: serde_json::Map<String, serde_json::Value>,
21056}
21057
21058#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21059pub struct PublicRelationGroupHomepage {
21060    /// Absolute public URL of the group homepage.
21061    #[serde(rename = "groupHomepageUrl", deserialize_with = "crate::lenient::string")]
21062    pub group_homepage_url: String,
21063    /// ID of the group that owns the public group homepage.
21064    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
21065    pub group_id: i64,
21066    /// Fields not described by the spec, e.g. instance-specific DB fields.
21067    #[serde(flatten)]
21068    pub extra: serde_json::Map<String, serde_json::Value>,
21069}
21070
21071#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21072pub struct PublicRelationTag {
21073    /// Technical enum case name used by ChurchTools.
21074    /// Allowed values: `ACTIVE`, `BIBLICALLY_DEVOTED`, `CHARISMATIC`, `CHILD_FRIENDLY`, `CLASSICAL`, `CONTEMPLATIVE`, `INTERNATIONAL`, `LIVELY`, `MISSIONARY`, `MODERN`, `OPEN_TO_GUESTS`, `PERSONAL`, `PROGRESSIVE`, `TRADITIONAL`.
21075    #[serde(deserialize_with = "crate::lenient::string")]
21076    pub key: String,
21077    /// Translation key of the public relation profile tag.
21078    /// Allowed values: `active`, `biblically.devoted`, `charismatic`, `child.friendly`, `classical`, `contemplative`, `international`, `lively`, `missionary`, `modern`, `open.to.guests`, `personal`, `progressive`, `traditional`.
21079    #[serde(deserialize_with = "crate::lenient::string")]
21080    pub name: String,
21081    /// Localized public relation profile tag name.
21082    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
21083    pub name_translated: String,
21084    /// Fields not described by the spec, e.g. instance-specific DB fields.
21085    #[serde(flatten)]
21086    pub extra: serde_json::Map<String, serde_json::Value>,
21087}
21088
21089/// Master data used by the public relations and public profile UI.
21090#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21091pub struct PublicRelationsMasterData {
21092    /// Associations that can be assigned to a public profile.
21093    pub associations: Vec<Association>,
21094    /// Denominations that can be assigned to a public profile.
21095    pub denominations: Vec<Denomination>,
21096    /// Public group homepages with their owning group IDs and URLs.
21097    #[serde(rename = "groupHomepages")]
21098    pub group_homepages: Vec<PublicRelationGroupHomepage>,
21099    /// Supported social media channels for public profile links.
21100    /// Allowed values: `Facebook`, `Instagram`, `Pinterest`, `Snapchat`, `Soundcloud`, `Spotify`, `Telegram`, `TikTok`, `Twitter`, `Vimeo`, `WhatsApp`, `YouTube`.
21101    #[serde(rename = "socialMedia")]
21102    pub social_media: Vec<String>,
21103    /// Tags that can describe a public profile.
21104    pub tags: Vec<PublicRelationTag>,
21105    /// Fields not described by the spec, e.g. instance-specific DB fields.
21106    #[serde(flatten)]
21107    pub extra: serde_json::Map<String, serde_json::Value>,
21108}
21109
21110#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21111pub struct PutConfigRequest {
21112    #[serde(default, skip_serializing_if = "Option::is_none")]
21113    pub accept_datasecurity: Option<bool>,
21114    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21115    pub access_control_allow_origins: Option<String>,
21116    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21117    pub admin_mail: Option<String>,
21118    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21119    pub admin_message: Option<String>,
21120    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21121    pub ai_description_available_generation_tests: Option<f64>,
21122    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21123    pub ai_description_generation_count: Option<f64>,
21124    #[serde(default, skip_serializing_if = "Option::is_none")]
21125    pub ai_description_generation_enabled: Option<bool>,
21126    #[serde(default, skip_serializing_if = "Option::is_none")]
21127    pub allowaiassistant: Option<bool>,
21128    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21129    pub authorized_persons: Option<String>,
21130    #[serde(default, skip_serializing_if = "Option::is_none")]
21131    pub ccli_auto_reporting_enabled: Option<bool>,
21132    #[serde(default, skip_serializing_if = "Option::is_none")]
21133    pub churchcal_active: Option<bool>,
21134    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21135    pub churchcal_css: Option<String>,
21136    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21137    pub churchcal_entries_last_days: Option<i64>,
21138    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21139    pub churchcal_firstdayinweek: Option<i64>,
21140    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21141    pub churchcal_maincalname: Option<String>,
21142    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21143    pub churchcal_name: Option<String>,
21144    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21145    pub churchcal_sortcode: Option<i64>,
21146    #[serde(default, skip_serializing_if = "Option::is_none")]
21147    pub churchchat_allow_event_chat: Option<bool>,
21148    #[serde(default, skip_serializing_if = "Option::is_none")]
21149    pub churchchat_allow_group_chat: Option<bool>,
21150    #[serde(default, skip_serializing_if = "Option::is_none")]
21151    pub churchchat_allow_person_chat: Option<bool>,
21152    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21153    pub churchchat_delete_event_chat_after_x_days: Option<i64>,
21154    #[serde(default, skip_serializing_if = "Option::is_none")]
21155    pub churchchat_invite_ct_event_chat: Option<bool>,
21156    #[serde(default, skip_serializing_if = "Option::is_none")]
21157    pub churchchat_invite_ct_group_chat: Option<bool>,
21158    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21159    pub churchchat_start_event_chat_before_x_days: Option<i64>,
21160    /// A stringified array of calendar ids
21161    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21162    pub churchchat_start_event_chat_for_calendars: Option<String>,
21163    #[serde(default, skip_serializing_if = "Option::is_none")]
21164    pub churchcheckin_active: Option<bool>,
21165    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21166    pub churchcheckin_label_child: Option<String>,
21167    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21168    pub churchcheckin_label_parent: Option<String>,
21169    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21170    pub churchcheckin_label_standard: Option<String>,
21171    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21172    pub churchcheckin_name: Option<String>,
21173    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21174    pub churchcheckin_sortcode: Option<i64>,
21175    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21176    pub churchcheckin_tags: Option<String>,
21177    #[serde(default, skip_serializing_if = "Option::is_none")]
21178    pub churchdb_active: Option<bool>,
21179    #[serde(default, skip_serializing_if = "Option::is_none")]
21180    pub churchdb_archivedeletehistory: Option<bool>,
21181    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21182    pub churchdb_birthdaylist_station: Option<String>,
21183    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21184    pub churchdb_birthdaylist_status: Option<String>,
21185    /// Allowed values: `false`, `true`.
21186    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21187    pub churchdb_cleverreach_connected: Option<String>,
21188    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21189    pub churchdb_emailseparator: Option<String>,
21190    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21191    pub churchdb_groupnotchoosable: Option<i64>,
21192    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21193    pub churchdb_home_lat: Option<String>,
21194    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21195    pub churchdb_home_lng: Option<String>,
21196    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21197    pub churchdb_mailchimp_apikey: Option<String>,
21198    #[serde(default, skip_serializing_if = "Option::is_none")]
21199    pub churchdb_mailchimp_connected: Option<bool>,
21200    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21201    pub churchdb_mailjet_apikey: Option<String>,
21202    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21203    pub churchdb_mailjet_apisecret: Option<String>,
21204    #[serde(default, skip_serializing_if = "Option::is_none")]
21205    pub churchdb_mailjet_connected: Option<bool>,
21206    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21207    pub churchdb_memberlist_station: Option<String>,
21208    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21209    pub churchdb_memberlist_status: Option<String>,
21210    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21211    pub churchdb_name: Option<String>,
21212    #[serde(default, skip_serializing_if = "Option::is_none")]
21213    pub churchdb_sendgroupmails: Option<bool>,
21214    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21215    pub churchdb_smscmtelecom_apikey: Option<String>,
21216    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21217    pub churchdb_sortcode: Option<i64>,
21218    #[serde(default, skip_serializing_if = "Option::is_none")]
21219    pub churchfinance_active: Option<bool>,
21220    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21221    pub churchfinance_name: Option<String>,
21222    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21223    pub churchfinance_sortcode: Option<i64>,
21224    #[serde(default, skip_serializing_if = "Option::is_none")]
21225    pub churchgroup_active: Option<bool>,
21226    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21227    pub churchgroup_name: Option<String>,
21228    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21229    pub churchgroup_sortcode: Option<i64>,
21230    #[serde(default, skip_serializing_if = "Option::is_none")]
21231    pub churchreport_active: Option<bool>,
21232    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21233    pub churchreport_name: Option<String>,
21234    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21235    pub churchreport_sortcode: Option<i64>,
21236    #[serde(default, skip_serializing_if = "Option::is_none")]
21237    pub churchresource_active: Option<bool>,
21238    #[serde(default, skip_serializing_if = "Option::is_none")]
21239    pub churchresource_anonymize_for_public_user: Option<bool>,
21240    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21241    pub churchresource_entries_last_days: Option<i64>,
21242    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21243    pub churchresource_name: Option<String>,
21244    #[serde(default, skip_serializing_if = "Option::is_none")]
21245    pub churchresource_send_emails: Option<bool>,
21246    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21247    pub churchresource_sortcode: Option<i64>,
21248    #[serde(default, skip_serializing_if = "Option::is_none")]
21249    pub churchservice_active: Option<bool>,
21250    #[serde(default, skip_serializing_if = "Option::is_none")]
21251    pub churchservice_agendashowenumeration: Option<bool>,
21252    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21253    pub churchservice_ccli_token: Option<String>,
21254    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21255    pub churchservice_ccli_token_secret: Option<String>,
21256    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21257    pub churchservice_entries_last_days: Option<i64>,
21258    #[serde(default, skip_serializing_if = "Option::is_none")]
21259    pub churchservice_invite_persons: Option<bool>,
21260    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21261    pub churchservice_name: Option<String>,
21262    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21263    pub churchservice_openservice_rememberdays: Option<i64>,
21264    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21265    pub churchservice_reminderhours: Option<i64>,
21266    #[serde(default, skip_serializing_if = "Option::is_none")]
21267    pub churchservice_songwithcategoryasdir: Option<bool>,
21268    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21269    pub churchservice_sortcode: Option<i64>,
21270    #[serde(default, skip_serializing_if = "Option::is_none")]
21271    pub churchsync_active: Option<bool>,
21272    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21273    pub churchsync_name: Option<String>,
21274    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21275    pub churchsync_sortcode: Option<i64>,
21276    #[serde(default, skip_serializing_if = "Option::is_none")]
21277    pub churchwiki_active: Option<bool>,
21278    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21279    pub churchwiki_name: Option<String>,
21280    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21281    pub churchwiki_sortcode: Option<i64>,
21282    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21283    pub cronjob_delay: Option<i64>,
21284    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21285    pub data_privacy_text: Option<String>,
21286    #[serde(default, skip_serializing_if = "Option::is_none")]
21287    pub datasecurity_banner_enabled: Option<bool>,
21288    /// Only in extended config
21289    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21290    pub datasecurity_privacy_agreement_text: Option<String>,
21291    /// Only in extended config
21292    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21293    pub datasecurity_privacy_agreement_text_for_children: Option<String>,
21294    #[serde(default, skip_serializing_if = "Option::is_none")]
21295    pub deactivate_default_login: Option<bool>,
21296    /// Allowed values: `churchtools`, `own`.
21297    #[serde(rename = "emailServer", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21298    pub email_server: Option<String>,
21299    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21300    pub evangelische_termine_api_key: Option<String>,
21301    #[serde(default, skip_serializing_if = "Option::is_none")]
21302    pub evangelische_termine_enabled: Option<bool>,
21303    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21304    pub evangelische_termine_name: Option<String>,
21305    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21306    pub evangelische_termine_url: Option<String>,
21307    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21308    pub evangelische_termine_vid: Option<String>,
21309    #[serde(default, skip_serializing_if = "Option::is_none")]
21310    pub feature_sessionless_login: Option<bool>,
21311    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21312    pub hide_licensetab: Option<String>,
21313    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21314    pub impressum_external: Option<String>,
21315    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21316    pub impressum_external_link: Option<String>,
21317    /// This is a string that can only be true or false.
21318    /// Allowed values: `0`, `1`.
21319    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21320    pub impressum_internal: Option<String>,
21321    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21322    pub invite_email_text: Option<String>,
21323    #[serde(default, skip_serializing_if = "Option::is_none")]
21324    pub is_churchtools_blog_widget_active: Option<bool>,
21325    #[serde(default, skip_serializing_if = "Option::is_none")]
21326    pub is_churchtools_onboarding_widget_active: Option<bool>,
21327    #[serde(default, skip_serializing_if = "Option::is_none")]
21328    pub is_pr_widget_active: Option<bool>,
21329    #[serde(default, skip_serializing_if = "Option::is_none")]
21330    pub is_rss_widget_active: Option<bool>,
21331    #[serde(default, skip_serializing_if = "Option::is_none")]
21332    pub ldap_otp_enabled: Option<bool>,
21333    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21334    pub login_message: Option<String>,
21335    #[serde(default, skip_serializing_if = "Option::is_none")]
21336    pub mail_enabled: Option<bool>,
21337    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21338    pub mail_smtp_args_host: Option<String>,
21339    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21340    pub mail_smtp_args_password: Option<String>,
21341    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21342    pub mail_smtp_args_port: Option<String>,
21343    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21344    pub mail_smtp_args_smtpsecure: Option<String>,
21345    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21346    pub mail_smtp_args_username: Option<String>,
21347    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21348    pub matomo_uri: Option<String>,
21349    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21350    pub max_uploadfile_size_kb: Option<i64>,
21351    #[serde(default, skip_serializing_if = "Option::is_none")]
21352    pub post_active: Option<bool>,
21353    #[serde(default, skip_serializing_if = "Option::is_none")]
21354    pub post_edit_time_limited: Option<bool>,
21355    #[serde(default, skip_serializing_if = "Option::is_none")]
21356    pub post_email_summary_default_enabled: Option<bool>,
21357    /// Allowed values: `all`, `featured_groups`, `my_groups`.
21358    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21359    pub post_email_summary_default_filter: Option<String>,
21360    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21361    pub post_email_summary_default_weekdays: Option<String>,
21362    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21363    pub post_featured_groups: Option<String>,
21364    #[serde(default, skip_serializing_if = "Option::is_none")]
21365    pub post_inmenu: Option<bool>,
21366    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21367    pub post_name: Option<String>,
21368    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21369    pub post_sortcode: Option<i64>,
21370    #[serde(default, skip_serializing_if = "Option::is_none")]
21371    pub post_wizard_completed: Option<bool>,
21372    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21373    pub post_wizard_groups: Option<String>,
21374    #[serde(default, skip_serializing_if = "Option::is_none")]
21375    pub prevent_export: Option<bool>,
21376    #[serde(default, skip_serializing_if = "Option::is_none")]
21377    pub privacy_policy_external: Option<bool>,
21378    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21379    pub privacy_policy_external_link: Option<String>,
21380    #[serde(default, skip_serializing_if = "Option::is_none")]
21381    pub privacy_policy_fields_mandatory: Option<bool>,
21382    #[serde(default, skip_serializing_if = "Option::is_none")]
21383    pub privacy_policy_fields_mandatory_api: Option<bool>,
21384    #[serde(default, skip_serializing_if = "Option::is_none")]
21385    pub privacy_policy_internal: Option<bool>,
21386    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21387    pub rss_widget_link: Option<String>,
21388    #[serde(default, skip_serializing_if = "Option::is_none")]
21389    pub send_data_security_mails: Option<bool>,
21390    #[serde(default, skip_serializing_if = "Option::is_none")]
21391    pub show_remember_me: Option<bool>,
21392    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21393    pub site_licensekey: Option<String>,
21394    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21395    pub site_logo: Option<String>,
21396    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21397    pub site_mail: Option<String>,
21398    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21399    pub site_name: Option<String>,
21400    #[serde(default, skip_serializing_if = "Option::is_none")]
21401    pub site_offline: Option<bool>,
21402    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21403    pub site_region: Option<String>,
21404    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21405    pub site_startpage: Option<String>,
21406    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
21407    #[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")]
21408    pub support_user_active_since: Option<chrono::DateTime<chrono::Utc>>,
21409    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21410    pub timezone: Option<String>,
21411    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21412    pub welcome: Option<String>,
21413    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21414    pub welcome_subtext: Option<String>,
21415    /// Fields not described by the spec, e.g. instance-specific DB fields.
21416    #[serde(flatten)]
21417    pub extra: serde_json::Map<String, serde_json::Value>,
21418}
21419
21420#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21421pub struct PutDynamicgroupsIdRulesetResponse {
21422    #[serde(rename = "dynamicGroupRuleSet", default, skip_serializing_if = "Option::is_none")]
21423    pub dynamic_group_rule_set: Option<Vec<DynamicGroupRule>>,
21424    /// Fields not described by the spec, e.g. instance-specific DB fields.
21425    #[serde(flatten)]
21426    pub extra: serde_json::Map<String, serde_json::Value>,
21427}
21428
21429#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21430pub struct PutGroupsGroupIdMeetingsMeetingIdBody {
21431    /// Meeting notes; omitted, null or blank text clears them.
21432    ///
21433    /// `None` leaves the field out, `Some(None)` sends `null`.
21434    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
21435    pub comment: Option<Option<String>>,
21436    /// Whether the meeting was canceled. Canceling retains the meeting record.
21437    #[serde(rename = "isCanceled")]
21438    pub is_canceled: bool,
21439    /// Whether attendance and feedback have been marked as completed. Attendance changes through check-in endpoints are rejected while this is true.
21440    #[serde(rename = "isCompleted")]
21441    pub is_completed: bool,
21442    /// Additional guest headcount entered for the meeting, or null when unspecified. This does not create person or attendance records.
21443    ///
21444    /// `None` leaves the field out, `Some(None)` sends `null`.
21445    #[serde(rename = "numGuests", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
21446    pub num_guests: Option<Option<i64>>,
21447    /// 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.
21448    ///
21449    /// `None` leaves the field out, `Some(None)` sends `null`.
21450    #[serde(rename = "pollResult", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
21451    pub poll_result: Option<Option<Vec<serde_json::Value>>>,
21452    /// New start timestamp in UTC; dateFrom is a legacy alias.
21453    #[serde(rename = "startDate", serialize_with = "crate::datetime::serialize_utc")]
21454    pub start_date: chrono::DateTime<chrono::Utc>,
21455    /// Fields not described by the spec, e.g. instance-specific DB fields.
21456    #[serde(flatten)]
21457    pub extra: serde_json::Map<String, serde_json::Value>,
21458}
21459
21460/// 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.
21461#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21462pub struct PutGroupsGroupIdMembersPersonIdData {
21463    /// Legacy response-field mapping emitted by the membership transformer.
21464    #[serde(rename = "@deprecated")]
21465    pub deprecated: GroupMemberDeprecated,
21466    /// Comment about this membership. Only included when the current user can view basic group member fields.
21467    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21468    pub comment: Option<String>,
21469    /// 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.
21470    #[serde(default, skip_serializing_if = "Option::is_none")]
21471    pub fields: Option<Vec<GroupMemberFieldsItem>>,
21472    /// Group to which this membership belongs.
21473    pub group: GroupMemberGroup,
21474    /// 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.
21475    /// Allowed values: `active`, `requested`, `to_delete`, `waiting`.
21476    #[serde(rename = "groupMemberStatus", deserialize_with = "crate::lenient::string")]
21477    pub group_member_status: String,
21478    /// 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.
21479    #[serde(rename = "groupTypeRoleId", deserialize_with = "crate::lenient::number")]
21480    pub group_type_role_id: i64,
21481    /// ID of the membership record linking the person and group.
21482    #[serde(deserialize_with = "crate::lenient::number")]
21483    pub id: i64,
21484    /// Membership end date, or null if none is set. Only included when the current user can view basic group member fields.
21485    #[serde(rename = "memberEndDate", default, skip_serializing_if = "Option::is_none")]
21486    pub member_end_date: Option<chrono::NaiveDate>,
21487    /// Date on which the membership began (YYYY-MM-DD), or null if no start date is set.
21488    #[serde(rename = "memberStartDate", default, skip_serializing_if = "Option::is_none")]
21489    pub member_start_date: Option<chrono::NaiveDate>,
21490    /// Newsletter subscription information, included when the member list is requested with include=newsletter.
21491    #[serde(default, skip_serializing_if = "Option::is_none")]
21492    pub newsletter: Option<GroupMemberNewsletter>,
21493    /// Person who belongs to the group. domainIdentifier is the person ID as a string.
21494    pub person: GroupMemberPerson,
21495    /// 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.
21496    #[serde(rename = "personFields", default, skip_serializing_if = "serde_json::Value::is_null")]
21497    pub person_fields: serde_json::Value,
21498    /// use person.domainIdentifier (type: string) instead.
21499    #[serde(rename = "personId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21500    #[deprecated = "deprecated in the ChurchTools API"]
21501    pub person_id: Option<i64>,
21502    /// Person ID recorded as having registered this member, or null if none is recorded.
21503    #[serde(rename = "registeredBy", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21504    pub registered_by: Option<i64>,
21505    /// Timestamp of the most recent role change.
21506    #[serde(rename = "roleChangedDate", serialize_with = "crate::datetime::serialize_utc")]
21507    pub role_changed_date: chrono::DateTime<chrono::Utc>,
21508    /// Timestamp of the most recent membership status change.
21509    #[serde(rename = "statusChangedDate", serialize_with = "crate::datetime::serialize_utc")]
21510    pub status_changed_date: chrono::DateTime<chrono::Utc>,
21511    /// Person tags, included when the member list is requested with include=tags.
21512    #[serde(default, skip_serializing_if = "Option::is_none")]
21513    pub tags: Option<Vec<Tag>>,
21514    /// Position on the group’s waiting list, or null when no position is assigned.
21515    #[serde(rename = "waitinglistPosition", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21516    pub waitinglist_position: Option<i64>,
21517    /// Legacy duplicate of this membership.
21518    #[serde(rename = "0", default, skip_serializing_if = "Option::is_none")]
21519    #[deprecated = "deprecated in the ChurchTools API"]
21520    pub f_0: Option<PutGroupsGroupIdMembersPersonIdDataT0>,
21521    /// Fields not described by the spec, e.g. instance-specific DB fields.
21522    #[serde(flatten)]
21523    pub extra: serde_json::Map<String, serde_json::Value>,
21524}
21525
21526/// Legacy duplicate of this membership.
21527#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21528pub struct PutGroupsGroupIdMembersPersonIdDataT0 {
21529    /// Legacy response-field mapping emitted by the membership transformer.
21530    #[serde(rename = "@deprecated")]
21531    pub deprecated: GroupMemberDeprecated,
21532    /// Comment about this membership. Only included when the current user can view basic group member fields.
21533    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21534    pub comment: Option<String>,
21535    /// 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.
21536    #[serde(default, skip_serializing_if = "Option::is_none")]
21537    pub fields: Option<Vec<GroupMemberFieldsItem>>,
21538    /// Group to which this membership belongs.
21539    pub group: GroupMemberGroup,
21540    /// 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.
21541    /// Allowed values: `active`, `requested`, `to_delete`, `waiting`.
21542    #[serde(rename = "groupMemberStatus", deserialize_with = "crate::lenient::string")]
21543    pub group_member_status: String,
21544    /// 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.
21545    #[serde(rename = "groupTypeRoleId", deserialize_with = "crate::lenient::number")]
21546    pub group_type_role_id: i64,
21547    /// ID of the membership record linking the person and group.
21548    #[serde(deserialize_with = "crate::lenient::number")]
21549    pub id: i64,
21550    /// Membership end date, or null if none is set. Only included when the current user can view basic group member fields.
21551    #[serde(rename = "memberEndDate", default, skip_serializing_if = "Option::is_none")]
21552    pub member_end_date: Option<chrono::NaiveDate>,
21553    /// Date on which the membership began (YYYY-MM-DD), or null if no start date is set.
21554    #[serde(rename = "memberStartDate", default, skip_serializing_if = "Option::is_none")]
21555    pub member_start_date: Option<chrono::NaiveDate>,
21556    /// Newsletter subscription information, included when the member list is requested with include=newsletter.
21557    #[serde(default, skip_serializing_if = "Option::is_none")]
21558    pub newsletter: Option<GroupMemberNewsletter>,
21559    /// Person who belongs to the group. domainIdentifier is the person ID as a string.
21560    pub person: GroupMemberPerson,
21561    /// 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.
21562    #[serde(rename = "personFields", default, skip_serializing_if = "serde_json::Value::is_null")]
21563    pub person_fields: serde_json::Value,
21564    /// use person.domainIdentifier (type: string) instead.
21565    #[serde(rename = "personId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21566    #[deprecated = "deprecated in the ChurchTools API"]
21567    pub person_id: Option<i64>,
21568    /// Person ID recorded as having registered this member, or null if none is recorded.
21569    #[serde(rename = "registeredBy", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21570    pub registered_by: Option<i64>,
21571    /// Timestamp of the most recent role change.
21572    #[serde(rename = "roleChangedDate", serialize_with = "crate::datetime::serialize_utc")]
21573    pub role_changed_date: chrono::DateTime<chrono::Utc>,
21574    /// Timestamp of the most recent membership status change.
21575    #[serde(rename = "statusChangedDate", serialize_with = "crate::datetime::serialize_utc")]
21576    pub status_changed_date: chrono::DateTime<chrono::Utc>,
21577    /// Person tags, included when the member list is requested with include=tags.
21578    #[serde(default, skip_serializing_if = "Option::is_none")]
21579    pub tags: Option<Vec<Tag>>,
21580    /// Position on the group’s waiting list, or null when no position is assigned.
21581    #[serde(rename = "waitinglistPosition", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21582    pub waitinglist_position: Option<i64>,
21583    /// Fields not described by the spec, e.g. instance-specific DB fields.
21584    #[serde(flatten)]
21585    pub extra: serde_json::Map<String, serde_json::Value>,
21586}
21587
21588#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21589pub struct PutPermissionsLockedData {
21590    pub permissions: Vec<LockedPermission>,
21591    /// Fields not described by the spec, e.g. instance-specific DB fields.
21592    #[serde(flatten)]
21593    pub extra: serde_json::Map<String, serde_json::Value>,
21594}
21595
21596/// Pending self-registration.
21597#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21598pub struct Registration {
21599    /// Configuration GUID, despite the `configId` property name.
21600    #[serde(rename = "configId", deserialize_with = "crate::lenient::string")]
21601    pub config_id: String,
21602    #[serde(deserialize_with = "crate::lenient::string")]
21603    pub email: String,
21604    #[serde(rename = "firstName", deserialize_with = "crate::lenient::string")]
21605    pub first_name: String,
21606    #[serde(deserialize_with = "crate::lenient::string")]
21607    pub guid: String,
21608    #[serde(rename = "lastName", deserialize_with = "crate::lenient::string")]
21609    pub last_name: String,
21610    pub meta: MetaDataEntityId,
21611    /// Only included after confirmation when active persons share the default email address; omitted when there are no matches.
21612    #[serde(rename = "possibleMatches", default, skip_serializing_if = "Option::is_none")]
21613    pub possible_matches: Option<Vec<RegistrationPossibleMatchesItem>>,
21614    #[serde(rename = "redirectAfterRegistration", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21615    pub redirect_after_registration: Option<String>,
21616    /// Fields not described by the spec, e.g. instance-specific DB fields.
21617    #[serde(flatten)]
21618    pub extra: serde_json::Map<String, serde_json::Value>,
21619}
21620
21621/// Self-registration form configuration. Administrative properties are included for callers with "churchcore administer persons" permission.
21622#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21623pub struct RegistrationConfig {
21624    #[serde(rename = "@deprecated", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21625    pub deprecated: Option<String>,
21626    /// Administrators only. Blocked email patterns; `*` matches arbitrary text, case-insensitively.
21627    #[serde(default, skip_serializing_if = "Option::is_none")]
21628    pub blacklist: Option<Vec<String>>,
21629    pub campuses: Vec<RegistrationConfigCampusesItem>,
21630    /// Administrators only. Departments assigned to newly created persons.
21631    #[serde(rename = "departmentIds", default, skip_serializing_if = "Option::is_none")]
21632    pub department_ids: Option<Vec<i64>>,
21633    pub fields: Vec<RegistrationConfigFieldsItem>,
21634    #[serde(deserialize_with = "crate::lenient::string")]
21635    pub guid: String,
21636    #[serde(deserialize_with = "crate::lenient::number")]
21637    pub id: i64,
21638    #[serde(rename = "isActive")]
21639    pub is_active: bool,
21640    /// True when `statusId` is set and department/campus configurations are nonempty; independent of `isActive`.
21641    #[serde(rename = "isComplete")]
21642    pub is_complete: bool,
21643    #[serde(default, skip_serializing_if = "Option::is_none")]
21644    pub meta: Option<MetaDataEntityId>,
21645    #[serde(rename = "minimumAge", deserialize_with = "crate::lenient::number")]
21646    pub minimum_age: i64,
21647    /// Shows the registration entry point and permits numeric-ID public reads.
21648    #[serde(rename = "showButton")]
21649    pub show_button: bool,
21650    /// Administrators only. Status assigned to newly created persons.
21651    #[serde(rename = "statusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21652    pub status_id: Option<i64>,
21653    /// Administrative compatibility alias for `tagsForNewPersons`.
21654    #[serde(default, skip_serializing_if = "Option::is_none")]
21655    #[deprecated = "deprecated in the ChurchTools API"]
21656    pub tags: Option<Vec<String>>,
21657    /// Administrators only. Person tag names added when linking an existing person.
21658    #[serde(rename = "tagsForExistingPersons", default, skip_serializing_if = "Option::is_none")]
21659    pub tags_for_existing_persons: Option<Vec<String>>,
21660    /// Administrators only. Person tag names added to newly created persons.
21661    #[serde(rename = "tagsForNewPersons", default, skip_serializing_if = "Option::is_none")]
21662    pub tags_for_new_persons: Option<Vec<String>>,
21663    /// Fields not described by the spec, e.g. instance-specific DB fields.
21664    #[serde(flatten)]
21665    pub extra: serde_json::Map<String, serde_json::Value>,
21666}
21667
21668/// Configuration as returned to administrators; includes assignment settings and audit metadata.
21669#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21670pub struct RegistrationConfigAdmin {
21671    #[serde(rename = "@deprecated", deserialize_with = "crate::lenient::string")]
21672    pub deprecated: String,
21673    /// Administrators only. Blocked email patterns; `*` matches arbitrary text, case-insensitively.
21674    pub blacklist: Vec<String>,
21675    pub campuses: Vec<RegistrationConfigCampusesItem>,
21676    /// Administrators only. Departments assigned to newly created persons.
21677    #[serde(rename = "departmentIds")]
21678    pub department_ids: Vec<i64>,
21679    pub fields: Vec<RegistrationConfigFieldsItem>,
21680    #[serde(deserialize_with = "crate::lenient::string")]
21681    pub guid: String,
21682    #[serde(deserialize_with = "crate::lenient::number")]
21683    pub id: i64,
21684    #[serde(rename = "isActive")]
21685    pub is_active: bool,
21686    /// True when `statusId` is set and department/campus configurations are nonempty; independent of `isActive`.
21687    #[serde(rename = "isComplete")]
21688    pub is_complete: bool,
21689    pub meta: MetaDataEntityId,
21690    #[serde(rename = "minimumAge", deserialize_with = "crate::lenient::number")]
21691    pub minimum_age: i64,
21692    /// Shows the registration entry point and permits numeric-ID public reads.
21693    #[serde(rename = "showButton")]
21694    pub show_button: bool,
21695    /// Administrators only. Status assigned to newly created persons.
21696    #[serde(rename = "statusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21697    pub status_id: Option<i64>,
21698    /// Administrative compatibility alias for `tagsForNewPersons`.
21699    #[serde(default, skip_serializing_if = "Option::is_none")]
21700    #[deprecated = "deprecated in the ChurchTools API"]
21701    pub tags: Option<Vec<String>>,
21702    /// Administrators only. Person tag names added when linking an existing person.
21703    #[serde(rename = "tagsForExistingPersons")]
21704    pub tags_for_existing_persons: Vec<String>,
21705    /// Administrators only. Person tag names added to newly created persons.
21706    #[serde(rename = "tagsForNewPersons")]
21707    pub tags_for_new_persons: Vec<String>,
21708    /// Fields not described by the spec, e.g. instance-specific DB fields.
21709    #[serde(flatten)]
21710    pub extra: serde_json::Map<String, serde_json::Value>,
21711}
21712
21713#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21714pub struct RegistrationConfigCampusesItem {
21715    /// Profiles are representing campuses and the church itself.
21716    pub campus: Profile,
21717    #[serde(rename = "campusId", deserialize_with = "crate::lenient::number")]
21718    pub campus_id: i64,
21719    /// Automatic membership groups for new persons; administrators only.
21720    #[serde(rename = "groupIds", default, skip_serializing_if = "Option::is_none")]
21721    pub group_ids: Option<Vec<i64>>,
21722    /// Fields not described by the spec, e.g. instance-specific DB fields.
21723    #[serde(flatten)]
21724    pub extra: serde_json::Map<String, serde_json::Value>,
21725}
21726
21727#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21728pub struct RegistrationConfigFieldsItem {
21729    /// Expanded database-field definition when resolvable.
21730    #[serde(default, skip_serializing_if = "Option::is_none")]
21731    pub field: Option<RegistrationConfigFieldsItemField>,
21732    #[serde(rename = "fieldId", deserialize_with = "crate::lenient::number")]
21733    pub field_id: i64,
21734    #[serde(rename = "isRequired")]
21735    pub is_required: bool,
21736    /// Fields not described by the spec, e.g. instance-specific DB fields.
21737    #[serde(flatten)]
21738    pub extra: serde_json::Map<String, serde_json::Value>,
21739}
21740
21741/// Expanded database-field definition when resolvable.
21742#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21743pub struct RegistrationConfigFieldsItemField {
21744    /// Whether a person field’s value is cleared on archiving. Cannot be true for a non-nullable field.
21745    #[serde(rename = "deleteOnArchive")]
21746    pub delete_on_archive: bool,
21747    /// Whether the field is enabled for normal use.
21748    #[serde(rename = "isActive")]
21749    pub is_active: bool,
21750    /// Whether routines may use this field.
21751    #[serde(rename = "isAvailableInRoutines")]
21752    pub is_available_in_routines: bool,
21753    /// Whether the field is available on new-person forms; primarily relevant to person categories.
21754    #[serde(rename = "isNewPersonField")]
21755    pub is_new_person_field: bool,
21756    /// Configured field length.
21757    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21758    pub length: Option<i64>,
21759    /// Legacy display-layout setting, retained for compatibility.
21760    #[serde(rename = "lineEnding", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21761    #[deprecated = "deprecated in the ChurchTools API"]
21762    pub line_ending: Option<String>,
21763    /// Stored display name or translation key. nameTranslated is its localized display text.
21764    #[serde(deserialize_with = "crate::lenient::string")]
21765    pub name: String,
21766    /// Security-level ID governing access to this field, resolved from installation masterdata.
21767    #[serde(rename = "securityLevel", deserialize_with = "crate::lenient::number")]
21768    pub security_level: i64,
21769    /// Abbreviated label.
21770    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21771    pub shorty: Option<String>,
21772    /// Display-order value within its category.
21773    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
21774    pub sort_key: i64,
21775    /// Whether the field may be used as a placeholder.
21776    #[serde(rename = "useAsPlaceholder")]
21777    pub use_as_placeholder: bool,
21778    /// Compatibility mappings emitted by the backend.
21779    #[serde(rename = "@deprecated")]
21780    pub deprecated: DbFieldDeprecated,
21781    /// Underlying database column; prefer key for API requests.
21782    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21783    #[deprecated = "deprecated in the ChurchTools API"]
21784    pub column: Option<String>,
21785    /// True for a custom field created by this ChurchTools installation.
21786    #[serde(rename = "createdByChurch")]
21787    pub created_by_church: bool,
21788    /// Stored field category and its underlying entity table. Use internCode when creating a field.
21789    #[serde(rename = "fieldCategory")]
21790    pub field_category: DbFieldCategory,
21791    /// 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.
21792    #[serde(rename = "fieldType")]
21793    pub field_type: DbFieldType,
21794    /// Stored flag controlling frontend visibility; current updates reset it to false.
21795    #[serde(rename = "hideInFrontend")]
21796    pub hide_in_frontend: bool,
21797    /// Field-definition ID used in /dbfields paths.
21798    #[serde(deserialize_with = "crate::lenient::number")]
21799    pub id: i64,
21800    /// Whether the field is marked as basic information; current updates reset it to false.
21801    #[serde(rename = "isBasicInfo")]
21802    pub is_basic_info: bool,
21803    /// Whether the field is marked as non-configurable; current updates reset it to false.
21804    #[serde(rename = "isNotConfigurable")]
21805    pub is_not_configurable: bool,
21806    /// Whether stored field values may be null. Custom checkbox fields are non-nullable.
21807    #[serde(rename = "isNullable")]
21808    pub is_nullable: bool,
21809    /// API property name. Built-in columns are mapped to API names; custom fields normally retain their generated column name.
21810    #[serde(deserialize_with = "crate::lenient::string")]
21811    pub key: String,
21812    /// Localized display name for the current language.
21813    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
21814    pub name_translated: String,
21815    /// Deprecated alias of isNotConfigurable.
21816    #[serde(rename = "notConfigurable", default, skip_serializing_if = "Option::is_none")]
21817    #[deprecated = "deprecated in the ChurchTools API"]
21818    pub not_configurable: Option<bool>,
21819    /// Deprecated alias of isNullable.
21820    #[serde(default, skip_serializing_if = "Option::is_none")]
21821    #[deprecated = "deprecated in the ChurchTools API"]
21822    pub nullable: Option<bool>,
21823    /// 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.
21824    #[serde(default, skip_serializing_if = "Option::is_none")]
21825    pub options: Option<Vec<DbFieldOption>>,
21826    /// Fields not described by the spec, e.g. instance-specific DB fields.
21827    #[serde(flatten)]
21828    pub extra: serde_json::Map<String, serde_json::Value>,
21829}
21830
21831/// Partial self-registration configuration update.
21832#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21833pub struct RegistrationConfigUpdate {
21834    /// Case-insensitive email patterns; `*` is a wildcard. Replaces the full blacklist.
21835    #[serde(default, skip_serializing_if = "Option::is_none")]
21836    pub blacklist: Option<Vec<String>>,
21837    #[serde(default, skip_serializing_if = "Option::is_none")]
21838    pub campuses: Option<Vec<RegistrationConfigUpdateCampusesItem>>,
21839    #[serde(rename = "departmentIds", default, skip_serializing_if = "Option::is_none")]
21840    pub department_ids: Option<Vec<i64>>,
21841    /// Complete replacement of configured person fields.
21842    #[serde(default, skip_serializing_if = "Option::is_none")]
21843    pub fields: Option<Vec<RegistrationConfigUpdateFieldsItem>>,
21844    #[serde(rename = "isActive", default, skip_serializing_if = "Option::is_none")]
21845    pub is_active: Option<bool>,
21846    #[serde(rename = "minimumAge", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21847    pub minimum_age: Option<i64>,
21848    #[serde(rename = "showButton", default, skip_serializing_if = "Option::is_none")]
21849    pub show_button: Option<bool>,
21850    /// `None` leaves the field out, `Some(None)` sends `null`.
21851    #[serde(rename = "statusId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
21852    pub status_id: Option<Option<i64>>,
21853    /// Legacy input alias; prefer `tagsForNewPersons`.
21854    #[serde(default, skip_serializing_if = "Option::is_none")]
21855    #[deprecated = "deprecated in the ChurchTools API"]
21856    pub tags: Option<Vec<String>>,
21857    #[serde(rename = "tagsForExistingPersons", default, skip_serializing_if = "Option::is_none")]
21858    pub tags_for_existing_persons: Option<Vec<String>>,
21859    #[serde(rename = "tagsForNewPersons", default, skip_serializing_if = "Option::is_none")]
21860    pub tags_for_new_persons: Option<Vec<String>>,
21861    /// Fields not described by the spec, e.g. instance-specific DB fields.
21862    #[serde(flatten)]
21863    pub extra: serde_json::Map<String, serde_json::Value>,
21864}
21865
21866#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21867pub struct RegistrationConfigUpdateCampusesItem {
21868    #[serde(rename = "campusId", deserialize_with = "crate::lenient::number")]
21869    pub campus_id: i64,
21870    #[serde(rename = "groupIds")]
21871    pub group_ids: Vec<i64>,
21872    /// Fields not described by the spec, e.g. instance-specific DB fields.
21873    #[serde(flatten)]
21874    pub extra: serde_json::Map<String, serde_json::Value>,
21875}
21876
21877#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21878pub struct RegistrationConfigUpdateFieldsItem {
21879    #[serde(rename = "fieldId", deserialize_with = "crate::lenient::number")]
21880    pub field_id: i64,
21881    #[serde(rename = "isRequired")]
21882    pub is_required: bool,
21883    /// Fields not described by the spec, e.g. instance-specific DB fields.
21884    #[serde(flatten)]
21885    pub extra: serde_json::Map<String, serde_json::Value>,
21886}
21887
21888#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21889pub struct RegistrationConfirm {
21890    /// Confirmation token from the emailed link.
21891    #[serde(deserialize_with = "crate::lenient::string")]
21892    pub token: String,
21893    /// Fields not described by the spec, e.g. instance-specific DB fields.
21894    #[serde(flatten)]
21895    pub extra: serde_json::Map<String, serde_json::Value>,
21896}
21897
21898#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21899pub struct RegistrationConvert {
21900    /// Consent fields plus configured person fields by numeric field ID or modern field name.
21901    #[serde(rename = "formData")]
21902    pub form_data: RegistrationConvertFormData,
21903    /// Eligible existing person to link; without it, a new person is created.
21904    #[serde(rename = "personId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21905    pub person_id: Option<i64>,
21906    /// Same token used for email confirmation.
21907    #[serde(deserialize_with = "crate::lenient::string")]
21908    pub token: String,
21909    /// Fields not described by the spec, e.g. instance-specific DB fields.
21910    #[serde(flatten)]
21911    pub extra: serde_json::Map<String, serde_json::Value>,
21912}
21913
21914/// Consent fields plus configured person fields by numeric field ID or modern field name.
21915#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21916pub struct RegistrationConvertFormData {
21917    /// Explicit acceptance of the data privacy policy.
21918    #[serde(rename = "acceptDataPrivacy")]
21919    pub accept_data_privacy: bool,
21920    /// Required when `accept_datasecurity` is enabled.
21921    #[serde(rename = "acceptDataSecurity", default, skip_serializing_if = "Option::is_none")]
21922    pub accept_data_security: Option<bool>,
21923    /// Configured campus for a new person. Required with multiple campus choices.
21924    #[serde(rename = "campusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21925    pub campus_id: Option<i64>,
21926    /// Fields not described by the spec, e.g. instance-specific DB fields.
21927    #[serde(flatten)]
21928    pub extra: serde_json::Map<String, serde_json::Value>,
21929}
21930
21931#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21932pub struct RegistrationCreate {
21933    /// GUID from `RegistrationConfig.guid`.
21934    #[serde(rename = "configId", deserialize_with = "crate::lenient::string")]
21935    pub config_id: String,
21936    /// Email address used for confirmation.
21937    #[serde(deserialize_with = "crate::lenient::string")]
21938    pub email: String,
21939    /// Given name.
21940    #[serde(rename = "firstName", deserialize_with = "crate::lenient::string")]
21941    pub first_name: String,
21942    /// Applicant confirms the configured minimum age.
21943    #[serde(rename = "hasMinimumAge", default, skip_serializing_if = "Option::is_none")]
21944    pub has_minimum_age: Option<bool>,
21945    /// Family name.
21946    #[serde(rename = "lastName", deserialize_with = "crate::lenient::string")]
21947    pub last_name: String,
21948    /// Must satisfy the configured password-strength requirements.
21949    #[serde(deserialize_with = "crate::lenient::string")]
21950    pub password: String,
21951    /// Destination for the client after completion.
21952    ///
21953    /// `None` leaves the field out, `Some(None)` sends `null`.
21954    #[serde(rename = "redirectAfterRegistration", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
21955    pub redirect_after_registration: Option<Option<String>>,
21956    /// Fields not described by the spec, e.g. instance-specific DB fields.
21957    #[serde(flatten)]
21958    pub extra: serde_json::Map<String, serde_json::Value>,
21959}
21960
21961#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21962pub struct RegistrationPossibleMatchesItem {
21963    /// Person as Domain Object
21964    #[serde(rename = "domainObject")]
21965    pub domain_object: DomainObjectPerson,
21966    /// Configured active person fields, keyed by person field name. Available for the email-verified applicant.
21967    #[serde(rename = "formData", deserialize_with = "crate::lenient::map")]
21968    pub form_data: std::collections::BTreeMap<String, serde_json::Value>,
21969    #[serde(rename = "hasPassword")]
21970    pub has_password: bool,
21971    /// Fields not described by the spec, e.g. instance-specific DB fields.
21972    #[serde(flatten)]
21973    pub extra: serde_json::Map<String, serde_json::Value>,
21974}
21975
21976/// 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.
21977#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21978pub struct RelationshipType {
21979    /// Role label for side A. Identical labels on both sides make the type undirected.
21980    #[serde(rename = "degreeNameA", deserialize_with = "crate::lenient::string")]
21981    pub degree_name_a: String,
21982    /// Role label for side B and counterpart of `degreeNameA`.
21983    #[serde(rename = "degreeNameB", deserialize_with = "crate::lenient::string")]
21984    pub degree_name_b: String,
21985    /// Heading for the combined export column. The export otherwise uses the type name or synthesized role labels.
21986    #[serde(rename = "exportTitle", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21987    pub export_title: Option<String>,
21988    /// Whether selected export values from both relationship directions are combined in one column. `false` still permits separate-direction export.
21989    #[serde(rename = "includeInExport")]
21990    pub include_in_export: bool,
21991    /// Stored type name or translation key. Use `nameTranslated` for the synthesized display label.
21992    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21993    pub name: Option<String>,
21994    /// Security level configured for relationships of this type.
21995    #[serde(rename = "securityLevelId", deserialize_with = "crate::lenient::number")]
21996    pub security_level_id: i64,
21997    /// Primary ascending catalog sort key. Ties are ordered by stored name, not by the translated or synthesized display name.
21998    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
21999    pub sort_key: i64,
22000    /// Side A role label translated for the current language.
22001    #[serde(rename = "degreeNameATranslated", deserialize_with = "crate::lenient::string")]
22002    pub degree_name_a_translated: String,
22003    /// Side B role label translated for the current language.
22004    #[serde(rename = "degreeNameBTranslated", deserialize_with = "crate::lenient::string")]
22005    pub degree_name_b_translated: String,
22006    /// 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.
22007    /// Allowed values: `nodelete`, `noduplicate`, `openduplicate`.
22008    #[serde(rename = "functionKeys")]
22009    pub function_keys: Vec<String>,
22010    /// Relationship-type ID used when creating or reading a relationship between persons.
22011    #[serde(deserialize_with = "crate::lenient::number")]
22012    pub id: i64,
22013    /// Translated display name, using the translated side labels as a fallback.
22014    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
22015    pub name_translated: String,
22016    /// Fields not described by the spec, e.g. instance-specific DB fields.
22017    #[serde(flatten)]
22018    pub extra: serde_json::Map<String, serde_json::Value>,
22019}
22020
22021/// Creates a relationship-type catalog definition, not a relationship between persons.
22022#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22023pub struct RelationshipTypeCreate {
22024    /// Role label for side A. Identical labels on both sides make the type undirected.
22025    #[serde(rename = "degreeNameA", deserialize_with = "crate::lenient::string")]
22026    pub degree_name_a: String,
22027    /// Role label for side B and counterpart of `degreeNameA`.
22028    #[serde(rename = "degreeNameB", deserialize_with = "crate::lenient::string")]
22029    pub degree_name_b: String,
22030    /// Heading for the combined export column. The export otherwise uses the type name or synthesized role labels.
22031    ///
22032    /// `None` leaves the field out, `Some(None)` sends `null`.
22033    #[serde(rename = "exportTitle", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22034    pub export_title: Option<Option<String>>,
22035    /// 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.
22036    ///
22037    /// `None` leaves the field out, `Some(None)` sends `null`.
22038    #[serde(rename = "includeInExport", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22039    pub include_in_export: Option<Option<bool>>,
22040    /// Stored name or translation key. The response derives `nameTranslated` from the side labels when necessary.
22041    ///
22042    /// `None` leaves the field out, `Some(None)` sends `null`.
22043    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22044    pub name: Option<Option<String>>,
22045    /// ID of an existing, installation-specific security level for relationships of this type.
22046    #[serde(rename = "securityLevelId", deserialize_with = "crate::lenient::number")]
22047    pub security_level_id: i64,
22048    /// Ascending catalog sort key.
22049    ///
22050    /// `None` leaves the field out, `Some(None)` sends `null`.
22051    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22052    pub sort_key: Option<Option<i64>>,
22053    /// Fields not described by the spec, e.g. instance-specific DB fields.
22054    #[serde(flatten)]
22055    pub extra: serde_json::Map<String, serde_json::Value>,
22056}
22057
22058/// Replacement fields for an existing relationship type.
22059#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22060pub struct RelationshipTypeUpdate {
22061    /// Role label for side A. Identical labels on both sides make the type undirected.
22062    #[serde(rename = "degreeNameA", deserialize_with = "crate::lenient::string")]
22063    pub degree_name_a: String,
22064    /// Role label for side B and counterpart of `degreeNameA`.
22065    #[serde(rename = "degreeNameB", deserialize_with = "crate::lenient::string")]
22066    pub degree_name_b: String,
22067    /// Heading for the combined export column. The export otherwise uses the type name or synthesized role labels.
22068    ///
22069    /// `None` leaves the field out, `Some(None)` sends `null`.
22070    #[serde(rename = "exportTitle", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22071    pub export_title: Option<Option<String>>,
22072    /// 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.
22073    ///
22074    /// `None` leaves the field out, `Some(None)` sends `null`.
22075    #[serde(rename = "includeInExport", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22076    pub include_in_export: Option<Option<bool>>,
22077    /// Stored name or translation key. The response derives `nameTranslated` from the side labels when necessary.
22078    ///
22079    /// `None` leaves the field out, `Some(None)` sends `null`.
22080    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22081    pub name: Option<Option<String>>,
22082    /// ID of an existing, installation-specific security level for relationships of this type.
22083    #[serde(rename = "securityLevelId", deserialize_with = "crate::lenient::number")]
22084    pub security_level_id: i64,
22085    /// Ascending catalog sort key.
22086    ///
22087    /// `None` leaves the field out, `Some(None)` sends `null`.
22088    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22089    pub sort_key: Option<Option<i64>>,
22090    /// Fields not described by the spec, e.g. instance-specific DB fields.
22091    #[serde(flatten)]
22092    pub extra: serde_json::Map<String, serde_json::Value>,
22093}
22094
22095/// Echo of the transient recurrence definition.
22096#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22097pub struct RepeatCalculationBase {
22098    pub additions: Vec<std::collections::BTreeMap<String, serde_json::Value>>,
22099    #[serde(rename = "allDay")]
22100    pub all_day: bool,
22101    /// 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.
22102    #[serde(rename = "endDate")]
22103    pub end_date: crate::DateOrDateTime,
22104    pub exceptions: Vec<std::collections::BTreeMap<String, serde_json::Value>>,
22105    /// Placeholder ID because no appointment is stored.
22106    /// Allowed values: `-1`.
22107    #[serde(deserialize_with = "crate::lenient::number")]
22108    pub id: i64,
22109    /// 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.
22110    #[serde(rename = "repeatFrequency", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22111    pub repeat_frequency: Option<i64>,
22112    /// 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.
22113    /// Allowed values: `0`, `1`, `31`, `32`, `365`, `7`, `999`.
22114    #[serde(rename = "repeatId", deserialize_with = "crate::lenient::number")]
22115    pub repeat_id: i64,
22116    /// For repeatId=32, ordinal of the weekday within the month: 1–5 for first through fifth, 6 for last. The weekday comes from startDate.
22117    #[serde(rename = "repeatOption", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22118    pub repeat_option: Option<i64>,
22119    /// Inclusive last date of an automatic series. Supply this with automatic recurrence; omission does not represent an unlimited series in these write endpoints.
22120    #[serde(rename = "repeatUntil", default, skip_serializing_if = "Option::is_none")]
22121    pub repeat_until: Option<chrono::NaiveDate>,
22122    /// 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.
22123    #[serde(rename = "startDate")]
22124    pub start_date: crate::DateOrDateTime,
22125    /// Fields not described by the spec, e.g. instance-specific DB fields.
22126    #[serde(flatten)]
22127    pub extra: serde_json::Map<String, serde_json::Value>,
22128}
22129
22130/// Calculate occurrence dates without persisting an appointment.
22131#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22132pub struct RepeatCalculationCreate {
22133    #[serde(default, skip_serializing_if = "Option::is_none")]
22134    pub additionals: Option<Vec<AppointmentAdditionalCreate>>,
22135    /// 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.
22136    #[serde(rename = "endDate")]
22137    pub end_date: crate::DateOrDateTime,
22138    #[serde(default, skip_serializing_if = "Option::is_none")]
22139    pub exceptions: Option<Vec<AppointmentExceptionCreate>>,
22140    /// 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.
22141    ///
22142    /// `None` leaves the field out, `Some(None)` sends `null`.
22143    #[serde(rename = "repeatFrequency", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22144    pub repeat_frequency: Option<Option<i64>>,
22145    /// 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.
22146    /// Allowed values: `0`, `1`, `31`, `32`, `365`, `7`, `999`.
22147    #[serde(rename = "repeatId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22148    pub repeat_id: Option<i64>,
22149    /// For repeatId=32, ordinal of the weekday within the month: 1–5 for first through fifth, 6 for last. The weekday comes from startDate.
22150    ///
22151    /// `None` leaves the field out, `Some(None)` sends `null`.
22152    #[serde(rename = "repeatOption", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22153    pub repeat_option: Option<Option<i64>>,
22154    /// Inclusive last date of an automatic series. Supply this with automatic recurrence; omission does not represent an unlimited series in these write endpoints.
22155    ///
22156    /// `None` leaves the field out, `Some(None)` sends `null`.
22157    #[serde(rename = "repeatUntil", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22158    pub repeat_until: Option<Option<chrono::NaiveDate>>,
22159    /// Start of the base occurrence. For all-day appointments, send YYYY-MM-DD.
22160    #[serde(rename = "startDate")]
22161    pub start_date: crate::DateOrDateTime,
22162    /// Fields not described by the spec, e.g. instance-specific DB fields.
22163    #[serde(flatten)]
22164    pub extra: serde_json::Map<String, serde_json::Value>,
22165}
22166
22167/// One computed occurrence of a transient recurrence definition. No iCalendar UID is assigned.
22168#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22169pub struct RepeatCalculationOccurrence {
22170    /// Echo of the transient recurrence definition.
22171    pub base: RepeatCalculationBase,
22172    pub calculated: RepeatCalculationOccurrenceCalculated,
22173    /// Fields not described by the spec, e.g. instance-specific DB fields.
22174    #[serde(flatten)]
22175    pub extra: serde_json::Map<String, serde_json::Value>,
22176}
22177
22178#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22179pub struct RepeatCalculationOccurrenceCalculated {
22180    /// 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.
22181    #[serde(rename = "endDate")]
22182    pub end_date: crate::DateOrDateTime,
22183    /// 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.
22184    #[serde(rename = "startDate")]
22185    pub start_date: crate::DateOrDateTime,
22186    /// Fields not described by the spec, e.g. instance-specific DB fields.
22187    #[serde(flatten)]
22188    pub extra: serde_json::Map<String, serde_json::Value>,
22189}
22190
22191#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22192pub struct Report {
22193    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22194    pub comment: Option<String>,
22195    pub meta: MetaDataEntityId,
22196    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
22197    pub reporter: serde_json::Value,
22198    /// Allowed values: `accepted`, `declined`, `pending`.
22199    #[serde(deserialize_with = "crate::lenient::string")]
22200    pub status: String,
22201    /// Fields not described by the spec, e.g. instance-specific DB fields.
22202    #[serde(flatten)]
22203    pub extra: serde_json::Map<String, serde_json::Value>,
22204}
22205
22206#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22207pub struct ReportAnswer {
22208    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
22209    pub domain_id: i64,
22210    /// Allowed values: `post`, `post_comment`.
22211    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
22212    pub domain_type: String,
22213    /// Allowed values: `accept`, `decline`.
22214    #[serde(deserialize_with = "crate::lenient::string")]
22215    pub response: String,
22216    /// Fields not described by the spec, e.g. instance-specific DB fields.
22217    #[serde(flatten)]
22218    pub extra: serde_json::Map<String, serde_json::Value>,
22219}
22220
22221#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22222pub struct ReportCreate {
22223    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22224    pub captcha: Option<String>,
22225    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22226    pub comment: Option<String>,
22227    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
22228    pub domain_id: i64,
22229    /// Allowed values: `post`, `post_comment`.
22230    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
22231    pub domain_type: String,
22232    #[serde(default, skip_serializing_if = "Option::is_none")]
22233    pub reporter: Option<ReportCreateReporter>,
22234    /// Fields not described by the spec, e.g. instance-specific DB fields.
22235    #[serde(flatten)]
22236    pub extra: serde_json::Map<String, serde_json::Value>,
22237}
22238
22239#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22240pub struct ReportCreateReporter {
22241    #[serde(deserialize_with = "crate::lenient::string")]
22242    pub email: String,
22243    #[serde(rename = "firstName", deserialize_with = "crate::lenient::string")]
22244    pub first_name: String,
22245    #[serde(rename = "lastName", deserialize_with = "crate::lenient::string")]
22246    pub last_name: String,
22247    /// Fields not described by the spec, e.g. instance-specific DB fields.
22248    #[serde(flatten)]
22249    pub extra: serde_json::Map<String, serde_json::Value>,
22250}
22251
22252#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22253pub struct ReportObjectPost {
22254    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22255    pub comment: Option<String>,
22256    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
22257    pub domain_id: i64,
22258    #[serde(deserialize_with = "crate::lenient::number")]
22259    pub id: i64,
22260    pub meta: MetaDataEntityId,
22261    pub reports: Vec<Report>,
22262    /// Allowed values: `accepted`, `declined`, `pending`, `pending-again`.
22263    #[serde(deserialize_with = "crate::lenient::string")]
22264    pub status: String,
22265    #[serde(rename = "domainObject")]
22266    pub domain_object: Post,
22267    /// Allowed values: `post`.
22268    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
22269    pub domain_type: String,
22270    /// Fields not described by the spec, e.g. instance-specific DB fields.
22271    #[serde(flatten)]
22272    pub extra: serde_json::Map<String, serde_json::Value>,
22273}
22274
22275#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22276pub struct ReportObjectPostComment {
22277    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22278    pub comment: Option<String>,
22279    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
22280    pub domain_id: i64,
22281    #[serde(deserialize_with = "crate::lenient::number")]
22282    pub id: i64,
22283    pub meta: MetaDataEntityId,
22284    pub reports: Vec<Report>,
22285    /// Allowed values: `accepted`, `declined`, `pending`, `pending-again`.
22286    #[serde(deserialize_with = "crate::lenient::string")]
22287    pub status: String,
22288    #[serde(rename = "domainObject")]
22289    pub domain_object: PostComment,
22290    /// Allowed values: `post_comment`.
22291    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
22292    pub domain_type: String,
22293    /// Fields not described by the spec, e.g. instance-specific DB fields.
22294    #[serde(flatten)]
22295    pub extra: serde_json::Map<String, serde_json::Value>,
22296}
22297
22298/// A compact object returned by the registered domain resolver. Match results by `domainType` and `domainIdentifier`, not by array index.
22299#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22300pub struct ResolvedDomainObject {
22301    /// URL for the full API resource, if available. Some legacy domain implementations produce inconsistent URLs.
22302    #[serde(rename = "apiUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22303    pub api_url: Option<String>,
22304    /// Optional display color.
22305    /// 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`.
22306    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
22307    pub color: serde_json::Value,
22308    /// Optional image URL.
22309    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22310    pub image_url: Option<String>,
22311    /// Additional localized display lines; not structured resource fields.
22312    pub infos: Vec<String>,
22313    /// Optional initials for an avatar fallback.
22314    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22315    pub initials: Option<String>,
22316    /// Fields not described by the spec, e.g. instance-specific DB fields.
22317    #[serde(flatten)]
22318    pub extra: serde_json::Map<String, serde_json::Value>,
22319}
22320
22321/// 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.
22322#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22323pub struct Resource {
22324    /// Persons responsible for this resource. Resource administrators can view and administer its bookings; changing resource settings still requires permission to edit resource master data.
22325    #[serde(rename = "adminIds")]
22326    pub admin_ids: Vec<i64>,
22327    /// Additional information about the resource, such as capacity or available equipment.
22328    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22329    pub description: Option<String>,
22330    /// Location text used in the resource’s iCalendar export.
22331    #[serde(rename = "iCalLocation", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22332    pub i_cal_location: Option<String>,
22333    /// 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.
22334    #[serde(rename = "isAutoAccept")]
22335    pub is_auto_accept: bool,
22336    /// Whether this is a virtual resource. Virtual bookings have a separate creation permission and bypass conflicts when checking automatic approval.
22337    #[serde(rename = "isVirtual")]
22338    pub is_virtual: bool,
22339    /// Internal location of the resource.
22340    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22341    pub location: Option<String>,
22342    /// Name of the individual resource, for example a room or vehicle.
22343    #[serde(deserialize_with = "crate::lenient::string")]
22344    pub name: String,
22345    /// Number of units available for simultaneous bookings.
22346    #[serde(deserialize_with = "crate::lenient::number")]
22347    pub quantity: i64,
22348    /// Access token used by the legacy public iCalendar export. Changing or clearing it invalidates subscriptions using the previous token.
22349    #[serde(rename = "randomString", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22350    pub random_string: Option<String>,
22351    /// Resource type used to group this resource, such as rooms or vehicles. Resource types are available from `/resourcetypes`.
22352    #[serde(rename = "resourceTypeId", deserialize_with = "crate::lenient::number")]
22353    pub resource_type_id: i64,
22354    /// Sort value for displaying resources.
22355    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
22356    pub sort_key: i64,
22357    /// Use `needsAppointment` instead.
22358    #[serde(rename = "doesRequireCalEntry", default, skip_serializing_if = "Option::is_none")]
22359    #[deprecated = "Use `needsAppointment` instead."]
22360    pub does_require_cal_entry: Option<bool>,
22361    #[serde(deserialize_with = "crate::lenient::number")]
22362    pub id: i64,
22363    /// Included with `include[]=involvedPersonsDomainObjects`. Contains person references for resolvable `adminIds`; missing persons are omitted.
22364    #[serde(rename = "involvedPersonsDomainObjects", default, skip_serializing_if = "Option::is_none")]
22365    pub involved_persons_domain_objects: Option<BookingCalculatedWithIncludesBaseResourceInvolvedPersonsDomainObjects>,
22366    pub meta: MetaDataEntityId,
22367    /// Resource name translated for the current language, falling back to name.
22368    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
22369    pub name_translated: String,
22370    /// Whether bookings must be linked to a calendar appointment. Legacy resources can return null.
22371    #[serde(rename = "needsAppointment", default, skip_serializing_if = "Option::is_none")]
22372    pub needs_appointment: Option<bool>,
22373    /// Fields not described by the spec, e.g. instance-specific DB fields.
22374    #[serde(flatten)]
22375    pub extra: serde_json::Map<String, serde_json::Value>,
22376}
22377
22378/// Configuration for an individual bookable resource.
22379#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22380pub struct ResourceCreate {
22381    /// Persons responsible for this resource. Resource administrators can view and administer its bookings; changing resource settings still requires permission to edit resource master data.
22382    #[serde(rename = "adminIds", default, skip_serializing_if = "Option::is_none")]
22383    pub admin_ids: Option<Vec<i64>>,
22384    /// Additional information about the resource, such as capacity or available equipment.
22385    ///
22386    /// `None` leaves the field out, `Some(None)` sends `null`.
22387    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22388    pub description: Option<Option<String>>,
22389    /// Location text used in the resource’s iCalendar export.
22390    ///
22391    /// `None` leaves the field out, `Some(None)` sends `null`.
22392    #[serde(rename = "iCalLocation", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22393    pub i_cal_location: Option<Option<String>>,
22394    /// 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.
22395    #[serde(rename = "isAutoAccept", default, skip_serializing_if = "Option::is_none")]
22396    pub is_auto_accept: Option<bool>,
22397    /// Whether this is a virtual resource. Virtual bookings have a separate creation permission and bypass conflicts when checking automatic approval.
22398    #[serde(rename = "isVirtual", default, skip_serializing_if = "Option::is_none")]
22399    pub is_virtual: Option<bool>,
22400    /// Internal location of the resource.
22401    ///
22402    /// `None` leaves the field out, `Some(None)` sends `null`.
22403    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22404    pub location: Option<Option<String>>,
22405    /// Name of the individual resource, for example a room or vehicle.
22406    #[serde(deserialize_with = "crate::lenient::string")]
22407    pub name: String,
22408    /// Number of units available for simultaneous bookings.
22409    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22410    pub quantity: Option<i64>,
22411    /// Access token used by the legacy public iCalendar export. Changing or clearing it invalidates subscriptions using the previous token.
22412    ///
22413    /// `None` leaves the field out, `Some(None)` sends `null`.
22414    #[serde(rename = "randomString", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22415    pub random_string: Option<Option<String>>,
22416    /// Resource type used to group this resource, such as rooms or vehicles. Resource types are available from `/resourcetypes`.
22417    #[serde(rename = "resourceTypeId", deserialize_with = "crate::lenient::number")]
22418    pub resource_type_id: i64,
22419    /// Sort value for displaying resources.
22420    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
22421    pub sort_key: i64,
22422    /// 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.
22423    #[serde(rename = "needsAppointment", default, skip_serializing_if = "Option::is_none")]
22424    pub needs_appointment: Option<bool>,
22425    /// Fields not described by the spec, e.g. instance-specific DB fields.
22426    #[serde(flatten)]
22427    pub extra: serde_json::Map<String, serde_json::Value>,
22428}
22429
22430/// Resource planning reference data: all resource types and the resources visible to the current user.
22431#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22432pub struct ResourceMasterData {
22433    /// All resource types ordered by sortKey ascending, including types without visible resources.
22434    #[serde(rename = "resourceTypes")]
22435    pub resource_types: Vec<ResourceType>,
22436    /// Resources the current user is allowed to view.
22437    pub resources: Vec<Resource>,
22438    /// Fields not described by the spec, e.g. instance-specific DB fields.
22439    #[serde(flatten)]
22440    pub extra: serde_json::Map<String, serde_json::Value>,
22441}
22442
22443/// Pending booking workload for one resource.
22444#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22445pub struct ResourceStatistics {
22446    /// 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.
22447    #[serde(rename = "numRequestedBookingsInFuture", deserialize_with = "crate::lenient::number")]
22448    pub num_requested_bookings_in_future: i64,
22449    /// Fields not described by the spec, e.g. instance-specific DB fields.
22450    #[serde(flatten)]
22451    pub extra: serde_json::Map<String, serde_json::Value>,
22452}
22453
22454/// Category used by `Resource.resourceTypeId`. Resource types are returned even when the reader has no visible resources of that type.
22455#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22456pub struct ResourceType {
22457    /// Associated campus, or null for no campus assignment.
22458    #[serde(rename = "campusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22459    pub campus_id: Option<i64>,
22460    /// Singular label for one resource of this type.
22461    #[serde(deserialize_with = "crate::lenient::string")]
22462    pub name: String,
22463    /// Plural label for resources of this type.
22464    #[serde(rename = "namePlural", deserialize_with = "crate::lenient::string")]
22465    pub name_plural: String,
22466    /// Sort value for displaying resource types.
22467    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
22468    pub sort_key: i64,
22469    #[serde(deserialize_with = "crate::lenient::number")]
22470    pub id: i64,
22471    pub meta: MetaDataEntityId,
22472    /// Plural label translated for the current language.
22473    #[serde(rename = "namePluralTranslated", deserialize_with = "crate::lenient::string")]
22474    pub name_plural_translated: String,
22475    /// Singular label translated for the current language.
22476    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
22477    pub name_translated: String,
22478    /// Fields not described by the spec, e.g. instance-specific DB fields.
22479    #[serde(flatten)]
22480    pub extra: serde_json::Map<String, serde_json::Value>,
22481}
22482
22483/// A category for resources, such as rooms or vehicles. A campus is an organizational location in ChurchTools; `campusId` is optional.
22484#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22485pub struct ResourceTypeCreate {
22486    /// Associated campus, or null for no campus assignment.
22487    ///
22488    /// `None` leaves the field out, `Some(None)` sends `null`.
22489    #[serde(rename = "campusId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22490    pub campus_id: Option<Option<i64>>,
22491    /// Singular label for one resource of this type.
22492    #[serde(deserialize_with = "crate::lenient::string")]
22493    pub name: String,
22494    /// Plural label for resources of this type.
22495    #[serde(rename = "namePlural", deserialize_with = "crate::lenient::string")]
22496    pub name_plural: String,
22497    /// Sort value for displaying resource types.
22498    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
22499    pub sort_key: i64,
22500    /// Fields not described by the spec, e.g. instance-specific DB fields.
22501    #[serde(flatten)]
22502    pub extra: serde_json::Map<String, serde_json::Value>,
22503}
22504
22505/// Complete resource-type input. The resource type ID is supplied in the path.
22506#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22507pub struct ResourceTypeUpdate {
22508    /// Associated campus, or null for no campus assignment.
22509    ///
22510    /// `None` leaves the field out, `Some(None)` sends `null`.
22511    #[serde(rename = "campusId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22512    pub campus_id: Option<Option<i64>>,
22513    /// Singular label for one resource of this type.
22514    #[serde(deserialize_with = "crate::lenient::string")]
22515    pub name: String,
22516    /// Plural label for resources of this type.
22517    #[serde(rename = "namePlural", deserialize_with = "crate::lenient::string")]
22518    pub name_plural: String,
22519    /// Sort value for displaying resource types.
22520    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
22521    pub sort_key: i64,
22522    /// Fields not described by the spec, e.g. instance-specific DB fields.
22523    #[serde(flatten)]
22524    pub extra: serde_json::Map<String, serde_json::Value>,
22525}
22526
22527/// Complete resource configuration. The resource ID is supplied in the path.
22528#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22529pub struct ResourceUpdate {
22530    /// Persons responsible for this resource. Resource administrators can view and administer its bookings; changing resource settings still requires permission to edit resource master data.
22531    #[serde(rename = "adminIds", default, skip_serializing_if = "Option::is_none")]
22532    pub admin_ids: Option<Vec<i64>>,
22533    /// Additional information about the resource, such as capacity or available equipment.
22534    ///
22535    /// `None` leaves the field out, `Some(None)` sends `null`.
22536    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22537    pub description: Option<Option<String>>,
22538    /// Location text used in the resource’s iCalendar export.
22539    ///
22540    /// `None` leaves the field out, `Some(None)` sends `null`.
22541    #[serde(rename = "iCalLocation", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22542    pub i_cal_location: Option<Option<String>>,
22543    /// 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.
22544    #[serde(rename = "isAutoAccept", default, skip_serializing_if = "Option::is_none")]
22545    pub is_auto_accept: Option<bool>,
22546    /// Whether this is a virtual resource. Virtual bookings have a separate creation permission and bypass conflicts when checking automatic approval.
22547    #[serde(rename = "isVirtual", default, skip_serializing_if = "Option::is_none")]
22548    pub is_virtual: Option<bool>,
22549    /// Internal location of the resource.
22550    ///
22551    /// `None` leaves the field out, `Some(None)` sends `null`.
22552    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22553    pub location: Option<Option<String>>,
22554    /// Name of the individual resource, for example a room or vehicle.
22555    #[serde(deserialize_with = "crate::lenient::string")]
22556    pub name: String,
22557    /// Number of units available for simultaneous bookings.
22558    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22559    pub quantity: Option<i64>,
22560    /// Access token used by the legacy public iCalendar export. Changing or clearing it invalidates subscriptions using the previous token.
22561    ///
22562    /// `None` leaves the field out, `Some(None)` sends `null`.
22563    #[serde(rename = "randomString", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22564    pub random_string: Option<Option<String>>,
22565    /// Resource type used to group this resource, such as rooms or vehicles. Resource types are available from `/resourcetypes`.
22566    #[serde(rename = "resourceTypeId", deserialize_with = "crate::lenient::number")]
22567    pub resource_type_id: i64,
22568    /// Sort value for displaying resources.
22569    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
22570    pub sort_key: i64,
22571    /// 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.
22572    #[serde(rename = "needsAppointment", default, skip_serializing_if = "Option::is_none")]
22573    pub needs_appointment: Option<bool>,
22574    /// Fields not described by the spec, e.g. instance-specific DB fields.
22575    #[serde(flatten)]
22576    pub extra: serde_json::Map<String, serde_json::Value>,
22577}
22578
22579/// 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.
22580#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22581pub struct Role {
22582    /// ID of the group type this role belongs to. Discover group types with GET /group/grouptypes.
22583    #[serde(rename = "groupTypeId", deserialize_with = "crate::lenient::number")]
22584    pub group_type_id: i64,
22585    /// 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.
22586    #[serde(rename = "growPathId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22587    pub grow_path_id: Option<i64>,
22588    /// 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.
22589    #[serde(rename = "isDefault")]
22590    pub is_default: bool,
22591    /// 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.
22592    #[serde(rename = "isHidden")]
22593    pub is_hidden: bool,
22594    /// Legacy response field indicating whether type is leader. Use type instead; this field is not used to create or update a role.
22595    #[serde(rename = "isLeader", default, skip_serializing_if = "Option::is_none")]
22596    #[deprecated = "Use type instead; this field is not used to create or update a role."]
22597    pub is_leader: Option<bool>,
22598    /// Stored name of the role. Use nameTranslated from the response for a localized display name.
22599    #[serde(deserialize_with = "crate::lenient::string")]
22600    pub name: String,
22601    /// Abbreviated label for the role, used in compact displays.
22602    #[serde(deserialize_with = "crate::lenient::string")]
22603    pub shorty: String,
22604    /// Display order among roles. Lower values come first.
22605    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
22606    pub sort_key: i64,
22607    /// Functional classification of the role. Multiple roles with different names can share the same classification.
22608    /// Allowed values: `leader`, `participant`.
22609    #[serde(deserialize_with = "crate::lenient::string")]
22610    pub r#type: String,
22611    /// ID of this role record. For Role this identifies the group-type definition; for GroupRole it identifies the settings record for a specific group.
22612    #[serde(deserialize_with = "crate::lenient::number")]
22613    pub id: i64,
22614    /// Localized display name, translated from the stored name when a translation exists.
22615    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
22616    pub name_translated: String,
22617    /// Fields not described by the spec, e.g. instance-specific DB fields.
22618    #[serde(flatten)]
22619    pub extra: serde_json::Map<String, serde_json::Value>,
22620}
22621
22622#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22623pub struct RoleCreate {
22624    /// ID of the group type this role belongs to. Discover group types with GET /group/grouptypes.
22625    #[serde(rename = "groupTypeId", deserialize_with = "crate::lenient::number")]
22626    pub group_type_id: i64,
22627    /// 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.
22628    #[serde(rename = "growPathId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22629    pub grow_path_id: Option<i64>,
22630    /// 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.
22631    #[serde(rename = "isDefault")]
22632    pub is_default: bool,
22633    /// 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.
22634    #[serde(rename = "isHidden")]
22635    pub is_hidden: bool,
22636    /// Legacy response field indicating whether type is leader. Use type instead; this field is not used to create or update a role.
22637    #[serde(rename = "isLeader", default, skip_serializing_if = "Option::is_none")]
22638    #[deprecated = "Use type instead; this field is not used to create or update a role."]
22639    pub is_leader: Option<bool>,
22640    /// Stored name of the role. Use nameTranslated from the response for a localized display name.
22641    #[serde(deserialize_with = "crate::lenient::string")]
22642    pub name: String,
22643    /// Abbreviated label for the role, used in compact displays.
22644    #[serde(deserialize_with = "crate::lenient::string")]
22645    pub shorty: String,
22646    /// Display order among roles. Lower values come first.
22647    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
22648    pub sort_key: i64,
22649    /// Functional classification of the role. Multiple roles with different names can share the same classification.
22650    /// Allowed values: `leader`, `participant`.
22651    #[serde(deserialize_with = "crate::lenient::string")]
22652    pub r#type: String,
22653    /// Fields not described by the spec, e.g. instance-specific DB fields.
22654    #[serde(flatten)]
22655    pub extra: serde_json::Map<String, serde_json::Value>,
22656}
22657
22658/// Personal setting containing the secret used by a roster calendar subscription.
22659#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22660pub struct RosterICalSetting {
22661    /// Allowed values: `rosterICalSecret`.
22662    #[serde(deserialize_with = "crate::lenient::string")]
22663    pub attribute: String,
22664    /// Allowed values: `churchservice`.
22665    #[serde(deserialize_with = "crate::lenient::string")]
22666    pub module: String,
22667    /// Secret identifying the person in the subscription URL. Creating a new roster link replaces this value.
22668    #[serde(deserialize_with = "crate::lenient::string")]
22669    pub value: String,
22670    /// Fields not described by the spec, e.g. instance-specific DB fields.
22671    #[serde(flatten)]
22672    pub extra: serde_json::Map<String, serde_json::Value>,
22673}
22674
22675/// Automation definition, including enabled and disabled steps as a nested tree. Domain context bindings and per-membership execution progress are separate resources.
22676#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22677pub struct Routine {
22678    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22679    pub description: Option<String>,
22680    /// Allowed values: `group_membership`.
22681    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
22682    pub domain_type: String,
22683    #[serde(deserialize_with = "crate::lenient::number")]
22684    pub id: i64,
22685    #[serde(rename = "isEnabled")]
22686    pub is_enabled: bool,
22687    #[serde(deserialize_with = "crate::lenient::string")]
22688    pub name: String,
22689    #[serde(deserialize_with = "crate::lenient::number")]
22690    pub priority: i64,
22691    /// Root steps in sort order, with children nested on their parent steps. Empty child arrays are omitted by the serializer.
22692    pub steps: Vec<serde_json::Value>,
22693    /// Fields not described by the spec, e.g. instance-specific DB fields.
22694    #[serde(flatten)]
22695    pub extra: serde_json::Map<String, serde_json::Value>,
22696}
22697
22698#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22699pub struct RoutineActionValidation {
22700    /// Action-specific data. Omission defaults to an empty PHP array.
22701    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
22702    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
22703    /// Registered action key, or special:wait / special:repeat.
22704    #[serde(rename = "actionKey", deserialize_with = "crate::lenient::string")]
22705    pub action_key: String,
22706    /// Fields not described by the spec, e.g. instance-specific DB fields.
22707    #[serde(flatten)]
22708    pub extra: serde_json::Map<String, serde_json::Value>,
22709}
22710
22711#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22712pub struct RoutineCreate {
22713    /// `None` leaves the field out, `Some(None)` sends `null`.
22714    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22715    pub description: Option<Option<String>>,
22716    /// Context for the currently supported group_membership domain. Group and role IDs are required by the domain handler.
22717    #[serde(rename = "domainContext")]
22718    pub domain_context: RoutineCreateDomainContext,
22719    /// Allowed values: `group_membership`.
22720    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
22721    pub domain_type: String,
22722    #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")]
22723    pub is_enabled: Option<bool>,
22724    /// Trimmed automation name.
22725    #[serde(deserialize_with = "crate::lenient::string")]
22726    pub name: String,
22727    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22728    pub priority: Option<i64>,
22729    /// Fields not described by the spec, e.g. instance-specific DB fields.
22730    #[serde(flatten)]
22731    pub extra: serde_json::Map<String, serde_json::Value>,
22732}
22733
22734/// Context for the currently supported group_membership domain. Group and role IDs are required by the domain handler.
22735#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22736pub struct RoutineCreateDomainContext {
22737    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
22738    pub group_id: i64,
22739    /// Optional membership status for the binding; null means the active/default status representation.
22740    /// Allowed values: `active`, `requested`, `to_delete`, `waiting`.
22741    ///
22742    /// `None` leaves the field out, `Some(None)` sends `null`.
22743    #[serde(rename = "groupMemberStatus", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22744    pub group_member_status: Option<Option<String>>,
22745    #[serde(rename = "groupTypeRoleId", deserialize_with = "crate::lenient::number")]
22746    pub group_type_role_id: i64,
22747    /// Fields not described by the spec, e.g. instance-specific DB fields.
22748    #[serde(flatten)]
22749    pub extra: serde_json::Map<String, serde_json::Value>,
22750}
22751
22752#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22753pub struct RoutineRun {
22754    /// Current iteration while in a loop, otherwise this attribute is undefined
22755    #[serde(rename = "currentIteration", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22756    pub current_iteration: Option<i64>,
22757    /// Group membership ID, not a person or group ID.
22758    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
22759    pub domain_id: i64,
22760    /// Only present with include\[\]=domainObject; null when resolution fails.
22761    #[serde(rename = "domainObject", default, skip_serializing_if = "Option::is_none")]
22762    pub domain_object: Option<DomainObjectGroupMembership>,
22763    /// Allowed values: `group_membership`.
22764    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
22765    pub domain_type: String,
22766    /// Allowed values: `exception-thrown`, `invalid-step-id`, `loop-detected`.
22767    #[serde(rename = "errorCode", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22768    pub error_code: Option<String>,
22769    /// Can be either an error message or an translatable messageKey
22770    #[serde(rename = "errorMessage", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22771    pub error_message: Option<String>,
22772    /// Persisted run ID, or null for an unpersisted potential run.
22773    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22774    pub id: Option<i64>,
22775    #[serde(default, skip_serializing_if = "Option::is_none")]
22776    pub meta: Option<MetaDataEntityId>,
22777    #[serde(rename = "routineId", deserialize_with = "crate::lenient::number")]
22778    pub routine_id: i64,
22779    #[serde(rename = "routineStepId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22780    pub routine_step_id: Option<i64>,
22781    /// Allowed values: `failed`, `finished`, `not-started`, `paused`, `rerun-step`, `started`, `waiting`.
22782    #[serde(deserialize_with = "crate::lenient::string")]
22783    pub status: String,
22784    /// A simple date in ISO format, e.g. '2022-10-19'
22785    #[serde(rename = "waitingSince", default, skip_serializing_if = "Option::is_none")]
22786    pub waiting_since: Option<chrono::NaiveDate>,
22787    /// Fields not described by the spec, e.g. instance-specific DB fields.
22788    #[serde(flatten)]
22789    pub extra: serde_json::Map<String, serde_json::Value>,
22790}
22791
22792#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22793pub struct RoutineRunBulkUpdate {
22794    /// Run IDs processed sequentially. Duplicates are not rejected.
22795    #[serde(rename = "runIds")]
22796    pub run_ids: Vec<i64>,
22797    /// Fields not described by the spec, e.g. instance-specific DB fields.
22798    #[serde(flatten)]
22799    pub extra: serde_json::Map<String, serde_json::Value>,
22800}
22801
22802/// Only read for the update action. At most one state field can be supplied; an empty object is accepted.
22803#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22804pub struct RoutineRunUpdate {
22805    /// Update the current iteration for a special:repeat step
22806    #[serde(rename = "currentIteration", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22807    pub current_iteration: Option<i64>,
22808    /// Update the waiting since date for a special:wait step
22809    #[serde(rename = "waitingSince", default, skip_serializing_if = "Option::is_none")]
22810    pub waiting_since: Option<chrono::NaiveDate>,
22811    /// Fields not described by the spec, e.g. instance-specific DB fields.
22812    #[serde(flatten)]
22813    pub extra: serde_json::Map<String, serde_json::Value>,
22814}
22815
22816/// Persisted repeat step. Unlike the create payload, an empty children list is omitted in responses.
22817#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22818pub struct RoutineStepRepeat {
22819    #[serde(deserialize_with = "crate::lenient::number")]
22820    pub id: i64,
22821    #[serde(rename = "routineId", deserialize_with = "crate::lenient::number")]
22822    pub routine_id: i64,
22823    #[serde(rename = "actionData")]
22824    pub action_data: RoutineStepRepeatActionData,
22825    /// Allowed values: `special:repeat`.
22826    #[serde(rename = "actionKey", deserialize_with = "crate::lenient::string")]
22827    pub action_key: String,
22828    /// Child steps when present. Omitted for an empty repeat step.
22829    #[serde(default, skip_serializing_if = "Option::is_none")]
22830    pub children: Option<Vec<RoutineStepWithoutRepeat>>,
22831    #[serde(rename = "isEnabled")]
22832    pub is_enabled: bool,
22833    /// Fields not described by the spec, e.g. instance-specific DB fields.
22834    #[serde(flatten)]
22835    pub extra: serde_json::Map<String, serde_json::Value>,
22836}
22837
22838#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22839pub struct RoutineStepRepeatActionData {
22840    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22841    pub count: Option<i64>,
22842    /// Fields not described by the spec, e.g. instance-specific DB fields.
22843    #[serde(flatten)]
22844    pub extra: serde_json::Map<String, serde_json::Value>,
22845}
22846
22847#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22848pub struct RoutineStepUpdateRepeat {
22849    #[serde(rename = "actionData")]
22850    pub action_data: RoutineStepRepeatActionData,
22851    /// Allowed values: `special:repeat`.
22852    #[serde(rename = "actionKey", deserialize_with = "crate::lenient::string")]
22853    pub action_key: String,
22854    pub children: Vec<RoutineStepUpdateWithoutRepeat>,
22855    /// Allowed values: `finished`, `not-started`, `started`.
22856    #[serde(default, skip_serializing_if = "Option::is_none")]
22857    pub finish: Option<Vec<serde_json::Value>>,
22858    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22859    pub id: Option<i64>,
22860    #[serde(rename = "isEnabled")]
22861    pub is_enabled: bool,
22862    /// Allowed values: `finished`, `not-started`, `started`.
22863    #[serde(default, skip_serializing_if = "Option::is_none")]
22864    pub reposition: Option<Vec<serde_json::Value>>,
22865    /// Allowed values: `finished`, `not-started`, `started`.
22866    #[serde(default, skip_serializing_if = "Option::is_none")]
22867    pub restart: Option<Vec<serde_json::Value>>,
22868    /// Fields not described by the spec, e.g. instance-specific DB fields.
22869    #[serde(flatten)]
22870    pub extra: serde_json::Map<String, serde_json::Value>,
22871}
22872
22873#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22874pub struct RoutineStepUpdateWithoutRepeat {
22875    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22876    pub id: Option<i64>,
22877    /// Allowed values: `finished`, `not-started`, `started`.
22878    #[serde(default, skip_serializing_if = "Option::is_none")]
22879    pub reposition: Option<Vec<serde_json::Value>>,
22880    /// Fields not described by the spec, e.g. instance-specific DB fields.
22881    #[serde(flatten)]
22882    pub extra: serde_json::Map<String, serde_json::Value>,
22883}
22884
22885#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22886pub struct RoutineStepWithoutRepeat {
22887    #[serde(deserialize_with = "crate::lenient::number")]
22888    pub id: i64,
22889    #[serde(rename = "routineId", deserialize_with = "crate::lenient::number")]
22890    pub routine_id: i64,
22891    /// Fields not described by the spec, e.g. instance-specific DB fields.
22892    #[serde(flatten)]
22893    pub extra: serde_json::Map<String, serde_json::Value>,
22894}
22895
22896#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22897pub struct RoutineUpdate {
22898    /// `None` leaves the field out, `Some(None)` sends `null`.
22899    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22900    pub description: Option<Option<String>>,
22901    /// Source step IDs or run status buckets. not-started materializes potential runs; this is not a list of run IDs.
22902    /// Allowed values: `finished`, `not-started`, `started`.
22903    #[serde(default, skip_serializing_if = "Option::is_none")]
22904    pub finish: Option<Vec<serde_json::Value>>,
22905    #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")]
22906    pub is_enabled: Option<bool>,
22907    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22908    pub name: Option<String>,
22909    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22910    pub priority: Option<i64>,
22911    /// Source step IDs or run status buckets. not-started materializes potential runs; this is not a list of run IDs.
22912    /// Allowed values: `finished`, `not-started`, `started`.
22913    #[serde(default, skip_serializing_if = "Option::is_none")]
22914    pub restart: Option<Vec<serde_json::Value>>,
22915    /// Complete replacement tree; omitted existing steps are removed.
22916    #[serde(default, skip_serializing_if = "Option::is_none")]
22917    pub steps: Option<Vec<serde_json::Value>>,
22918    /// Fields not described by the spec, e.g. instance-specific DB fields.
22919    #[serde(flatten)]
22920    pub extra: serde_json::Map<String, serde_json::Value>,
22921}
22922
22923#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22924pub struct RssFeed {
22925    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22926    pub description: Option<String>,
22927    pub items: Vec<BlogItem>,
22928    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22929    pub link: Option<String>,
22930    #[serde(deserialize_with = "crate::lenient::string")]
22931    pub title: String,
22932    #[serde(rename = "totalCount", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22933    pub total_count: Option<i64>,
22934    /// Fields not described by the spec, e.g. instance-specific DB fields.
22935    #[serde(flatten)]
22936    pub extra: serde_json::Map<String, serde_json::Value>,
22937}
22938
22939/// One usable IdP descriptor found in the uploaded document. This is parsed configuration data, not proof of metadata authenticity or a working login.
22940#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22941pub struct SamlIdpMetadataDescriptor {
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 = "encryptionCertificates")]
22944    pub encryption_certificates: Vec<String>,
22945    /// Nonempty entityID from the EntityDescriptor.
22946    #[serde(rename = "entityId", deserialize_with = "crate::lenient::string")]
22947    pub entity_id: String,
22948    /// 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.
22949    #[serde(rename = "signingCertificates")]
22950    pub signing_certificates: Vec<String>,
22951    /// Optional supported SLO endpoints. May be empty.
22952    #[serde(rename = "singleLogoutServices")]
22953    pub single_logout_services: Vec<SamlMetadataEndpoint>,
22954    /// Supported SSO endpoints. Descriptors without any usable SSO endpoint are skipped.
22955    #[serde(rename = "singleSignOnServices")]
22956    pub single_sign_on_services: Vec<SamlMetadataEndpoint>,
22957    /// Fields not described by the spec, e.g. instance-specific DB fields.
22958    #[serde(flatten)]
22959    pub extra: serde_json::Map<String, serde_json::Value>,
22960}
22961
22962/// An endpoint using the supported HTTP-Redirect binding. Unsupported bindings and invalid endpoint URLs are excluded.
22963#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22964pub struct SamlMetadataEndpoint {
22965    /// Allowed values: `urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect`.
22966    #[serde(deserialize_with = "crate::lenient::string")]
22967    pub binding: String,
22968    #[serde(deserialize_with = "crate::lenient::string")]
22969    pub url: String,
22970    /// Fields not described by the spec, e.g. instance-specific DB fields.
22971    #[serde(flatten)]
22972    pub extra: serde_json::Map<String, serde_json::Value>,
22973}
22974
22975/// Read-only request to parse a SAML IdP metadata document. The server never fetches a metadata URL for this operation.
22976#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22977pub struct SamlMetadataParseCreate {
22978    /// 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.
22979    #[serde(deserialize_with = "crate::lenient::string")]
22980    pub xml: String,
22981    /// Fields not described by the spec, e.g. instance-specific DB fields.
22982    #[serde(flatten)]
22983    pub extra: serde_json::Map<String, serde_json::Value>,
22984}
22985
22986#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22987pub struct SecurityLevel {
22988    #[serde(deserialize_with = "crate::lenient::number")]
22989    pub id: i64,
22990    #[serde(deserialize_with = "crate::lenient::string")]
22991    pub name: String,
22992    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
22993    pub sort_key: i64,
22994    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22995    #[deprecated = "deprecated in the ChurchTools API"]
22996    pub sortkey: Option<i64>,
22997    /// Fields not described by the spec, e.g. instance-specific DB fields.
22998    #[serde(flatten)]
22999    pub extra: serde_json::Map<String, serde_json::Value>,
23000}
23001
23002/// 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.
23003#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23004pub struct Service {
23005    #[serde(rename = "@deprecated", deserialize_with = "crate::lenient::map")]
23006    pub deprecated: std::collections::BTreeMap<String, String>,
23007    /// Enable chat for this service.
23008    #[serde(rename = "allowChat")]
23009    pub allow_chat: bool,
23010    /// Allow a comment when confirming a service request.
23011    #[serde(rename = "allowCommentOnConfirmation")]
23012    pub allow_comment_on_confirmation: bool,
23013    /// Allow persons assigned to this service to control the live agenda.
23014    #[serde(rename = "allowControlLiveAgenda")]
23015    pub allow_control_live_agenda: bool,
23016    /// Allow assigned persons to decline service requests.
23017    #[serde(rename = "allowDecline")]
23018    pub allow_decline: bool,
23019    /// Allow assigned persons to request an exchange of their service assignment.
23020    #[serde(rename = "allowExchange")]
23021    pub allow_exchange: bool,
23022    /// Template for the calendar text of this service.
23023    #[serde(rename = "calTextTemplate", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23024    pub cal_text_template: Option<String>,
23025    /// Use `description` instead.
23026    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23027    #[deprecated = "Use `description` instead."]
23028    pub comment: Option<String>,
23029    /// use `allowCommentOnConfirmation` instead
23030    #[serde(rename = "commentOnConfirmation", default, skip_serializing_if = "Option::is_none")]
23031    #[deprecated = "deprecated in the ChurchTools API"]
23032    pub comment_on_confirmation: Option<bool>,
23033    /// Description of the role.
23034    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23035    pub description: Option<String>,
23036    /// IDs of connected person groups used for service planning.
23037    #[serde(rename = "groupIds")]
23038    pub group_ids: Vec<i64>,
23039    /// Hide assigned persons from viewers without the service or service-group permissions needed to see them.
23040    #[serde(rename = "hidePersonName")]
23041    pub hide_person_name: bool,
23042    #[serde(deserialize_with = "crate::lenient::number")]
23043    pub id: i64,
23044    pub meta: MetaDataEntityId,
23045    /// 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.
23046    #[serde(deserialize_with = "crate::lenient::string")]
23047    pub name: String,
23048    /// Name translated for the current language; falls back to the stored name.
23049    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
23050    pub name_translated: String,
23051    /// Restrict assignment candidates to the connected person groups.
23052    #[serde(rename = "onlyAssignFromGroups")]
23053    pub only_assign_from_groups: bool,
23054    /// Enable reminder emails for service assignments.
23055    #[serde(rename = "sendReminderMails")]
23056    pub send_reminder_mails: bool,
23057    /// Enable emails for service requests.
23058    #[serde(rename = "sendServiceRequestEmails")]
23059    pub send_service_request_emails: bool,
23060    /// ID of the existing service group that organizes this role, for example Music or Technical team. This is not a person group.
23061    #[serde(rename = "serviceGroupId", deserialize_with = "crate::lenient::number")]
23062    pub service_group_id: i64,
23063    /// Display order. Lists are sorted by `sortKey` and then name, both ascending.
23064    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
23065    pub sort_key: i64,
23066    /// Whether this service is marked as a standard service for event planning.
23067    pub standard: bool,
23068    /// IDs of connected tags used for service planning.
23069    #[serde(rename = "tagIds")]
23070    pub tag_ids: Vec<i64>,
23071    /// Fields not described by the spec, e.g. instance-specific DB fields.
23072    #[serde(flatten)]
23073    pub extra: serde_json::Map<String, serde_json::Value>,
23074}
23075
23076#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23077pub struct ServiceCandidate {
23078    /// Person’s full name.
23079    #[serde(rename = "fullName", deserialize_with = "crate::lenient::string")]
23080    pub full_name: String,
23081    /// ID of the person.
23082    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
23083    pub person_id: i64,
23084    /// Fields not described by the spec, e.g. instance-specific DB fields.
23085    #[serde(flatten)]
23086    pub extra: serde_json::Map<String, serde_json::Value>,
23087}
23088
23089#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23090pub struct ServiceCandidateAssignment {
23091    /// Event as Domain Object
23092    pub event: DomainObjectEvent,
23093    /// Concrete assignment record. Serialized directly here, so comment is always `null` even when a comment is stored.
23094    #[serde(rename = "eventService")]
23095    pub event_service: ServiceCandidateAssignmentEventService,
23096    /// Fields not described by the spec, e.g. instance-specific DB fields.
23097    #[serde(flatten)]
23098    pub extra: serde_json::Map<String, serde_json::Value>,
23099}
23100
23101/// Concrete assignment record. Serialized directly here, so comment is always `null` even when a comment is stored.
23102#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23103pub struct ServiceCandidateAssignmentEventService {
23104    #[serde(rename = "@deprecated", deserialize_with = "crate::lenient::map")]
23105    pub deprecated: std::collections::BTreeMap<String, String>,
23106    /// Use `isAccepted` instead
23107    #[serde(default, skip_serializing_if = "Option::is_none")]
23108    #[deprecated = "Use `isAccepted` instead"]
23109    pub agreed: Option<bool>,
23110    #[serde(rename = "allowChat")]
23111    pub allow_chat: bool,
23112    /// Confirmation or decline comment. Null when absent or hidden by permissions.
23113    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23114    pub comment: Option<String>,
23115    /// Use `index` instead
23116    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23117    #[deprecated = "Use `index` instead"]
23118    pub counter: Option<i64>,
23119    pub event: ServiceRequestEvent,
23120    /// ID of this particular assignment record. Updating or answering a request may create a new record; use the ID returned by the operation.
23121    #[serde(deserialize_with = "crate::lenient::number")]
23122    pub id: i64,
23123    /// Slot index when an event requires several persons for the same service; null if no index is assigned.
23124    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23125    pub index: Option<i64>,
23126    /// Whether this record was confirmed. Interpret together with isValid, as an older confirmed record can be invalid.
23127    #[serde(rename = "isAccepted")]
23128    pub is_accepted: bool,
23129    /// Whether this record is still the active assignment for its slot. Superseded and declined records are invalid.
23130    #[serde(rename = "isValid")]
23131    pub is_valid: bool,
23132    pub meta: MetaDataEntityId,
23133    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23134    pub name: Option<String>,
23135    /// Optional computed assignment permissions. These request endpoints do not populate them and normally return null.
23136    #[serde(default, skip_serializing_if = "Option::is_none")]
23137    pub permissions: Option<ServiceRequestPermissions>,
23138    #[serde(default, skip_serializing_if = "Option::is_none")]
23139    pub person: Option<DomainObjectPerson>,
23140    #[serde(rename = "personId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23141    #[deprecated = "deprecated in the ChurchTools API"]
23142    pub person_id: Option<i64>,
23143    /// Deprecated alias for `meta.modifiedDate`.
23144    #[serde(rename = "requestedDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
23145    #[deprecated = "deprecated in the ChurchTools API"]
23146    pub requested_date: Option<chrono::DateTime<chrono::Utc>>,
23147    /// Person as Domain Object
23148    #[serde(rename = "requesterPerson")]
23149    pub requester_person: DomainObjectPerson,
23150    #[serde(rename = "requesterPersonId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23151    #[deprecated = "deprecated in the ChurchTools API"]
23152    pub requester_person_id: Option<i64>,
23153    /// ID of the reusable service role from /services, not the request ID.
23154    #[serde(rename = "serviceId", deserialize_with = "crate::lenient::number")]
23155    pub service_id: i64,
23156    #[serde(rename = "serviceName", deserialize_with = "crate::lenient::string")]
23157    pub service_name: String,
23158    /// Fields not described by the spec, e.g. instance-specific DB fields.
23159    #[serde(flatten)]
23160    pub extra: serde_json::Map<String, serde_json::Value>,
23161}
23162
23163#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23164pub struct ServiceCandidateScoreHint {
23165    /// Human-readable explanation in the current language.
23166    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
23167    pub name_translated: String,
23168    /// 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.
23169    /// 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`.
23170    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
23171    pub reason: serde_json::Value,
23172    /// Contribution to the total score; positive values favor the candidate and negative values penalize it.
23173    #[serde(deserialize_with = "crate::lenient::number")]
23174    pub score: i64,
23175    /// Fields not described by the spec, e.g. instance-specific DB fields.
23176    #[serde(flatten)]
23177    pub extra: serde_json::Map<String, serde_json::Value>,
23178}
23179
23180/// Fields for creating a reusable service role. Free-text fields are not restricted to predefined values.
23181#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23182pub struct ServiceCreate {
23183    /// Enable chat for this service.
23184    #[serde(rename = "allowChat", default, skip_serializing_if = "Option::is_none")]
23185    pub allow_chat: Option<bool>,
23186    /// Allow a comment when confirming a service request.
23187    #[serde(rename = "allowCommentOnConfirmation", default, skip_serializing_if = "Option::is_none")]
23188    pub allow_comment_on_confirmation: Option<bool>,
23189    /// Allow persons assigned to this service to control the live agenda.
23190    #[serde(rename = "allowControlLiveAgenda", default, skip_serializing_if = "Option::is_none")]
23191    pub allow_control_live_agenda: Option<bool>,
23192    /// Allow assigned persons to decline service requests.
23193    #[serde(rename = "allowDecline", default, skip_serializing_if = "Option::is_none")]
23194    pub allow_decline: Option<bool>,
23195    /// Allow assigned persons to request an exchange of their service assignment.
23196    #[serde(rename = "allowExchange", default, skip_serializing_if = "Option::is_none")]
23197    pub allow_exchange: Option<bool>,
23198    /// Template for the calendar text of this service.
23199    ///
23200    /// `None` leaves the field out, `Some(None)` sends `null`.
23201    #[serde(rename = "calTextTemplate", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23202    pub cal_text_template: Option<Option<String>>,
23203    /// Deprecated input alias for description. Use description for new integrations.
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    #[deprecated = "Use description for new integrations."]
23208    pub comment: Option<Option<String>>,
23209    /// Description of the role.
23210    ///
23211    /// `None` leaves the field out, `Some(None)` sends `null`.
23212    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23213    pub description: Option<Option<String>>,
23214    /// IDs of connected person groups used for service planning. Nonexistent IDs are silently removed. Duplicates are retained. An empty list clears the connections.
23215    #[serde(rename = "groupIds", default, skip_serializing_if = "Option::is_none")]
23216    pub group_ids: Option<Vec<i64>>,
23217    /// Hide assigned persons from viewers without the service or service-group permissions needed to see them.
23218    #[serde(rename = "hidePersonName", default, skip_serializing_if = "Option::is_none")]
23219    pub hide_person_name: Option<bool>,
23220    /// 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.
23221    #[serde(deserialize_with = "crate::lenient::string")]
23222    pub name: String,
23223    /// Restrict assignment candidates to the connected person groups.
23224    #[serde(rename = "onlyAssignFromGroups", default, skip_serializing_if = "Option::is_none")]
23225    pub only_assign_from_groups: Option<bool>,
23226    /// Enable reminder emails for service assignments.
23227    #[serde(rename = "sendReminderMails", default, skip_serializing_if = "Option::is_none")]
23228    pub send_reminder_mails: Option<bool>,
23229    /// Enable emails for service requests.
23230    #[serde(rename = "sendServiceRequestEmails", default, skip_serializing_if = "Option::is_none")]
23231    pub send_service_request_emails: Option<bool>,
23232    /// ID of the existing service group that organizes this role, for example Music or Technical team. This is not a person group.
23233    #[serde(rename = "serviceGroupId", deserialize_with = "crate::lenient::number")]
23234    pub service_group_id: i64,
23235    /// Display order. Lists are sorted by `sortKey` and then name, both ascending.
23236    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23237    pub sort_key: Option<i64>,
23238    /// Whether this service is marked as a standard service for event planning.
23239    #[serde(default, skip_serializing_if = "Option::is_none")]
23240    pub standard: Option<bool>,
23241    /// IDs of connected tags used for service planning. Nonexistent IDs are silently removed. Duplicates are retained. An empty list clears the connections.
23242    #[serde(rename = "tagIds", default, skip_serializing_if = "Option::is_none")]
23243    pub tag_ids: Option<Vec<i64>>,
23244    /// Fields not described by the spec, e.g. instance-specific DB fields.
23245    #[serde(flatten)]
23246    pub extra: serde_json::Map<String, serde_json::Value>,
23247}
23248
23249#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23250pub struct ServiceExchangeCandidate {
23251    /// Start of the candidate event.
23252    #[serde(rename = "eventDate", serialize_with = "crate::datetime::serialize_utc")]
23253    pub event_date: chrono::DateTime<chrono::Utc>,
23254    /// ID of a concrete event-service assignment (service request), not the reusable service master-data ID from /services.
23255    #[serde(rename = "eventServiceId", deserialize_with = "crate::lenient::number")]
23256    pub event_service_id: i64,
23257    /// Title of the calendar appointment associated with the candidate event.
23258    #[serde(rename = "eventTitle", deserialize_with = "crate::lenient::string")]
23259    pub event_title: String,
23260    /// 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.
23261    pub person: ServiceExchangePerson,
23262    /// Fields not described by the spec, e.g. instance-specific DB fields.
23263    #[serde(flatten)]
23264    pub extra: serde_json::Map<String, serde_json::Value>,
23265}
23266
23267#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23268pub struct ServiceExchangeEvent {
23269    /// ID of the event.
23270    #[serde(deserialize_with = "crate::lenient::number")]
23271    pub id: i64,
23272    /// Event name.
23273    #[serde(deserialize_with = "crate::lenient::string")]
23274    pub name: String,
23275    #[serde(rename = "startDate", serialize_with = "crate::datetime::serialize_utc")]
23276    pub start_date: chrono::DateTime<chrono::Utc>,
23277    /// Fields not described by the spec, e.g. instance-specific DB fields.
23278    #[serde(flatten)]
23279    pub extra: serde_json::Map<String, serde_json::Value>,
23280}
23281
23282/// 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.
23283#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23284pub struct ServiceExchangePerson {
23285    #[serde(rename = "firstName", deserialize_with = "crate::lenient::string")]
23286    pub first_name: String,
23287    /// Person GUID, if available.
23288    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23289    pub guid: Option<String>,
23290    /// ID of the person.
23291    #[serde(deserialize_with = "crate::lenient::number")]
23292    pub id: i64,
23293    /// Avatar URL, if available.
23294    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23295    pub image_url: Option<String>,
23296    #[serde(rename = "isArchived")]
23297    pub is_archived: bool,
23298    #[serde(rename = "lastName", deserialize_with = "crate::lenient::string")]
23299    pub last_name: String,
23300    /// Fields not described by the spec, e.g. instance-specific DB fields.
23301    #[serde(flatten)]
23302    pub extra: serde_json::Map<String, serde_json::Value>,
23303}
23304
23305/// 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`.
23306#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23307pub struct ServiceExchangeRequest {
23308    /// ID of the exchange request.
23309    #[serde(deserialize_with = "crate::lenient::number")]
23310    pub id: i64,
23311    /// Whether this exchange is archived. Person-level lists exclude archived exchanges; the assignment-level list does not.
23312    #[serde(rename = "isArchived")]
23313    pub is_archived: bool,
23314    pub meta: ServiceExchangeRequestMeta,
23315    #[serde(rename = "requestedEvent", default, skip_serializing_if = "Option::is_none")]
23316    pub requested_event: Option<ServiceExchangeEvent>,
23317    #[serde(rename = "requestedPerson", default, skip_serializing_if = "Option::is_none")]
23318    pub requested_person: Option<ServiceExchangePerson>,
23319    /// Assignment requested in return. ID of a concrete event-service assignment (service request), not the reusable service master-data ID from /services.
23320    #[serde(rename = "requestedServiceId", deserialize_with = "crate::lenient::number")]
23321    pub requested_service_id: i64,
23322    #[serde(rename = "requestingEvent", default, skip_serializing_if = "Option::is_none")]
23323    pub requesting_event: Option<ServiceExchangeEvent>,
23324    #[serde(rename = "requestingPerson", default, skip_serializing_if = "Option::is_none")]
23325    pub requesting_person: Option<ServiceExchangePerson>,
23326    /// Assignment offered by the requester. ID of a concrete event-service assignment (service request), not the reusable service master-data ID from /services.
23327    #[serde(rename = "requestingServiceId", deserialize_with = "crate::lenient::number")]
23328    pub requesting_service_id: i64,
23329    /// `UNANSWERED`: awaiting a reply; `AGREED`: exchange accepted; `DECLINED`: recipient declined; `CANCELLED`: requester cancelled. Archiving is tracked separately by `isArchived`.
23330    /// Allowed values: `AGREED`, `CANCELLED`, `DECLINED`, `UNANSWERED`.
23331    #[serde(deserialize_with = "crate::lenient::string")]
23332    pub status: String,
23333    /// Fields not described by the spec, e.g. instance-specific DB fields.
23334    #[serde(flatten)]
23335    pub extra: serde_json::Map<String, serde_json::Value>,
23336}
23337
23338#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23339pub struct ServiceExchangeRequestCreate {
23340    /// 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.
23341    #[serde(rename = "requestedServiceId", deserialize_with = "crate::lenient::number")]
23342    pub requested_service_id: i64,
23343    /// Fields not described by the spec, e.g. instance-specific DB fields.
23344    #[serde(flatten)]
23345    pub extra: serde_json::Map<String, serde_json::Value>,
23346}
23347
23348#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23349pub struct ServiceExchangeRequestMeta {
23350    #[serde(rename = "modifiedDate", serialize_with = "crate::datetime::serialize_utc")]
23351    pub modified_date: chrono::DateTime<chrono::Utc>,
23352    /// Fields not described by the spec, e.g. instance-specific DB fields.
23353    #[serde(flatten)]
23354    pub extra: serde_json::Map<String, serde_json::Value>,
23355}
23356
23357/// A category of service roles, such as Music or Technical team, optionally associated with a campus. It is not a group of persons.
23358#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23359pub struct ServiceGroup {
23360    /// ID of an existing campus, or `null` for no campus association.
23361    #[serde(rename = "campusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23362    pub campus_id: Option<i64>,
23363    /// Description of the service group.
23364    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23365    pub description: Option<String>,
23366    #[serde(deserialize_with = "crate::lenient::number")]
23367    pub id: i64,
23368    pub meta: MetaDataEntityId,
23369    /// Name of a category of service roles, for example Technical team. This is separate from person groups.
23370    #[serde(deserialize_with = "crate::lenient::string")]
23371    pub name: String,
23372    /// Name translated for the current language; falls back to the stored name.
23373    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
23374    pub name_translated: String,
23375    /// Show this service group only when filtering by its campus.
23376    #[serde(rename = "onlyVisibleInCampusFilter")]
23377    pub only_visible_in_campus_filter: bool,
23378    /// Display order. Lists are sorted by `sortKey` and then name, both ascending.
23379    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
23380    pub sort_key: i64,
23381    /// Make this service group visible through the general service-group viewing permissions.
23382    #[serde(rename = "viewAll")]
23383    pub view_all: bool,
23384    /// Fields not described by the spec, e.g. instance-specific DB fields.
23385    #[serde(flatten)]
23386    pub extra: serde_json::Map<String, serde_json::Value>,
23387}
23388
23389/// Create a category that organizes service roles.
23390#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23391pub struct ServiceGroupCreate {
23392    /// ID of an existing campus, or `null` for no campus association.
23393    ///
23394    /// `None` leaves the field out, `Some(None)` sends `null`.
23395    #[serde(rename = "campusId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23396    pub campus_id: Option<Option<i64>>,
23397    /// Description of the service group.
23398    ///
23399    /// `None` leaves the field out, `Some(None)` sends `null`.
23400    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23401    pub description: Option<Option<String>>,
23402    /// Name of a category of service roles, for example Technical team. This is separate from person groups.
23403    #[serde(deserialize_with = "crate::lenient::string")]
23404    pub name: String,
23405    /// Show this service group only when filtering by its campus.
23406    #[serde(rename = "onlyVisibleInCampusFilter", default, skip_serializing_if = "Option::is_none")]
23407    pub only_visible_in_campus_filter: Option<bool>,
23408    /// Display order. Lists are sorted by `sortKey` and then name, both ascending.
23409    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23410    pub sort_key: Option<i64>,
23411    /// Make this service group visible through the general service-group viewing permissions.
23412    #[serde(rename = "viewAll", default, skip_serializing_if = "Option::is_none")]
23413    pub view_all: Option<bool>,
23414    /// Fields not described by the spec, e.g. instance-specific DB fields.
23415    #[serde(flatten)]
23416    pub extra: serde_json::Map<String, serde_json::Value>,
23417}
23418
23419#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23420pub struct ServiceGroupPersonPreference {
23421    /// Reaching or exceeding it adds a score penalty; it is not an assignment limit.
23422    #[serde(rename = "maxPerMonth", deserialize_with = "crate::lenient::number")]
23423    pub max_per_month: i64,
23424    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
23425    #[serde(rename = "modifiedDate", serialize_with = "crate::datetime::serialize_utc")]
23426    pub modified_date: chrono::DateTime<chrono::Utc>,
23427    #[serde(rename = "modifiedPerson")]
23428    pub modified_person: ServiceGroupPersonPreferenceModifiedPerson,
23429    /// 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.
23430    /// Allowed values: `0`, `1`, `2`, `3`, `4`.
23431    #[serde(rename = "morningWeight", deserialize_with = "crate::lenient::number")]
23432    pub morning_weight: i64,
23433    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
23434    pub person_id: i64,
23435    /// 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.
23436    /// Allowed values: `0`, `1`, `2`.
23437    #[serde(rename = "relationWeight", deserialize_with = "crate::lenient::number")]
23438    pub relation_weight: i64,
23439    #[serde(rename = "serviceGroupId", deserialize_with = "crate::lenient::number")]
23440    pub service_group_id: i64,
23441    /// Fields not described by the spec, e.g. instance-specific DB fields.
23442    #[serde(flatten)]
23443    pub extra: serde_json::Map<String, serde_json::Value>,
23444}
23445
23446#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23447pub struct ServiceGroupPersonPreferenceModifiedPerson {
23448    #[serde(deserialize_with = "crate::lenient::number")]
23449    pub id: i64,
23450    /// Fields not described by the spec, e.g. instance-specific DB fields.
23451    #[serde(flatten)]
23452    pub extra: serde_json::Map<String, serde_json::Value>,
23453}
23454
23455/// Fields for updating a service group.
23456#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23457pub struct ServiceGroupUpdate {
23458    /// ID of an existing campus, or `null` for no campus association.
23459    ///
23460    /// `None` leaves the field out, `Some(None)` sends `null`.
23461    #[serde(rename = "campusId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23462    pub campus_id: Option<Option<i64>>,
23463    /// Description of the service group.
23464    ///
23465    /// `None` leaves the field out, `Some(None)` sends `null`.
23466    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23467    pub description: Option<Option<String>>,
23468    /// Name of a category of service roles, for example Technical team. This is separate from person groups.
23469    #[serde(deserialize_with = "crate::lenient::string")]
23470    pub name: String,
23471    /// Show this service group only when filtering by its campus.
23472    #[serde(rename = "onlyVisibleInCampusFilter", default, skip_serializing_if = "Option::is_none")]
23473    pub only_visible_in_campus_filter: Option<bool>,
23474    /// Display order. Lists are sorted by `sortKey` and then name, both ascending.
23475    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23476    pub sort_key: Option<i64>,
23477    /// Make this service group visible through the general service-group viewing permissions.
23478    #[serde(rename = "viewAll", default, skip_serializing_if = "Option::is_none")]
23479    pub view_all: Option<bool>,
23480    /// Fields not described by the spec, e.g. instance-specific DB fields.
23481    #[serde(flatten)]
23482    pub extra: serde_json::Map<String, serde_json::Value>,
23483}
23484
23485/// 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.
23486#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23487pub struct ServiceRequest {
23488    #[serde(rename = "@deprecated", deserialize_with = "crate::lenient::map")]
23489    pub deprecated: std::collections::BTreeMap<String, String>,
23490    /// Use `isAccepted` instead
23491    #[serde(default, skip_serializing_if = "Option::is_none")]
23492    #[deprecated = "Use `isAccepted` instead"]
23493    pub agreed: Option<bool>,
23494    #[serde(rename = "allowChat")]
23495    pub allow_chat: bool,
23496    /// Confirmation or decline comment. Null when absent or hidden by permissions.
23497    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23498    pub comment: Option<String>,
23499    /// Use `index` instead
23500    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23501    #[deprecated = "Use `index` instead"]
23502    pub counter: Option<i64>,
23503    pub event: ServiceRequestEvent,
23504    /// ID of this particular assignment record. Updating or answering a request may create a new record; use the ID returned by the operation.
23505    #[serde(deserialize_with = "crate::lenient::number")]
23506    pub id: i64,
23507    /// Slot index when an event requires several persons for the same service; null if no index is assigned.
23508    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23509    pub index: Option<i64>,
23510    /// Whether this record was confirmed. Interpret together with isValid, as an older confirmed record can be invalid.
23511    #[serde(rename = "isAccepted")]
23512    pub is_accepted: bool,
23513    /// Whether this record is still the active assignment for its slot. Superseded and declined records are invalid.
23514    #[serde(rename = "isValid")]
23515    pub is_valid: bool,
23516    pub meta: MetaDataEntityId,
23517    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23518    pub name: Option<String>,
23519    /// Optional computed assignment permissions. These request endpoints do not populate them and normally return null.
23520    #[serde(default, skip_serializing_if = "Option::is_none")]
23521    pub permissions: Option<ServiceRequestPermissions>,
23522    #[serde(default, skip_serializing_if = "Option::is_none")]
23523    pub person: Option<DomainObjectPerson>,
23524    #[serde(rename = "personId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23525    #[deprecated = "deprecated in the ChurchTools API"]
23526    pub person_id: Option<i64>,
23527    /// Deprecated alias for `meta.modifiedDate`.
23528    #[serde(rename = "requestedDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
23529    #[deprecated = "deprecated in the ChurchTools API"]
23530    pub requested_date: Option<chrono::DateTime<chrono::Utc>>,
23531    /// Person as Domain Object
23532    #[serde(rename = "requesterPerson")]
23533    pub requester_person: DomainObjectPerson,
23534    #[serde(rename = "requesterPersonId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23535    #[deprecated = "deprecated in the ChurchTools API"]
23536    pub requester_person_id: Option<i64>,
23537    /// ID of the reusable service role from /services, not the request ID.
23538    #[serde(rename = "serviceId", deserialize_with = "crate::lenient::number")]
23539    pub service_id: i64,
23540    #[serde(rename = "serviceName", deserialize_with = "crate::lenient::string")]
23541    pub service_name: String,
23542    /// Fields not described by the spec, e.g. instance-specific DB fields.
23543    #[serde(flatten)]
23544    pub extra: serde_json::Map<String, serde_json::Value>,
23545}
23546
23547#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23548pub struct ServiceRequestAnswer {
23549    /// Optional response comment.
23550    ///
23551    /// `None` leaves the field out, `Some(None)` sends `null`.
23552    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23553    pub comment: Option<Option<String>>,
23554    /// Fields not described by the spec, e.g. instance-specific DB fields.
23555    #[serde(flatten)]
23556    pub extra: serde_json::Map<String, serde_json::Value>,
23557}
23558
23559#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23560pub struct ServiceRequestEvent {
23561    #[serde(deserialize_with = "crate::lenient::number")]
23562    pub id: i64,
23563    #[serde(deserialize_with = "crate::lenient::string")]
23564    pub name: String,
23565    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
23566    #[serde(rename = "startDate", serialize_with = "crate::datetime::serialize_utc")]
23567    pub start_date: chrono::DateTime<chrono::Utc>,
23568    /// Fields not described by the spec, e.g. instance-specific DB fields.
23569    #[serde(flatten)]
23570    pub extra: serde_json::Map<String, serde_json::Value>,
23571}
23572
23573/// Optional computed assignment permissions. These request endpoints do not populate them and normally return null.
23574#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23575pub struct ServiceRequestPermissions {
23576    #[serde(rename = "enterSelfIfFree", default, skip_serializing_if = "Option::is_none")]
23577    pub enter_self_if_free: Option<bool>,
23578    /// Fields not described by the spec, e.g. instance-specific DB fields.
23579    #[serde(flatten)]
23580    pub extra: serde_json::Map<String, serde_json::Value>,
23581}
23582
23583#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23584pub struct ServiceRequestUndoCreate {
23585    /// ID of the person assigned to the record being undone. Must be the current user.
23586    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
23587    pub person_id: i64,
23588    /// Fields not described by the spec, e.g. instance-specific DB fields.
23589    #[serde(flatten)]
23590    pub extra: serde_json::Map<String, serde_json::Value>,
23591}
23592
23593/// Assignment returned after undoing an acceptance or decline.
23594#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23595pub struct ServiceRequestUndoResult {
23596    #[serde(rename = "@deprecated", deserialize_with = "crate::lenient::map")]
23597    pub deprecated: std::collections::BTreeMap<String, String>,
23598    /// Use `isAccepted` instead
23599    #[serde(default, skip_serializing_if = "Option::is_none")]
23600    #[deprecated = "Use `isAccepted` instead"]
23601    pub agreed: Option<bool>,
23602    #[serde(rename = "allowChat")]
23603    pub allow_chat: bool,
23604    /// Confirmation or decline comment. Null when absent or hidden by permissions.
23605    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23606    pub comment: Option<String>,
23607    /// Use `index` instead
23608    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23609    #[deprecated = "Use `index` instead"]
23610    pub counter: Option<i64>,
23611    pub event: ServiceRequestEvent,
23612    /// ID of this particular assignment record. Updating or answering a request may create a new record; use the ID returned by the operation.
23613    #[serde(deserialize_with = "crate::lenient::number")]
23614    pub id: i64,
23615    /// Slot index when an event requires several persons for the same service; null if no index is assigned.
23616    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23617    pub index: Option<i64>,
23618    /// Whether this record was confirmed. Interpret together with isValid, as an older confirmed record can be invalid.
23619    #[serde(rename = "isAccepted")]
23620    pub is_accepted: bool,
23621    /// Whether this record is still the active assignment for its slot. Superseded and declined records are invalid.
23622    #[serde(rename = "isValid")]
23623    pub is_valid: bool,
23624    pub meta: MetaDataEntityId,
23625    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23626    pub name: Option<String>,
23627    /// Optional computed assignment permissions. These request endpoints do not populate them and normally return null.
23628    #[serde(default, skip_serializing_if = "Option::is_none")]
23629    pub permissions: Option<ServiceRequestPermissions>,
23630    #[serde(default, skip_serializing_if = "Option::is_none")]
23631    pub person: Option<DomainObjectPerson>,
23632    #[serde(rename = "personId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23633    #[deprecated = "deprecated in the ChurchTools API"]
23634    pub person_id: Option<i64>,
23635    /// Deprecated alias for `meta.modifiedDate`.
23636    #[serde(rename = "requestedDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
23637    #[deprecated = "deprecated in the ChurchTools API"]
23638    pub requested_date: Option<chrono::DateTime<chrono::Utc>>,
23639    /// Person as Domain Object
23640    #[serde(rename = "requesterPerson")]
23641    pub requester_person: DomainObjectPerson,
23642    #[serde(rename = "requesterPersonId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23643    #[deprecated = "deprecated in the ChurchTools API"]
23644    pub requester_person_id: Option<i64>,
23645    /// ID of the reusable service role from /services, not the request ID.
23646    #[serde(rename = "serviceId", deserialize_with = "crate::lenient::number")]
23647    pub service_id: i64,
23648    #[serde(rename = "serviceName", deserialize_with = "crate::lenient::string")]
23649    pub service_name: String,
23650    /// Fields not described by the spec, e.g. instance-specific DB fields.
23651    #[serde(flatten)]
23652    pub extra: serde_json::Map<String, serde_json::Value>,
23653}
23654
23655/// Assign a person or external name to a service slot. The previous active record is invalidated and a new assignment record is returned.
23656#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23657pub struct ServiceRequestUpdate {
23658    /// Legacy alias for isAccepted. Prefer isAccepted in new integrations.
23659    #[serde(default, skip_serializing_if = "Option::is_none")]
23660    #[deprecated = "deprecated in the ChurchTools API"]
23661    pub agreed: Option<bool>,
23662    /// 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.
23663    ///
23664    /// `None` leaves the field out, `Some(None)` sends `null`.
23665    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23666    pub comment: Option<Option<String>>,
23667    /// Accepted for compatibility; this flag does not control notifications in the current implementation. Notifications follow the assignment workflow.
23668    #[serde(default, skip_serializing_if = "Option::is_none")]
23669    pub inform_person: Option<bool>,
23670    /// true creates a confirmed assignment; false creates an assignment awaiting confirmation. false does not decline it.
23671    #[serde(rename = "isAccepted", default, skip_serializing_if = "Option::is_none")]
23672    pub is_accepted: Option<bool>,
23673    /// Name of an external assignee without a person record.
23674    ///
23675    /// `None` leaves the field out, `Some(None)` sends `null`.
23676    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23677    pub name: Option<Option<String>>,
23678    /// Existing person to assign. Supply exactly one non-`null` value: `personId` or name.
23679    ///
23680    /// `None` leaves the field out, `Some(None)` sends `null`.
23681    #[serde(rename = "personId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23682    pub person_id: Option<Option<i64>>,
23683    /// Fields not described by the spec, e.g. instance-specific DB fields.
23684    #[serde(flatten)]
23685    pub extra: serde_json::Map<String, serde_json::Value>,
23686}
23687
23688/// Update a service role.
23689#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23690pub struct ServiceUpdate {
23691    /// Enable chat for this service.
23692    #[serde(rename = "allowChat", default, skip_serializing_if = "Option::is_none")]
23693    pub allow_chat: Option<bool>,
23694    /// Allow a comment when confirming a service request.
23695    #[serde(rename = "allowCommentOnConfirmation", default, skip_serializing_if = "Option::is_none")]
23696    pub allow_comment_on_confirmation: Option<bool>,
23697    /// Allow persons assigned to this service to control the live agenda.
23698    #[serde(rename = "allowControlLiveAgenda", default, skip_serializing_if = "Option::is_none")]
23699    pub allow_control_live_agenda: Option<bool>,
23700    /// Allow assigned persons to decline service requests.
23701    #[serde(rename = "allowDecline", default, skip_serializing_if = "Option::is_none")]
23702    pub allow_decline: Option<bool>,
23703    /// Allow assigned persons to request an exchange of their service assignment.
23704    #[serde(rename = "allowExchange", default, skip_serializing_if = "Option::is_none")]
23705    pub allow_exchange: Option<bool>,
23706    /// Template for the calendar text of this service.
23707    ///
23708    /// `None` leaves the field out, `Some(None)` sends `null`.
23709    #[serde(rename = "calTextTemplate", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23710    pub cal_text_template: Option<Option<String>>,
23711    /// Deprecated input alias for description. Use description for new integrations.
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    #[deprecated = "Use description for new integrations."]
23716    pub comment: Option<Option<String>>,
23717    /// Description of the role.
23718    ///
23719    /// `None` leaves the field out, `Some(None)` sends `null`.
23720    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23721    pub description: Option<Option<String>>,
23722    /// IDs of connected person groups used for service planning. Nonexistent IDs are silently removed. Duplicates are retained. An empty list clears the connections.
23723    #[serde(rename = "groupIds", default, skip_serializing_if = "Option::is_none")]
23724    pub group_ids: Option<Vec<i64>>,
23725    /// Hide assigned persons from viewers without the service or service-group permissions needed to see them.
23726    #[serde(rename = "hidePersonName", default, skip_serializing_if = "Option::is_none")]
23727    pub hide_person_name: Option<bool>,
23728    /// 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.
23729    #[serde(deserialize_with = "crate::lenient::string")]
23730    pub name: String,
23731    /// Restrict assignment candidates to the connected person groups.
23732    #[serde(rename = "onlyAssignFromGroups", default, skip_serializing_if = "Option::is_none")]
23733    pub only_assign_from_groups: Option<bool>,
23734    /// Enable reminder emails for service assignments.
23735    #[serde(rename = "sendReminderMails", default, skip_serializing_if = "Option::is_none")]
23736    pub send_reminder_mails: Option<bool>,
23737    /// Enable emails for service requests.
23738    #[serde(rename = "sendServiceRequestEmails", default, skip_serializing_if = "Option::is_none")]
23739    pub send_service_request_emails: Option<bool>,
23740    /// ID of the existing service group that organizes this role, for example Music or Technical team. This is not a person group.
23741    #[serde(rename = "serviceGroupId", deserialize_with = "crate::lenient::number")]
23742    pub service_group_id: i64,
23743    /// Display order. Lists are sorted by `sortKey` and then name, both ascending.
23744    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23745    pub sort_key: Option<i64>,
23746    /// Whether this service is marked as a standard service for event planning.
23747    #[serde(default, skip_serializing_if = "Option::is_none")]
23748    pub standard: Option<bool>,
23749    /// IDs of connected tags used for service planning. Nonexistent IDs are silently removed. Duplicates are retained. An empty list clears the connections.
23750    #[serde(rename = "tagIds", default, skip_serializing_if = "Option::is_none")]
23751    pub tag_ids: Option<Vec<i64>>,
23752    /// Fields not described by the spec, e.g. instance-specific DB fields.
23753    #[serde(flatten)]
23754    pub extra: serde_json::Map<String, serde_json::Value>,
23755}
23756
23757/// Configurable sex master-data entry, including localized salutations and audit metadata.
23758#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23759pub struct Sex {
23760    /// Stored name or translation key. Use nameTranslated for display in the current language.
23761    #[serde(deserialize_with = "crate::lenient::string")]
23762    pub name: String,
23763    /// Stored salutation text or translation key. Omission, null, empty string and whitespace-only input all become null.
23764    #[serde(rename = "salutationFormal", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23765    pub salutation_formal: Option<String>,
23766    /// Stored salutation text or translation key. Omission, null, empty string and whitespace-only input all become null.
23767    #[serde(rename = "salutationInformal", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23768    pub salutation_informal: Option<String>,
23769    /// Stored sort order.
23770    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
23771    pub sort_key: i64,
23772    /// Catalog ID referenced by person records. IDs 1 and 2 are protected against deletion.
23773    #[serde(deserialize_with = "crate::lenient::number")]
23774    pub id: i64,
23775    pub meta: MetaDataEntityId,
23776    /// Display name translated for the current language.
23777    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
23778    pub name_translated: String,
23779    /// Localized salutation; empty string when the stored salutation is null.
23780    #[serde(rename = "salutationFormalTranslated", deserialize_with = "crate::lenient::string")]
23781    pub salutation_formal_translated: String,
23782    /// Localized salutation; empty string when the stored salutation is null.
23783    #[serde(rename = "salutationInformalTranslated", deserialize_with = "crate::lenient::string")]
23784    pub salutation_informal_translated: String,
23785    /// Fields not described by the spec, e.g. instance-specific DB fields.
23786    #[serde(flatten)]
23787    pub extra: serde_json::Map<String, serde_json::Value>,
23788}
23789
23790/// Writable catalog values for a person’s sex and associated salutations. Text is trimmed; translation keys and literal display text are accepted.
23791#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23792pub struct SexCreate {
23793    /// Stored name or translation key. Use nameTranslated for display in the current language.
23794    #[serde(deserialize_with = "crate::lenient::string")]
23795    pub name: String,
23796    /// Stored salutation text or translation key. Omission, null, empty string and whitespace-only input all become null.
23797    ///
23798    /// `None` leaves the field out, `Some(None)` sends `null`.
23799    #[serde(rename = "salutationFormal", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23800    pub salutation_formal: Option<Option<String>>,
23801    /// Stored salutation text or translation key. Omission, null, empty string and whitespace-only input all become null.
23802    ///
23803    /// `None` leaves the field out, `Some(None)` sends `null`.
23804    #[serde(rename = "salutationInformal", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23805    pub salutation_informal: Option<Option<String>>,
23806    /// Sort order. Omission or null becomes 0.
23807    ///
23808    /// `None` leaves the field out, `Some(None)` sends `null`.
23809    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23810    pub sort_key: Option<Option<i64>>,
23811    /// Fields not described by the spec, e.g. instance-specific DB fields.
23812    #[serde(flatten)]
23813    pub extra: serde_json::Map<String, serde_json::Value>,
23814}
23815
23816/// 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.
23817#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23818pub struct SexUpdate {
23819    /// Stored name or translation key. Use nameTranslated for display in the current language.
23820    #[serde(deserialize_with = "crate::lenient::string")]
23821    pub name: String,
23822    /// Stored salutation text or translation key. Omission, null, empty string and whitespace-only input all become null.
23823    ///
23824    /// `None` leaves the field out, `Some(None)` sends `null`.
23825    #[serde(rename = "salutationFormal", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23826    pub salutation_formal: Option<Option<String>>,
23827    /// Stored salutation text or translation key. Omission, null, empty string and whitespace-only input all become null.
23828    ///
23829    /// `None` leaves the field out, `Some(None)` sends `null`.
23830    #[serde(rename = "salutationInformal", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23831    pub salutation_informal: Option<Option<String>>,
23832    /// Sort order. Omission or null becomes 0.
23833    ///
23834    /// `None` leaves the field out, `Some(None)` sends `null`.
23835    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23836    pub sort_key: Option<Option<i64>>,
23837    /// Fields not described by the spec, e.g. instance-specific DB fields.
23838    #[serde(flatten)]
23839    pub extra: serde_json::Map<String, serde_json::Value>,
23840}
23841
23842#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23843pub struct SimpleAppointment {
23844    #[serde(rename = "calendarId", deserialize_with = "crate::lenient::number")]
23845    pub calendar_id: i64,
23846    #[serde(deserialize_with = "crate::lenient::number")]
23847    pub id: i64,
23848    #[serde(deserialize_with = "crate::lenient::string")]
23849    pub title: String,
23850    /// Fields not described by the spec, e.g. instance-specific DB fields.
23851    #[serde(flatten)]
23852    pub extra: serde_json::Map<String, serde_json::Value>,
23853}
23854
23855/// 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.
23856#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23857pub struct SimpleWikiPage {
23858    /// Compatibility marker used by existing clients.
23859    #[serde(rename = "@deprecated")]
23860    pub deprecated: SimpleWikiPageDeprecated,
23861    /// Stable page GUID across versions in its category.
23862    #[serde(deserialize_with = "crate::lenient::string")]
23863    pub guid: String,
23864    /// Deprecated alias for `guid`. Use `guid` instead.
23865    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23866    #[deprecated = "Use `guid` instead."]
23867    pub identifier: Option<String>,
23868    /// Whether page text is Markdown rather than legacy HTML.
23869    #[serde(rename = "isMarkdown")]
23870    pub is_markdown: bool,
23871    pub meta: MetaDataEntityPerson,
23872    /// Whether the page is configured to appear on the wiki start page.
23873    #[serde(rename = "onStartpage")]
23874    pub on_startpage: bool,
23875    /// Page editing/deletion capabilities for the current user; system pages have additional restrictions.
23876    pub permissions: SimpleWikiPagePermissions,
23877    /// Stored redirect title. API reads return the page and this value; they do not follow the redirect.
23878    #[serde(rename = "redirectTo", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23879    pub redirect_to: Option<String>,
23880    /// Query-focused preview snippet. Present when the page list endpoint is called with a search query.
23881    #[serde(rename = "searchPreview", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23882    pub search_preview: Option<String>,
23883    /// 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.
23884    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23885    pub text: Option<String>,
23886    /// 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.
23887    #[serde(rename = "textPreview", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23888    pub text_preview: Option<String>,
23889    #[serde(deserialize_with = "crate::lenient::string")]
23890    pub title: String,
23891    /// Revision number of this page.
23892    #[serde(deserialize_with = "crate::lenient::number")]
23893    pub version: i64,
23894    /// A category organizes wiki pages and is the unit of wiki access permissions.
23895    #[serde(rename = "wikiCategory")]
23896    pub wiki_category: WikiCategory,
23897    /// Fields not described by the spec, e.g. instance-specific DB fields.
23898    #[serde(flatten)]
23899    pub extra: serde_json::Map<String, serde_json::Value>,
23900}
23901
23902/// Compatibility marker used by existing clients.
23903#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23904pub struct SimpleWikiPageDeprecated {
23905    #[serde(deserialize_with = "crate::lenient::string")]
23906    pub identifier: String,
23907    /// Fields not described by the spec, e.g. instance-specific DB fields.
23908    #[serde(flatten)]
23909    pub extra: serde_json::Map<String, serde_json::Value>,
23910}
23911
23912/// Page editing/deletion capabilities for the current user; system pages have additional restrictions.
23913#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23914pub struct SimpleWikiPagePermissions {
23915    #[serde(rename = "canDelete")]
23916    pub can_delete: bool,
23917    #[serde(rename = "canEdit")]
23918    pub can_edit: bool,
23919    /// Fields not described by the spec, e.g. instance-specific DB fields.
23920    #[serde(flatten)]
23921    pub extra: serde_json::Map<String, serde_json::Value>,
23922}
23923
23924/// Song with its category and all arrangements. Agenda-specific selection, order and timing belong to agenda items, not to this song record.
23925#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23926pub struct Song {
23927    /// Compatibility markers included in serialized song records.
23928    #[serde(rename = "@deprecated")]
23929    pub deprecated: SongDeprecated,
23930    /// All musical versions, always returned by the current API, even without include=arrangements. Each version has its own key, tempo and attachments.
23931    #[serde(default, skip_serializing_if = "Option::is_none")]
23932    #[deprecated = "deprecated in the ChurchTools API"]
23933    pub arrangements: Option<Vec<Arrangement>>,
23934    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23935    pub author: Option<String>,
23936    /// Configurable category for organizing songs.
23937    pub category: SongCategory,
23938    /// CCLI song number, stored as text.
23939    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23940    pub ccli: Option<String>,
23941    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23942    pub copyright: Option<String>,
23943    #[serde(deserialize_with = "crate::lenient::number")]
23944    pub id: i64,
23945    pub meta: MetaDataEntityId,
23946    #[serde(deserialize_with = "crate::lenient::string")]
23947    pub name: String,
23948    /// Deprecated compatibility field, returned as an empty string.
23949    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23950    #[deprecated = "deprecated in the ChurchTools API"]
23951    pub note: Option<String>,
23952    /// Whether the song is marked for rehearsal.
23953    #[serde(rename = "shouldPractice")]
23954    pub should_practice: bool,
23955    /// 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.
23956    #[serde(default, skip_serializing_if = "Option::is_none")]
23957    pub tags: Option<Vec<TagWithCount>>,
23958    /// Fields not described by the spec, e.g. instance-specific DB fields.
23959    #[serde(flatten)]
23960    pub extra: serde_json::Map<String, serde_json::Value>,
23961}
23962
23963/// Configurable category for organizing songs.
23964#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23965pub struct SongCategory {
23966    #[serde(rename = "campusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23967    pub campus_id: Option<i64>,
23968    #[serde(deserialize_with = "crate::lenient::number")]
23969    pub id: i64,
23970    pub meta: MetaDataEntityId,
23971    /// Stored, configurable name.
23972    #[serde(deserialize_with = "crate::lenient::string")]
23973    pub name: String,
23974    /// Display name after translation, or the original name when no translation is available.
23975    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
23976    pub name_translated: String,
23977    /// Display order; lower values come first.
23978    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
23979    pub sort_key: i64,
23980    /// Fields not described by the spec, e.g. instance-specific DB fields.
23981    #[serde(flatten)]
23982    pub extra: serde_json::Map<String, serde_json::Value>,
23983}
23984
23985/// Input for a configurable song category.
23986#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23987pub struct SongCategoryCreate {
23988    /// Existing campus ID associated with the category.
23989    ///
23990    /// `None` leaves the field out, `Some(None)` sends `null`.
23991    #[serde(rename = "campusId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23992    pub campus_id: Option<Option<i64>>,
23993    /// Configurable category name.
23994    #[serde(deserialize_with = "crate::lenient::string")]
23995    pub name: String,
23996    /// Display order; lower values come first.
23997    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23998    pub sort_key: Option<i64>,
23999    /// Fields not described by the spec, e.g. instance-specific DB fields.
24000    #[serde(flatten)]
24001    pub extra: serde_json::Map<String, serde_json::Value>,
24002}
24003
24004/// Input for replacing a song category.
24005#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24006pub struct SongCategoryUpdate {
24007    /// Existing campus ID associated with the category.
24008    ///
24009    /// `None` leaves the field out, `Some(None)` sends `null`.
24010    #[serde(rename = "campusId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24011    pub campus_id: Option<Option<i64>>,
24012    /// Configurable category name.
24013    #[serde(deserialize_with = "crate::lenient::string")]
24014    pub name: String,
24015    /// Display order; lower values come first.
24016    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
24017    pub sort_key: Option<i64>,
24018    /// Fields not described by the spec, e.g. instance-specific DB fields.
24019    #[serde(flatten)]
24020    pub extra: serde_json::Map<String, serde_json::Value>,
24021}
24022
24023/// 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.
24024#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24025pub struct SongCreate {
24026    /// Author or composer credits.
24027    ///
24028    /// `None` leaves the field out, `Some(None)` sends `null`.
24029    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24030    pub author: Option<Option<String>>,
24031    /// 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.
24032    #[serde(rename = "categoryId", deserialize_with = "crate::lenient::number")]
24033    pub category_id: i64,
24034    /// CCLI song number, stored as text.
24035    ///
24036    /// `None` leaves the field out, `Some(None)` sends `null`.
24037    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24038    pub ccli: Option<Option<String>>,
24039    /// Copyright or licensing notice.
24040    ///
24041    /// `None` leaves the field out, `Some(None)` sends `null`.
24042    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24043    pub copyright: Option<Option<String>>,
24044    /// Song title.
24045    #[serde(deserialize_with = "crate::lenient::string")]
24046    pub name: String,
24047    /// Marks the song for rehearsal.
24048    #[serde(rename = "shouldPractice", default, skip_serializing_if = "Option::is_none")]
24049    pub should_practice: Option<bool>,
24050    /// Tag names to assign. Existing tags are reused by name; missing tags are created. During update, this replaces the song's tag set.
24051    #[serde(default, skip_serializing_if = "Option::is_none")]
24052    pub tags: Option<Vec<String>>,
24053    /// Initial musical versions. The first arrangement becomes the default unless a later item has `isDefault: true`.
24054    #[serde(default, skip_serializing_if = "Option::is_none")]
24055    pub arrangements: Option<Vec<ArrangementCreate>>,
24056    /// Fields not described by the spec, e.g. instance-specific DB fields.
24057    #[serde(flatten)]
24058    pub extra: serde_json::Map<String, serde_json::Value>,
24059}
24060
24061/// Compatibility markers included in serialized song records.
24062#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24063pub struct SongDeprecated {
24064    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
24065    pub arrangements: serde_json::Value,
24066    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
24067    pub note: serde_json::Value,
24068    /// Fields not described by the spec, e.g. instance-specific DB fields.
24069    #[serde(flatten)]
24070    pub extra: serde_json::Map<String, serde_json::Value>,
24071}
24072
24073/// Source associated with song arrangements, such as a hymnal or songbook.
24074#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24075pub struct SongSource {
24076    #[serde(deserialize_with = "crate::lenient::number")]
24077    pub id: i64,
24078    pub meta: MetaDataEntityId,
24079    /// Stored, configurable name.
24080    #[serde(deserialize_with = "crate::lenient::string")]
24081    pub name: String,
24082    /// Display name after translation, or the original name when no translation is available.
24083    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
24084    pub name_translated: String,
24085    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24086    pub shorty: Option<String>,
24087    /// Display order; lower values come first.
24088    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
24089    pub sort_key: i64,
24090    /// Fields not described by the spec, e.g. instance-specific DB fields.
24091    #[serde(flatten)]
24092    pub extra: serde_json::Map<String, serde_json::Value>,
24093}
24094
24095/// Input for a song source, such as a hymnal or songbook.
24096#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24097pub struct SongSourceCreate {
24098    /// Configurable source name.
24099    #[serde(deserialize_with = "crate::lenient::string")]
24100    pub name: String,
24101    /// Display abbreviation.
24102    ///
24103    /// `None` leaves the field out, `Some(None)` sends `null`.
24104    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24105    pub shorty: Option<Option<String>>,
24106    /// Display order; lower values come first.
24107    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
24108    pub sort_key: Option<i64>,
24109    /// Fields not described by the spec, e.g. instance-specific DB fields.
24110    #[serde(flatten)]
24111    pub extra: serde_json::Map<String, serde_json::Value>,
24112}
24113
24114/// Input for replacing a song source.
24115#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24116pub struct SongSourceUpdate {
24117    /// Configurable source name.
24118    #[serde(deserialize_with = "crate::lenient::string")]
24119    pub name: String,
24120    /// Display abbreviation.
24121    ///
24122    /// `None` leaves the field out, `Some(None)` sends `null`.
24123    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24124    pub shorty: Option<Option<String>>,
24125    /// Display order; lower values come first.
24126    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
24127    pub sort_key: Option<i64>,
24128    /// Fields not described by the spec, e.g. instance-specific DB fields.
24129    #[serde(flatten)]
24130    pub extra: serde_json::Map<String, serde_json::Value>,
24131}
24132
24133/// Song details shared by creation and update. Inline arrangements are supported only during creation.
24134#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24135pub struct SongUpdate {
24136    /// Author or composer credits.
24137    ///
24138    /// `None` leaves the field out, `Some(None)` sends `null`.
24139    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24140    pub author: Option<Option<String>>,
24141    /// 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.
24142    #[serde(rename = "categoryId", deserialize_with = "crate::lenient::number")]
24143    pub category_id: i64,
24144    /// CCLI song number, stored as text.
24145    ///
24146    /// `None` leaves the field out, `Some(None)` sends `null`.
24147    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24148    pub ccli: Option<Option<String>>,
24149    /// Copyright or licensing notice.
24150    ///
24151    /// `None` leaves the field out, `Some(None)` sends `null`.
24152    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24153    pub copyright: Option<Option<String>>,
24154    /// Song title.
24155    #[serde(deserialize_with = "crate::lenient::string")]
24156    pub name: String,
24157    /// Marks the song for rehearsal.
24158    #[serde(rename = "shouldPractice", default, skip_serializing_if = "Option::is_none")]
24159    pub should_practice: Option<bool>,
24160    /// Tag names to assign. Existing tags are reused by name; missing tags are created. During update, this replaces the song's tag set.
24161    #[serde(default, skip_serializing_if = "Option::is_none")]
24162    pub tags: Option<Vec<String>>,
24163    /// Fields not described by the spec, e.g. instance-specific DB fields.
24164    #[serde(flatten)]
24165    pub extra: serde_json::Map<String, serde_json::Value>,
24166}
24167
24168/// 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.
24169#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24170pub struct SplitTransaction {
24171    /// Total amount in the currency's smallest denomination (e.g. cents). Must equal the sum of all `splitChildren` amounts.
24172    #[serde(deserialize_with = "crate::lenient::number")]
24173    pub amount: i64,
24174    /// Parent receipts, included when include\[\]=bills is requested.
24175    #[serde(default, skip_serializing_if = "Option::is_none")]
24176    pub bills: Option<Vec<Bill>>,
24177    /// A simple date in ISO format, e.g. '2022-10-19'
24178    #[serde(rename = "documentDate")]
24179    pub document_date: chrono::NaiveDate,
24180    /// Document number of the split transaction. Auto-generated when the accounting period increments document numbers, otherwise required.
24181    #[serde(rename = "documentNumber", deserialize_with = "crate::lenient::string")]
24182    pub document_number: String,
24183    /// ID of the split parent, distinct from each ordinary child transaction ID.
24184    #[serde(deserialize_with = "crate::lenient::number")]
24185    pub id: i64,
24186    pub meta: MetaDataEntityId,
24187    /// Free-text note describing the split booking.
24188    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24189    pub note: Option<String>,
24190    /// 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.
24191    #[serde(rename = "splitChildren")]
24192    pub split_children: Vec<Transaction>,
24193    /// Fields not described by the spec, e.g. instance-specific DB fields.
24194    #[serde(flatten)]
24195    pub extra: serde_json::Map<String, serde_json::Value>,
24196}
24197
24198/// 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.
24199#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24200pub struct SplitTransactionChildCreate {
24201    /// ID of the debit account the amount is posted to.
24202    #[serde(rename = "accountId", deserialize_with = "crate::lenient::number")]
24203    pub account_id: i64,
24204    /// 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.
24205    #[serde(deserialize_with = "crate::lenient::number")]
24206    pub amount: i64,
24207    /// Cash discount in the smallest currency unit. Used only together with cashDiscountId.
24208    ///
24209    /// `None` leaves the field out, `Some(None)` sends `null`.
24210    #[serde(rename = "cashDiscountAmount", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24211    pub cash_discount_amount: Option<Option<i64>>,
24212    /// Cash-discount definition from the same accounting period. When supplied, cashDiscountAmount must also be non-null.
24213    ///
24214    /// `None` leaves the field out, `Some(None)` sends `null`.
24215    #[serde(rename = "cashDiscountId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24216    pub cash_discount_id: Option<Option<i64>>,
24217    /// ID of the credit (contra) account the amount is posted from. Must differ from `accountId`.
24218    #[serde(rename = "contraAccountId", deserialize_with = "crate::lenient::number")]
24219    pub contra_account_id: i64,
24220    /// Cost center from the same accounting period. Omission or null clears the assignment on update.
24221    ///
24222    /// `None` leaves the field out, `Some(None)` sends `null`.
24223    #[serde(rename = "costCenterId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24224    pub cost_center_id: Option<Option<i64>>,
24225    /// 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.
24226    ///
24227    /// `None` leaves the field out, `Some(None)` sends `null`.
24228    #[serde(rename = "donatorId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24229    pub donator_id: Option<Option<i64>>,
24230    /// Spouse for joint donation receipts. Requires a different donor person and an existing spouse relationship; inconsistent assignments return 422.
24231    ///
24232    /// `None` leaves the field out, `Some(None)` sends `null`.
24233    #[serde(rename = "donatorSpouseId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24234    pub donator_spouse_id: Option<Option<i64>>,
24235    /// 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.
24236    ///
24237    /// `None` leaves the field out, `Some(None)` sends `null`.
24238    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24239    pub id: Option<Option<i64>>,
24240    /// Sync marker used for newly created children; existing children retain their marker.
24241    #[serde(rename = "isSynced", default, skip_serializing_if = "Option::is_none")]
24242    pub is_synced: Option<bool>,
24243    /// Whether this is a donation through waived reimbursement of expenses. Defaults to false, including on update.
24244    #[serde(rename = "isWaiverOfReimbursementOfExpenses", default, skip_serializing_if = "Option::is_none")]
24245    pub is_waiver_of_reimbursement_of_expenses: Option<bool>,
24246    /// Child booking note. Validation checks the trimmed length, but the current implementation writes the original child value.
24247    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24248    pub note: Option<String>,
24249    /// 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.
24250    ///
24251    /// `None` leaves the field out, `Some(None)` sends `null`.
24252    #[serde(rename = "taxRateId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24253    pub tax_rate_id: Option<Option<i64>>,
24254    /// Fields not described by the spec, e.g. instance-specific DB fields.
24255    #[serde(flatten)]
24256    pub extra: serde_json::Map<String, serde_json::Value>,
24257}
24258
24259/// 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.
24260#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24261pub struct SplitTransactionCreate {
24262    /// Total gross amount in minor currency units, equal to the sum of submitted child amounts.
24263    #[serde(deserialize_with = "crate::lenient::number")]
24264    pub amount: i64,
24265    /// Document date applied to all children.
24266    #[serde(rename = "documentDate")]
24267    pub document_date: chrono::NaiveDate,
24268    /// 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.
24269    ///
24270    /// `None` leaves the field out, `Some(None)` sends `null`.
24271    #[serde(rename = "documentNumber", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24272    pub document_number: Option<Option<String>>,
24273    /// Parent note; trimmed, with an empty result stored as null. For single-child conversion this replaces the child note.
24274    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24275    pub note: Option<String>,
24276    /// Complete replacement list. Existing IDs keep/update rows; omitted previous rows are deleted. Omit id to create a new child.
24277    #[serde(rename = "splitChildren")]
24278    pub split_children: Vec<SplitTransactionChildCreate>,
24279    /// Fields not described by the spec, e.g. instance-specific DB fields.
24280    #[serde(flatten)]
24281    pub extra: serde_json::Map<String, serde_json::Value>,
24282}
24283
24284#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24285pub struct SplitTransactionStornoCreate {
24286    /// Cancellation reason; trimmed before being added to parent and child notes.
24287    #[serde(deserialize_with = "crate::lenient::string")]
24288    pub note: String,
24289    /// Fields not described by the spec, e.g. instance-specific DB fields.
24290    #[serde(flatten)]
24291    pub extra: serde_json::Map<String, serde_json::Value>,
24292}
24293
24294/// 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.
24295#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24296pub struct SplitTransactionUpdate {
24297    /// Total gross amount in minor currency units, equal to the sum of submitted child amounts.
24298    #[serde(deserialize_with = "crate::lenient::number")]
24299    pub amount: i64,
24300    /// Document date applied to all children.
24301    #[serde(rename = "documentDate")]
24302    pub document_date: chrono::NaiveDate,
24303    /// 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.
24304    ///
24305    /// `None` leaves the field out, `Some(None)` sends `null`.
24306    #[serde(rename = "documentNumber", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24307    pub document_number: Option<Option<String>>,
24308    /// Parent note; trimmed, with an empty result stored as null. For single-child conversion this replaces the child note.
24309    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24310    pub note: Option<String>,
24311    /// Complete replacement list. Existing IDs keep/update rows; omitted previous rows are deleted. Omit id to create a new child.
24312    #[serde(rename = "splitChildren")]
24313    pub split_children: Vec<SplitTransactionChildCreate>,
24314    /// Fields not described by the spec, e.g. instance-specific DB fields.
24315    #[serde(flatten)]
24316    pub extra: serde_json::Map<String, serde_json::Value>,
24317}
24318
24319/// Public login-screen entry for a visible OAuth, OpenID Connect or SAML provider.
24320#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24321pub struct SsoLogin {
24322    /// Whether account registration is configured for this provider.
24323    #[serde(rename = "hasRegistration")]
24324    pub has_registration: bool,
24325    /// External login provider ID.
24326    #[serde(deserialize_with = "crate::lenient::number")]
24327    pub id: i64,
24328    /// URL that starts authentication; navigate the browser to it.
24329    #[serde(rename = "loginLink", deserialize_with = "crate::lenient::string")]
24330    pub login_link: String,
24331    /// Optional provider logo URL.
24332    #[serde(rename = "logoUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24333    pub logo_url: Option<String>,
24334    /// Label shown for the provider.
24335    #[serde(deserialize_with = "crate::lenient::string")]
24336    pub name: String,
24337    /// Whether the provider is marked as the primary login option.
24338    #[serde(rename = "primaryLogin")]
24339    pub primary_login: bool,
24340    /// Optional explanatory text for the login screen.
24341    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24342    pub subtitle: Option<String>,
24343    /// Authentication protocol implemented by the provider.
24344    /// Allowed values: `oauth`, `oidc`, `saml`.
24345    #[serde(deserialize_with = "crate::lenient::string")]
24346    pub r#type: String,
24347    /// Fields not described by the spec, e.g. instance-specific DB fields.
24348    #[serde(flatten)]
24349    pub extra: serde_json::Map<String, serde_json::Value>,
24350}
24351
24352#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24353pub struct StartStopChat {
24354    pub enabled: bool,
24355    #[serde(rename = "triggerChatInviteMail", default, skip_serializing_if = "Option::is_none")]
24356    pub trigger_chat_invite_mail: Option<bool>,
24357    /// Fields not described by the spec, e.g. instance-specific DB fields.
24358    #[serde(flatten)]
24359    pub extra: serde_json::Map<String, serde_json::Value>,
24360}
24361
24362/// One imported bank-statement movement and its proposed booking fields. Suggestions are always included; include\[\]=bills additionally expands supporting documents on the suggestions.
24363#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24364pub struct StatementMovement {
24365    /// Movement amount in minor currency units. isDebit distinguishes outgoing from incoming funds.
24366    #[serde(deserialize_with = "crate::lenient::number")]
24367    pub amount: i64,
24368    #[serde(deserialize_with = "crate::lenient::string")]
24369    pub description: String,
24370    /// A simple date in ISO format, e.g. '2022-10-19'
24371    #[serde(rename = "documentDate")]
24372    pub document_date: chrono::NaiveDate,
24373    #[serde(deserialize_with = "crate::lenient::number")]
24374    pub id: i64,
24375    #[serde(deserialize_with = "crate::lenient::string")]
24376    pub identifier: String,
24377    /// True for outgoing funds, false for incoming funds.
24378    #[serde(rename = "isDebit")]
24379    pub is_debit: bool,
24380    /// Donation indicator recorded by the import.
24381    #[serde(rename = "isDonation")]
24382    pub is_donation: bool,
24383    /// Original sequence number used as the secondary sort key.
24384    #[serde(rename = "numberInStatement", deserialize_with = "crate::lenient::number")]
24385    pub number_in_statement: i64,
24386    #[serde(rename = "personName", deserialize_with = "crate::lenient::string")]
24387    pub person_name: String,
24388    #[serde(deserialize_with = "crate::lenient::string")]
24389    pub purpose: String,
24390    /// Normally open, booked or ignored. The current mutation endpoint also stores other strings without validating an enum.
24391    #[serde(deserialize_with = "crate::lenient::string")]
24392    pub state: String,
24393    pub suggestions: Vec<MovementSuggestion>,
24394    #[serde(rename = "transactionCode", deserialize_with = "crate::lenient::string")]
24395    pub transaction_code: String,
24396    /// Associated transaction, or null before booking. For a split booking this identifies the first non-tax child, not the split parent.
24397    #[serde(rename = "transactionId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
24398    pub transaction_id: Option<i64>,
24399    /// A simple date in ISO format, e.g. '2022-10-19'
24400    pub valuta: chrono::NaiveDate,
24401    /// Fields not described by the spec, e.g. instance-specific DB fields.
24402    #[serde(flatten)]
24403    pub extra: serde_json::Map<String, serde_json::Value>,
24404}
24405
24406#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24407pub struct StatementMovementUpdate {
24408    /// Target movement state. Returning from booked to another state does not undo or delete the existing transaction.
24409    /// Allowed values: `booked`, `ignored`, `open`.
24410    #[serde(deserialize_with = "crate::lenient::string")]
24411    pub state: String,
24412    /// Fields not described by the spec, e.g. instance-specific DB fields.
24413    #[serde(flatten)]
24414    pub extra: serde_json::Map<String, serde_json::Value>,
24415}
24416
24417#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24418pub struct StatementStatistics {
24419    /// Sum of open, booked and ignored movements.
24420    #[serde(deserialize_with = "crate::lenient::number")]
24421    pub all: i64,
24422    /// Number of booked movements.
24423    #[serde(deserialize_with = "crate::lenient::number")]
24424    pub booked: i64,
24425    /// Number of ignored movements.
24426    #[serde(deserialize_with = "crate::lenient::number")]
24427    pub ignored: i64,
24428    /// Number of open movements.
24429    #[serde(deserialize_with = "crate::lenient::number")]
24430    pub open: i64,
24431    /// Fields not described by the spec, e.g. instance-specific DB fields.
24432    #[serde(flatten)]
24433    pub extra: serde_json::Map<String, serde_json::Value>,
24434}
24435
24436/// Configurable person status, independent of a person’s memberships in groups. Status IDs are installation-specific and are not an enum.
24437#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24438pub struct Status {
24439    /// ID of status
24440    #[serde(deserialize_with = "crate::lenient::number")]
24441    pub id: i64,
24442    /// Flag if status is member of the church
24443    #[serde(rename = "isMember")]
24444    pub is_member: bool,
24445    /// Flag if that status is searchable
24446    #[serde(rename = "isSearchable")]
24447    pub is_searchable: bool,
24448    /// Status name
24449    #[serde(deserialize_with = "crate::lenient::string")]
24450    pub name: String,
24451    /// Translated status name
24452    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
24453    pub name_translated: String,
24454    /// Existing security-level definition associated with this status. Retrieve available IDs from GET /securitylevels.
24455    #[serde(rename = "securityLevelId", deserialize_with = "crate::lenient::number")]
24456    pub security_level_id: i64,
24457    /// Abbreviation of name.
24458    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24459    pub shorty: Option<String>,
24460    /// Localized abbreviation. Present even when shorty is null.
24461    #[serde(rename = "shortyTranslated", deserialize_with = "crate::lenient::string")]
24462    pub shorty_translated: String,
24463    /// Used to sort all statuses
24464    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
24465    pub sort_key: i64,
24466    /// Fields not described by the spec, e.g. instance-specific DB fields.
24467    #[serde(flatten)]
24468    pub extra: serde_json::Map<String, serde_json::Value>,
24469}
24470
24471/// Person status definition, such as member or guest.
24472#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24473pub struct StatusCreate {
24474    /// Whether this status marks a person as a church member.
24475    ///
24476    /// `None` leaves the field out, `Some(None)` sends `null`.
24477    #[serde(rename = "isMember", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24478    pub is_member: Option<Option<bool>>,
24479    /// Whether persons with this status are eligible for the corresponding free-text person selection. This flag does not replace person visibility permissions.
24480    ///
24481    /// `None` leaves the field out, `Some(None)` sends `null`.
24482    #[serde(rename = "isSearchable", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24483    pub is_searchable: Option<Option<bool>>,
24484    /// Status name.
24485    #[serde(deserialize_with = "crate::lenient::string")]
24486    pub name: String,
24487    /// Existing security-level definition associated with this status. Retrieve available IDs from `GET /securitylevels`.
24488    #[serde(rename = "securityLevelId", deserialize_with = "crate::lenient::number")]
24489    pub security_level_id: i64,
24490    /// Abbreviation of the status name.
24491    ///
24492    /// `None` leaves the field out, `Some(None)` sends `null`.
24493    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24494    pub shorty: Option<Option<String>>,
24495    /// Display-order value.
24496    ///
24497    /// `None` leaves the field out, `Some(None)` sends `null`.
24498    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24499    pub sort_key: Option<Option<i64>>,
24500    /// Fields not described by the spec, e.g. instance-specific DB fields.
24501    #[serde(flatten)]
24502    pub extra: serde_json::Map<String, serde_json::Value>,
24503}
24504
24505/// Fields to update; omitted fields remain unchanged.
24506#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24507pub struct StatusUpdate {
24508    #[serde(rename = "isMember", default, skip_serializing_if = "Option::is_none")]
24509    pub is_member: Option<bool>,
24510    #[serde(rename = "isSearchable", default, skip_serializing_if = "Option::is_none")]
24511    pub is_searchable: Option<bool>,
24512    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24513    pub name: Option<String>,
24514    /// Existing security-level definition associated with this status.
24515    #[serde(rename = "securityLevelId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
24516    pub security_level_id: Option<i64>,
24517    /// `None` leaves the field out, `Some(None)` sends `null`.
24518    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24519    pub shorty: Option<Option<String>>,
24520    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
24521    pub sort_key: Option<i64>,
24522    /// Fields not described by the spec, e.g. instance-specific DB fields.
24523    #[serde(flatten)]
24524    pub extra: serde_json::Map<String, serde_json::Value>,
24525}
24526
24527/// 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.
24528#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24529pub struct StoredAddress {
24530    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24531    pub addition: Option<String>,
24532    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24533    pub city: Option<String>,
24534    /// 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`.
24535    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
24536    pub color: serde_json::Value,
24537    /// A country's ISO-code
24538    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24539    pub country: Option<String>,
24540    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24541    pub district: Option<String>,
24542    /// The identifier of the domain object. This field is set automatically from the path parameter and should not be included in the request body.
24543    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::string")]
24544    pub domain_identifier: String,
24545    /// The domain type of the address. This field is set automatically from the path parameter and should not be included in the request body.
24546    /// Allowed values: `appointment`, `campus`, `church`, `group`.
24547    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
24548    pub domain_type: String,
24549    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24550    pub icon: Option<String>,
24551    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24552    pub latitude: Option<String>,
24553    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24554    pub longitude: Option<String>,
24555    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24556    pub name: Option<String>,
24557    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24558    pub street: Option<String>,
24559    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24560    pub zip: Option<String>,
24561    #[serde(deserialize_with = "crate::lenient::number")]
24562    pub id: i64,
24563    #[serde(rename = "@deprecated")]
24564    pub deprecated: StoredAddressDeprecated,
24565    /// Use `latitude` instead
24566    #[serde(rename = "geoLat", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24567    #[deprecated = "Use `latitude` instead"]
24568    pub geo_lat: Option<String>,
24569    /// Use `longitude` instead
24570    #[serde(rename = "geoLng", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24571    #[deprecated = "Use `longitude` instead"]
24572    pub geo_lng: Option<String>,
24573    /// Use `latitude` instead
24574    #[serde(rename = "latitudeLoose", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24575    #[deprecated = "Use `latitude` instead"]
24576    pub latitude_loose: Option<String>,
24577    /// Use `longitude` instead
24578    #[serde(rename = "longitudeLoose", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24579    #[deprecated = "Use `longitude` instead"]
24580    pub longitude_loose: Option<String>,
24581    /// 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`.
24582    #[serde(rename = "markerColor", default, skip_serializing_if = "serde_json::Value::is_null")]
24583    #[deprecated = "deprecated in the ChurchTools API"]
24584    pub marker_color: serde_json::Value,
24585    /// Use `icon` instead
24586    #[serde(rename = "markerIcon", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24587    #[deprecated = "Use `icon` instead"]
24588    pub marker_icon: Option<String>,
24589    #[serde(rename = "markerUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24590    #[deprecated = "deprecated in the ChurchTools API"]
24591    pub marker_url: Option<String>,
24592    /// Use `name` instead
24593    #[serde(rename = "meetingAt", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24594    #[deprecated = "Use `name` instead"]
24595    pub meeting_at: Option<String>,
24596    /// Use `zip` instead
24597    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24598    #[deprecated = "Use `zip` instead"]
24599    pub postalcode: Option<String>,
24600    /// Fields not described by the spec, e.g. instance-specific DB fields.
24601    #[serde(flatten)]
24602    pub extra: serde_json::Map<String, serde_json::Value>,
24603}
24604
24605#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24606pub struct StoredAddressDeprecated {
24607    /// Allowed values: `latitude`.
24608    #[serde(rename = "geoLat", deserialize_with = "crate::lenient::string")]
24609    pub geo_lat: String,
24610    /// Allowed values: `longitude`.
24611    #[serde(rename = "geoLng", deserialize_with = "crate::lenient::string")]
24612    pub geo_lng: String,
24613    /// Allowed values: `color`.
24614    #[serde(rename = "markerColor", deserialize_with = "crate::lenient::string")]
24615    pub marker_color: String,
24616    /// Allowed values: `icon`.
24617    #[serde(rename = "markerIcon", deserialize_with = "crate::lenient::string")]
24618    pub marker_icon: String,
24619    /// Allowed values: `@deleted use icon and color instead`.
24620    #[serde(rename = "markerUrl", deserialize_with = "crate::lenient::string")]
24621    pub marker_url: String,
24622    /// Allowed values: `name`.
24623    #[serde(rename = "meetingAt", deserialize_with = "crate::lenient::string")]
24624    pub meeting_at: String,
24625    /// Allowed values: `zip`.
24626    #[serde(deserialize_with = "crate::lenient::string")]
24627    pub postalcode: String,
24628    /// Fields not described by the spec, e.g. instance-specific DB fields.
24629    #[serde(flatten)]
24630    pub extra: serde_json::Map<String, serde_json::Value>,
24631}
24632
24633/// 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.
24634#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24635pub struct SubscriptionGroup {
24636    /// Translation key for a brief description addressed to the end user.
24637    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24638    pub hint: Option<String>,
24639    /// Whether this subscription enables notifications; inactive overrides can suppress an active implicit default.
24640    #[serde(rename = "isActive")]
24641    pub is_active: bool,
24642    /// True for a stored override, false for an implicit default or legacy list alias.
24643    #[serde(rename = "isExplicit")]
24644    pub is_explicit: bool,
24645    /// Audit metadata for explicit overrides; null for implicit defaults and legacy aliases.
24646    #[serde(default, skip_serializing_if = "Option::is_none")]
24647    pub meta: Option<SubscriptionGroupMeta>,
24648    /// Reason this subscription exists; default means an explicit override.
24649    /// Allowed values: `default`, `group-settings`, `meetingrequests-default`, `post-summary-default`, `resource-admin`, `resource-permission`, `resource-root-default`, `servicerequests-default`.
24650    #[serde(deserialize_with = "crate::lenient::string")]
24651    pub origin: String,
24652    /// Deprecated alias for `hint`.
24653    #[serde(rename = "originHint", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24654    #[deprecated = "deprecated in the ChurchTools API"]
24655    pub origin_hint: Option<String>,
24656    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
24657    pub person_id: i64,
24658    /// Subject-specific identifier represented as a string, including numeric IDs.
24659    #[serde(rename = "subjectIdentifier", deserialize_with = "crate::lenient::string")]
24660    pub subject_identifier: String,
24661    /// Subject-specific options; null when none are stored. Most subjects do not interpret these options.
24662    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
24663    pub options: serde_json::Value,
24664    /// Allowed values: `group`.
24665    #[serde(deserialize_with = "crate::lenient::string")]
24666    pub subject: String,
24667    /// Fields not described by the spec, e.g. instance-specific DB fields.
24668    #[serde(flatten)]
24669    pub extra: serde_json::Map<String, serde_json::Value>,
24670}
24671
24672/// Audit metadata for explicit overrides; null for implicit defaults and legacy aliases.
24673#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24674pub struct SubscriptionGroupMeta {
24675    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
24676    #[serde(rename = "createdDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
24677    pub created_date: Option<chrono::DateTime<chrono::Utc>>,
24678    #[serde(rename = "createdPerson", default, skip_serializing_if = "Option::is_none")]
24679    pub created_person: Option<SubscriptionGroupMetaCreatedPerson>,
24680    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
24681    #[serde(rename = "modifiedDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
24682    pub modified_date: Option<chrono::DateTime<chrono::Utc>>,
24683    #[serde(rename = "modifiedPerson", default, skip_serializing_if = "Option::is_none")]
24684    pub modified_person: Option<SubscriptionGroupMetaCreatedPerson>,
24685    /// Fields not described by the spec, e.g. instance-specific DB fields.
24686    #[serde(flatten)]
24687    pub extra: serde_json::Map<String, serde_json::Value>,
24688}
24689
24690#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24691pub struct SubscriptionGroupMetaCreatedPerson {
24692    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
24693    pub id: Option<i64>,
24694    /// Fields not described by the spec, e.g. instance-specific DB fields.
24695    #[serde(flatten)]
24696    pub extra: serde_json::Map<String, serde_json::Value>,
24697}
24698
24699/// Legacy list alias for the corresponding canonical root subscription. Prefer the singular canonical subject for new clients.
24700#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24701pub struct SubscriptionLegacyMeetingRequests {
24702    /// Translation key for a brief description addressed to the end user.
24703    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24704    pub hint: Option<String>,
24705    /// Whether this subscription enables notifications; inactive overrides can suppress an active implicit default.
24706    #[serde(rename = "isActive")]
24707    pub is_active: bool,
24708    /// True for a stored override, false for an implicit default or legacy list alias.
24709    #[serde(rename = "isExplicit")]
24710    pub is_explicit: bool,
24711    /// Audit metadata for explicit overrides; null for implicit defaults and legacy aliases.
24712    #[serde(default, skip_serializing_if = "Option::is_none")]
24713    pub meta: Option<SubscriptionGroupMeta>,
24714    /// Reason this subscription exists; default means an explicit override.
24715    /// Allowed values: `default`, `group-settings`, `meetingrequests-default`, `post-summary-default`, `resource-admin`, `resource-permission`, `resource-root-default`, `servicerequests-default`.
24716    #[serde(deserialize_with = "crate::lenient::string")]
24717    pub origin: String,
24718    /// Deprecated alias for `hint`.
24719    #[serde(rename = "originHint", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24720    #[deprecated = "deprecated in the ChurchTools API"]
24721    pub origin_hint: Option<String>,
24722    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
24723    pub person_id: i64,
24724    #[serde(rename = "subjectIdentifier", deserialize_with = "crate::lenient::string")]
24725    pub subject_identifier: String,
24726    /// Subject-specific options; null when none are stored. Most subjects do not interpret these options.
24727    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
24728    pub options: serde_json::Value,
24729    #[serde(deserialize_with = "crate::lenient::string")]
24730    pub subject: String,
24731    /// Fields not described by the spec, e.g. instance-specific DB fields.
24732    #[serde(flatten)]
24733    pub extra: serde_json::Map<String, serde_json::Value>,
24734}
24735
24736/// Legacy list alias for the corresponding canonical root subscription. Prefer the singular canonical subject for new clients.
24737#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24738pub struct SubscriptionLegacyServiceRequests {
24739    /// Translation key for a brief description addressed to the end user.
24740    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24741    pub hint: Option<String>,
24742    /// Whether this subscription enables notifications; inactive overrides can suppress an active implicit default.
24743    #[serde(rename = "isActive")]
24744    pub is_active: bool,
24745    /// True for a stored override, false for an implicit default or legacy list alias.
24746    #[serde(rename = "isExplicit")]
24747    pub is_explicit: bool,
24748    /// Audit metadata for explicit overrides; null for implicit defaults and legacy aliases.
24749    #[serde(default, skip_serializing_if = "Option::is_none")]
24750    pub meta: Option<SubscriptionGroupMeta>,
24751    /// Reason this subscription exists; default means an explicit override.
24752    /// Allowed values: `default`, `group-settings`, `meetingrequests-default`, `post-summary-default`, `resource-admin`, `resource-permission`, `resource-root-default`, `servicerequests-default`.
24753    #[serde(deserialize_with = "crate::lenient::string")]
24754    pub origin: String,
24755    /// Deprecated alias for `hint`.
24756    #[serde(rename = "originHint", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24757    #[deprecated = "deprecated in the ChurchTools API"]
24758    pub origin_hint: Option<String>,
24759    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
24760    pub person_id: i64,
24761    #[serde(rename = "subjectIdentifier", deserialize_with = "crate::lenient::string")]
24762    pub subject_identifier: String,
24763    /// Subject-specific options; null when none are stored. Most subjects do not interpret these options.
24764    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
24765    pub options: serde_json::Value,
24766    #[serde(deserialize_with = "crate::lenient::string")]
24767    pub subject: String,
24768    /// Fields not described by the spec, e.g. instance-specific DB fields.
24769    #[serde(flatten)]
24770    pub extra: serde_json::Map<String, serde_json::Value>,
24771}
24772
24773/// 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.
24774#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24775pub struct SubscriptionMeetingRequests {
24776    /// Translation key for a brief description addressed to the end user.
24777    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24778    pub hint: Option<String>,
24779    /// Whether this subscription enables notifications; inactive overrides can suppress an active implicit default.
24780    #[serde(rename = "isActive")]
24781    pub is_active: bool,
24782    /// True for a stored override, false for an implicit default or legacy list alias.
24783    #[serde(rename = "isExplicit")]
24784    pub is_explicit: bool,
24785    /// Audit metadata for explicit overrides; null for implicit defaults and legacy aliases.
24786    #[serde(default, skip_serializing_if = "Option::is_none")]
24787    pub meta: Option<SubscriptionGroupMeta>,
24788    /// Reason this subscription exists; default means an explicit override.
24789    /// Allowed values: `default`, `group-settings`, `meetingrequests-default`, `post-summary-default`, `resource-admin`, `resource-permission`, `resource-root-default`, `servicerequests-default`.
24790    #[serde(deserialize_with = "crate::lenient::string")]
24791    pub origin: String,
24792    /// Deprecated alias for `hint`.
24793    #[serde(rename = "originHint", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24794    #[deprecated = "deprecated in the ChurchTools API"]
24795    pub origin_hint: Option<String>,
24796    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
24797    pub person_id: i64,
24798    /// Subject-specific identifier represented as a string, including numeric IDs.
24799    #[serde(rename = "subjectIdentifier", deserialize_with = "crate::lenient::string")]
24800    pub subject_identifier: String,
24801    /// Subject-specific options; null when none are stored. Most subjects do not interpret these options.
24802    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
24803    pub options: serde_json::Value,
24804    /// Allowed values: `meetingrequest`.
24805    #[serde(deserialize_with = "crate::lenient::string")]
24806    pub subject: String,
24807    /// Fields not described by the spec, e.g. instance-specific DB fields.
24808    #[serde(flatten)]
24809    pub extra: serde_json::Map<String, serde_json::Value>,
24810}
24811
24812/// 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.
24813#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24814pub struct SubscriptionPost {
24815    /// Translation key for a brief description addressed to the end user.
24816    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24817    pub hint: Option<String>,
24818    /// Whether this subscription enables notifications; inactive overrides can suppress an active implicit default.
24819    #[serde(rename = "isActive")]
24820    pub is_active: bool,
24821    /// True for a stored override, false for an implicit default or legacy list alias.
24822    #[serde(rename = "isExplicit")]
24823    pub is_explicit: bool,
24824    /// Audit metadata for explicit overrides; null for implicit defaults and legacy aliases.
24825    #[serde(default, skip_serializing_if = "Option::is_none")]
24826    pub meta: Option<SubscriptionGroupMeta>,
24827    /// Reason this subscription exists; default means an explicit override.
24828    /// Allowed values: `default`, `group-settings`, `meetingrequests-default`, `post-summary-default`, `resource-admin`, `resource-permission`, `resource-root-default`, `servicerequests-default`.
24829    #[serde(deserialize_with = "crate::lenient::string")]
24830    pub origin: String,
24831    /// Deprecated alias for `hint`.
24832    #[serde(rename = "originHint", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24833    #[deprecated = "deprecated in the ChurchTools API"]
24834    pub origin_hint: Option<String>,
24835    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
24836    pub person_id: i64,
24837    /// Subject-specific identifier represented as a string, including numeric IDs.
24838    #[serde(rename = "subjectIdentifier", deserialize_with = "crate::lenient::string")]
24839    pub subject_identifier: String,
24840    /// Subject-specific options; null when none are stored. Most subjects do not interpret these options.
24841    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
24842    pub options: serde_json::Value,
24843    /// Allowed values: `post`.
24844    #[serde(deserialize_with = "crate::lenient::string")]
24845    pub subject: String,
24846    /// Fields not described by the spec, e.g. instance-specific DB fields.
24847    #[serde(flatten)]
24848    pub extra: serde_json::Map<String, serde_json::Value>,
24849}
24850
24851/// 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.
24852#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24853pub struct SubscriptionPostSummary {
24854    /// Translation key for a brief description addressed to the end user.
24855    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24856    pub hint: Option<String>,
24857    /// Whether this subscription enables notifications; inactive overrides can suppress an active implicit default.
24858    #[serde(rename = "isActive")]
24859    pub is_active: bool,
24860    /// True for a stored override, false for an implicit default or legacy list alias.
24861    #[serde(rename = "isExplicit")]
24862    pub is_explicit: bool,
24863    /// Audit metadata for explicit overrides; null for implicit defaults and legacy aliases.
24864    #[serde(default, skip_serializing_if = "Option::is_none")]
24865    pub meta: Option<SubscriptionGroupMeta>,
24866    /// Reason this subscription exists; default means an explicit override.
24867    /// Allowed values: `default`, `group-settings`, `meetingrequests-default`, `post-summary-default`, `resource-admin`, `resource-permission`, `resource-root-default`, `servicerequests-default`.
24868    #[serde(deserialize_with = "crate::lenient::string")]
24869    pub origin: String,
24870    /// Deprecated alias for `hint`.
24871    #[serde(rename = "originHint", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24872    #[deprecated = "deprecated in the ChurchTools API"]
24873    pub origin_hint: Option<String>,
24874    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
24875    pub person_id: i64,
24876    /// Subject-specific identifier represented as a string, including numeric IDs.
24877    #[serde(rename = "subjectIdentifier", deserialize_with = "crate::lenient::string")]
24878    pub subject_identifier: String,
24879    pub options: SubscriptionPostSummaryOptions,
24880    /// Allowed values: `post_summary`.
24881    #[serde(deserialize_with = "crate::lenient::string")]
24882    pub subject: String,
24883    /// Fields not described by the spec, e.g. instance-specific DB fields.
24884    #[serde(flatten)]
24885    pub extra: serde_json::Map<String, serde_json::Value>,
24886}
24887
24888#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24889pub struct SubscriptionPostSummaryOptions {
24890    /// Allowed values: `all`, `featured_groups`, `my_campus`, `my_groups`.
24891    #[serde(deserialize_with = "crate::lenient::string")]
24892    pub filter: String,
24893    pub weekdays: Vec<serde_json::Value>,
24894    /// Fields not described by the spec, e.g. instance-specific DB fields.
24895    #[serde(flatten)]
24896    pub extra: serde_json::Map<String, serde_json::Value>,
24897}
24898
24899/// 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.
24900#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24901pub struct SubscriptionPublicChannel {
24902    /// Translation key for a brief description addressed to the end user.
24903    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24904    pub hint: Option<String>,
24905    /// Whether this subscription enables notifications; inactive overrides can suppress an active implicit default.
24906    #[serde(rename = "isActive")]
24907    pub is_active: bool,
24908    /// True for a stored override, false for an implicit default or legacy list alias.
24909    #[serde(rename = "isExplicit")]
24910    pub is_explicit: bool,
24911    /// Audit metadata for explicit overrides; null for implicit defaults and legacy aliases.
24912    #[serde(default, skip_serializing_if = "Option::is_none")]
24913    pub meta: Option<SubscriptionGroupMeta>,
24914    /// Reason this subscription exists; default means an explicit override.
24915    /// Allowed values: `default`, `group-settings`, `meetingrequests-default`, `post-summary-default`, `resource-admin`, `resource-permission`, `resource-root-default`, `servicerequests-default`.
24916    #[serde(deserialize_with = "crate::lenient::string")]
24917    pub origin: String,
24918    /// Deprecated alias for `hint`.
24919    #[serde(rename = "originHint", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24920    #[deprecated = "deprecated in the ChurchTools API"]
24921    pub origin_hint: Option<String>,
24922    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
24923    pub person_id: i64,
24924    /// Subject-specific identifier represented as a string, including numeric IDs.
24925    #[serde(rename = "subjectIdentifier", deserialize_with = "crate::lenient::string")]
24926    pub subject_identifier: String,
24927    /// Subject-specific options; null when none are stored. Most subjects do not interpret these options.
24928    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
24929    pub options: serde_json::Value,
24930    /// Allowed values: `public_channel`.
24931    #[serde(deserialize_with = "crate::lenient::string")]
24932    pub subject: String,
24933    /// Fields not described by the spec, e.g. instance-specific DB fields.
24934    #[serde(flatten)]
24935    pub extra: serde_json::Map<String, serde_json::Value>,
24936}
24937
24938/// 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.
24939#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24940pub struct SubscriptionResource {
24941    /// Translation key for a brief description addressed to the end user.
24942    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24943    pub hint: Option<String>,
24944    /// Whether this subscription enables notifications; inactive overrides can suppress an active implicit default.
24945    #[serde(rename = "isActive")]
24946    pub is_active: bool,
24947    /// True for a stored override, false for an implicit default or legacy list alias.
24948    #[serde(rename = "isExplicit")]
24949    pub is_explicit: bool,
24950    /// Audit metadata for explicit overrides; null for implicit defaults and legacy aliases.
24951    #[serde(default, skip_serializing_if = "Option::is_none")]
24952    pub meta: Option<SubscriptionGroupMeta>,
24953    /// Reason this subscription exists; default means an explicit override.
24954    /// Allowed values: `default`, `group-settings`, `meetingrequests-default`, `post-summary-default`, `resource-admin`, `resource-permission`, `resource-root-default`, `servicerequests-default`.
24955    #[serde(deserialize_with = "crate::lenient::string")]
24956    pub origin: String,
24957    /// Deprecated alias for `hint`.
24958    #[serde(rename = "originHint", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24959    #[deprecated = "deprecated in the ChurchTools API"]
24960    pub origin_hint: Option<String>,
24961    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
24962    pub person_id: i64,
24963    /// root for the resource notification umbrella, or a resource ID as a string. Read results are filtered to administrable resources.
24964    #[serde(rename = "subjectIdentifier", deserialize_with = "crate::lenient::string")]
24965    pub subject_identifier: String,
24966    /// Subject-specific options; null when none are stored. Most subjects do not interpret these options.
24967    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
24968    pub options: serde_json::Value,
24969    /// Allowed values: `resource`.
24970    #[serde(deserialize_with = "crate::lenient::string")]
24971    pub subject: String,
24972    /// Fields not described by the spec, e.g. instance-specific DB fields.
24973    #[serde(flatten)]
24974    pub extra: serde_json::Map<String, serde_json::Value>,
24975}
24976
24977/// 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.
24978#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24979pub struct SubscriptionServiceRequests {
24980    /// Translation key for a brief description addressed to the end user.
24981    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24982    pub hint: Option<String>,
24983    /// Whether this subscription enables notifications; inactive overrides can suppress an active implicit default.
24984    #[serde(rename = "isActive")]
24985    pub is_active: bool,
24986    /// True for a stored override, false for an implicit default or legacy list alias.
24987    #[serde(rename = "isExplicit")]
24988    pub is_explicit: bool,
24989    /// Audit metadata for explicit overrides; null for implicit defaults and legacy aliases.
24990    #[serde(default, skip_serializing_if = "Option::is_none")]
24991    pub meta: Option<SubscriptionGroupMeta>,
24992    /// Reason this subscription exists; default means an explicit override.
24993    /// Allowed values: `default`, `group-settings`, `meetingrequests-default`, `post-summary-default`, `resource-admin`, `resource-permission`, `resource-root-default`, `servicerequests-default`.
24994    #[serde(deserialize_with = "crate::lenient::string")]
24995    pub origin: String,
24996    /// Deprecated alias for `hint`.
24997    #[serde(rename = "originHint", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24998    #[deprecated = "deprecated in the ChurchTools API"]
24999    pub origin_hint: Option<String>,
25000    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
25001    pub person_id: i64,
25002    /// Subject-specific identifier represented as a string, including numeric IDs.
25003    #[serde(rename = "subjectIdentifier", deserialize_with = "crate::lenient::string")]
25004    pub subject_identifier: String,
25005    /// Subject-specific options; null when none are stored. Most subjects do not interpret these options.
25006    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
25007    pub options: serde_json::Value,
25008    /// Allowed values: `servicerequest`.
25009    #[serde(deserialize_with = "crate::lenient::string")]
25010    pub subject: String,
25011    /// Fields not described by the spec, e.g. instance-specific DB fields.
25012    #[serde(flatten)]
25013    pub extra: serde_json::Map<String, serde_json::Value>,
25014}
25015
25016/// Explicit override. Subject and identifier come from the path. post_summary requires PostSummarySubscriptionOptions; other subjects accept optional opaque options.
25017#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25018pub struct SubscriptionUpdate {
25019    /// Omission enables the override, including when replacing an existing inactive setting.
25020    #[serde(rename = "isActive", default, skip_serializing_if = "Option::is_none")]
25021    pub is_active: Option<bool>,
25022    /// Required structured email-summary options for post_summary. For other subjects, omission clears stored options.
25023    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
25024    pub options: serde_json::Value,
25025    /// Fields not described by the spec, e.g. instance-specific DB fields.
25026    #[serde(flatten)]
25027    pub extra: serde_json::Map<String, serde_json::Value>,
25028}
25029
25030#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25031pub struct SumBalanceReportCreate {
25032    /// Accepted by the shared validator but ignored by the sum-balance report.
25033    ///
25034    /// `None` leaves the field out, `Some(None)` sends `null`.
25035    #[serde(rename = "accountTypes", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
25036    pub account_types: Option<Option<Vec<i64>>>,
25037    /// Accounting period owning the accounts. Requires finance edit masterdata or explicit view/edit permission for this period.
25038    #[serde(rename = "accountingPeriodId", deserialize_with = "crate::lenient::number")]
25039    pub accounting_period_id: i64,
25040    /// 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.
25041    /// Allowed values: `csv`, `pdf`, `xlsx`.
25042    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25043    pub format: Option<String>,
25044    /// Calendar month in the year of the accounting period’s start date. The report includes month totals and cumulative totals from January.
25045    #[serde(deserialize_with = "crate::lenient::number")]
25046    pub month: i64,
25047    /// Include account-group grouping/columns in the report.
25048    #[serde(rename = "showAccountGroups", default, skip_serializing_if = "Option::is_none")]
25049    pub show_account_groups: Option<bool>,
25050    /// Include zero-value accounts according to the selected report’s balance/activity calculation.
25051    #[serde(rename = "showEmptyAccounts", default, skip_serializing_if = "Option::is_none")]
25052    pub show_empty_accounts: Option<bool>,
25053    /// Fields not described by the spec, e.g. instance-specific DB fields.
25054    #[serde(flatten)]
25055    pub extra: serde_json::Map<String, serde_json::Value>,
25056}
25057
25058/// Registered adapter service with a masked `token`.
25059#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25060pub struct SyncAdapter {
25061    /// Unique adapter lookup name used by external systems and the proxy.
25062    #[serde(deserialize_with = "crate::lenient::string")]
25063    pub name: String,
25064    /// Fixed mask; the stored token is not returned.
25065    #[serde(deserialize_with = "crate::lenient::string")]
25066    pub token: String,
25067    /// Base URL of the adapter service.
25068    #[serde(deserialize_with = "crate::lenient::string")]
25069    pub url: String,
25070    /// Adapter ID
25071    #[serde(deserialize_with = "crate::lenient::number")]
25072    pub id: i64,
25073    /// Fields not described by the spec, e.g. instance-specific DB fields.
25074    #[serde(flatten)]
25075    pub extra: serde_json::Map<String, serde_json::Value>,
25076}
25077
25078/// Registration of a sync adapter service. Names are configured by the installation, not a fixed list of vendors.
25079#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25080pub struct SyncAdapterCreate {
25081    /// Unique adapter lookup name used by external systems and the proxy.
25082    #[serde(deserialize_with = "crate::lenient::string")]
25083    pub name: String,
25084    /// Authentication token sent to the adapter.
25085    #[serde(deserialize_with = "crate::lenient::string")]
25086    pub token: String,
25087    /// Base URL of the adapter service.
25088    #[serde(deserialize_with = "crate::lenient::string")]
25089    pub url: String,
25090    /// Fields not described by the spec, e.g. instance-specific DB fields.
25091    #[serde(flatten)]
25092    pub extra: serde_json::Map<String, serde_json::Value>,
25093}
25094
25095/// Replaces the adapter name, URL and authentication token.
25096#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25097pub struct SyncAdapterUpdate {
25098    /// Unique adapter lookup name used by external systems and the proxy.
25099    #[serde(deserialize_with = "crate::lenient::string")]
25100    pub name: String,
25101    /// Authentication token sent to the adapter.
25102    #[serde(deserialize_with = "crate::lenient::string")]
25103    pub token: String,
25104    /// Base URL of the adapter service.
25105    #[serde(deserialize_with = "crate::lenient::string")]
25106    pub url: String,
25107    /// Fields not described by the spec, e.g. instance-specific DB fields.
25108    #[serde(flatten)]
25109    pub extra: serde_json::Map<String, serde_json::Value>,
25110}
25111
25112#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25113pub struct SyncConflictCreate {
25114    pub data: Vec<SyncConflictDataCreate>,
25115    /// Relationship affected by the conflict.
25116    #[serde(rename = "entityMappingId", deserialize_with = "crate::lenient::number")]
25117    pub entity_mapping_id: i64,
25118    /// Identifier of the sync job run that produced the conflict; not the numeric job configuration ID.
25119    #[serde(rename = "jobId", deserialize_with = "crate::lenient::string")]
25120    pub job_id: String,
25121    /// Conflict category. Values use underscores and are case-sensitive; CT denotes ChurchTools.
25122    /// Allowed values: `create`, `delete_or_create`, `duplicate_in_CT`, `duplicate_in_source`, `link_and_update`, `update`.
25123    #[serde(deserialize_with = "crate::lenient::string")]
25124    pub r#type: String,
25125    /// Fields not described by the spec, e.g. instance-specific DB fields.
25126    #[serde(flatten)]
25127    pub extra: serde_json::Map<String, serde_json::Value>,
25128}
25129
25130#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25131pub struct SyncConflictData {
25132    /// Conflict-specific data key.
25133    #[serde(deserialize_with = "crate::lenient::string")]
25134    pub key: String,
25135    /// Conflict-specific value.
25136    #[serde(deserialize_with = "crate::lenient::string")]
25137    pub value: String,
25138    /// Fields not described by the spec, e.g. instance-specific DB fields.
25139    #[serde(flatten)]
25140    pub extra: serde_json::Map<String, serde_json::Value>,
25141}
25142
25143#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25144pub struct SyncConflictDataCreate {
25145    #[serde(deserialize_with = "crate::lenient::string")]
25146    pub key: String,
25147    #[serde(deserialize_with = "crate::lenient::string")]
25148    pub value: String,
25149    /// Fields not described by the spec, e.g. instance-specific DB fields.
25150    #[serde(flatten)]
25151    pub extra: serde_json::Map<String, serde_json::Value>,
25152}
25153
25154/// Replace conflict classification, job, entity mapping and the complete data list.
25155#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25156pub struct SyncConflictUpdate {
25157    pub data: Vec<SyncConflictDataCreate>,
25158    /// Relationship affected by the conflict.
25159    #[serde(rename = "entityMappingId", deserialize_with = "crate::lenient::number")]
25160    pub entity_mapping_id: i64,
25161    /// Identifier of the sync job run that produced the conflict; not the numeric job configuration ID.
25162    #[serde(rename = "jobId", deserialize_with = "crate::lenient::string")]
25163    pub job_id: String,
25164    /// Conflict category. Values use underscores and are case-sensitive; CT denotes ChurchTools.
25165    /// Allowed values: `create`, `delete_or_create`, `duplicate_in_CT`, `duplicate_in_source`, `link_and_update`, `update`.
25166    #[serde(deserialize_with = "crate::lenient::string")]
25167    pub r#type: String,
25168    /// Fields not described by the spec, e.g. instance-specific DB fields.
25169    #[serde(flatten)]
25170    pub extra: serde_json::Map<String, serde_json::Value>,
25171}
25172
25173/// Stored conflict record. Updating or deleting this record does not itself synchronize or resolve the underlying entities.
25174#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25175pub struct SyncConflicts {
25176    pub data: Vec<SyncConflictData>,
25177    /// Relationship affected by the conflict.
25178    #[serde(rename = "entityMappingId", deserialize_with = "crate::lenient::number")]
25179    pub entity_mapping_id: i64,
25180    /// Conflict ID
25181    #[serde(deserialize_with = "crate::lenient::number")]
25182    pub id: i64,
25183    /// Identifier of the sync job run that produced the conflict; not the numeric job configuration ID.
25184    #[serde(rename = "jobId", deserialize_with = "crate::lenient::string")]
25185    pub job_id: String,
25186    pub meta: MetaDataEntityId,
25187    /// Conflict category. Values use underscores and are case-sensitive; CT denotes ChurchTools.
25188    /// Allowed values: `create`, `delete_or_create`, `duplicate_in_CT`, `duplicate_in_source`, `link_and_update`, `update`.
25189    #[serde(deserialize_with = "crate::lenient::string")]
25190    pub r#type: String,
25191    /// Fields not described by the spec, e.g. instance-specific DB fields.
25192    #[serde(flatten)]
25193    pub extra: serde_json::Map<String, serde_json::Value>,
25194}
25195
25196/// Stored link between a ChurchTools entity and an external record; deleting it does not delete either record.
25197#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25198pub struct SyncEntityMapping {
25199    /// ChurchTools entity ID as text.
25200    #[serde(rename = "domainId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25201    pub domain_id: Option<String>,
25202    /// ChurchTools domain types accepted by entity and field mapping validation. Adapter support can be a smaller subset.
25203    /// 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`, ….
25204    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
25205    pub domain_type: String,
25206    /// Mapping ID
25207    #[serde(deserialize_with = "crate::lenient::number")]
25208    pub id: i64,
25209    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
25210    #[serde(rename = "lastSyncedDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
25211    pub last_synced_date: Option<chrono::DateTime<chrono::Utc>>,
25212    pub meta: MetaDataEntityId,
25213    /// Adapter-specific context key.
25214    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25215    pub scope: Option<String>,
25216    /// ID in the external system.
25217    #[serde(rename = "sourceEntityId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25218    pub source_entity_id: Option<String>,
25219    /// External connection ID (the source system).
25220    #[serde(rename = "sourceId", deserialize_with = "crate::lenient::number")]
25221    pub source_id: i64,
25222    /// State of the relationship: synchronized, unresolved conflict, or deleted in ChurchTools.
25223    /// Allowed values: `conflict`, `deleted in CT`, `synced`.
25224    #[serde(deserialize_with = "crate::lenient::string")]
25225    pub status: String,
25226    /// Fields not described by the spec, e.g. instance-specific DB fields.
25227    #[serde(flatten)]
25228    pub extra: serde_json::Map<String, serde_json::Value>,
25229}
25230
25231/// Persists a record relationship. Provided ChurchTools or external IDs must not be linked for the same domain and source.
25232#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25233pub struct SyncEntityMappingCreate {
25234    /// ChurchTools entity ID as text.
25235    #[serde(rename = "domainId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25236    pub domain_id: Option<String>,
25237    /// ChurchTools domain types accepted by entity and field mapping validation. Adapter support can be a smaller subset.
25238    /// 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`, ….
25239    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
25240    pub domain_type: String,
25241    /// Last synchronization timestamp. Prefer an explicit timezone.
25242    ///
25243    /// `None` leaves the field out, `Some(None)` sends `null`.
25244    #[serde(rename = "lastSyncedDate", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
25245    pub last_synced_date: Option<Option<chrono::DateTime<chrono::Utc>>>,
25246    /// Adapter-specific context key.
25247    ///
25248    /// `None` leaves the field out, `Some(None)` sends `null`.
25249    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
25250    pub scope: Option<Option<String>>,
25251    /// ID in the external system.
25252    #[serde(rename = "sourceEntityId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25253    pub source_entity_id: Option<String>,
25254    /// External connection ID (the source system).
25255    #[serde(rename = "sourceId", deserialize_with = "crate::lenient::number")]
25256    pub source_id: i64,
25257    /// State of the relationship: synchronized, unresolved conflict, or deleted in ChurchTools.
25258    /// Allowed values: `conflict`, `deleted in CT`, `synced`.
25259    #[serde(deserialize_with = "crate::lenient::string")]
25260    pub status: String,
25261    /// Fields not described by the spec, e.g. instance-specific DB fields.
25262    #[serde(flatten)]
25263    pub extra: serde_json::Map<String, serde_json::Value>,
25264}
25265
25266/// Replaces a record relationship.
25267#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25268pub struct SyncEntityMappingUpdate {
25269    /// ChurchTools entity ID as text.
25270    #[serde(rename = "domainId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25271    pub domain_id: Option<String>,
25272    /// ChurchTools domain types accepted by entity and field mapping validation. Adapter support can be a smaller subset.
25273    /// 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`, ….
25274    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
25275    pub domain_type: String,
25276    /// Last synchronization timestamp. Prefer an explicit timezone.
25277    ///
25278    /// `None` leaves the field out, `Some(None)` sends `null`.
25279    #[serde(rename = "lastSyncedDate", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
25280    pub last_synced_date: Option<Option<chrono::DateTime<chrono::Utc>>>,
25281    /// Adapter-specific context key.
25282    ///
25283    /// `None` leaves the field out, `Some(None)` sends `null`.
25284    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
25285    pub scope: Option<Option<String>>,
25286    /// ID in the external system.
25287    #[serde(rename = "sourceEntityId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25288    pub source_entity_id: Option<String>,
25289    /// External connection ID (the source system).
25290    #[serde(rename = "sourceId", deserialize_with = "crate::lenient::number")]
25291    pub source_id: i64,
25292    /// State of the relationship: synchronized, unresolved conflict, or deleted in ChurchTools.
25293    /// Allowed values: `conflict`, `deleted in CT`, `synced`.
25294    #[serde(deserialize_with = "crate::lenient::string")]
25295    pub status: String,
25296    /// Fields not described by the spec, e.g. instance-specific DB fields.
25297    #[serde(flatten)]
25298    pub extra: serde_json::Map<String, serde_json::Value>,
25299}
25300
25301#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25302pub struct SyncExecutionBehavior {
25303    pub create: SyncExecutionBehaviorCreate,
25304    pub delete: SyncExecutionBehaviorDelete,
25305    pub link: SyncExecutionBehaviorLink,
25306    pub update: SyncExecutionBehaviorUpdate,
25307    /// Fields not described by the spec, e.g. instance-specific DB fields.
25308    #[serde(flatten)]
25309    pub extra: serde_json::Map<String, serde_json::Value>,
25310}
25311
25312#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25313pub struct SyncExecutionBehaviorCreate {
25314    /// Whether records may be created or updated.
25315    /// Allowed values: `always`, `never`.
25316    #[serde(rename = "behaviorES", deserialize_with = "crate::lenient::string")]
25317    pub behavior_es: String,
25318    /// Whether records may be created or updated.
25319    /// Allowed values: `always`, `never`.
25320    #[serde(rename = "behaviorMaster", deserialize_with = "crate::lenient::string")]
25321    pub behavior_master: String,
25322    /// Adapter-specific JSON object or list.
25323    #[serde(rename = "defaultsES", default, skip_serializing_if = "serde_json::Value::is_null")]
25324    pub defaults_es: serde_json::Value,
25325    /// Adapter-specific JSON object or list.
25326    #[serde(rename = "defaultsMaster", default, skip_serializing_if = "serde_json::Value::is_null")]
25327    pub defaults_master: serde_json::Value,
25328    /// Fields not described by the spec, e.g. instance-specific DB fields.
25329    #[serde(flatten)]
25330    pub extra: serde_json::Map<String, serde_json::Value>,
25331}
25332
25333#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25334pub struct SyncExecutionBehaviorDelete {
25335    /// How deletions are handled on the specified side: retain, archive or delete.
25336    /// Allowed values: `alwaysArchive`, `alwaysDelete`, `never`.
25337    #[serde(rename = "behaviorES", deserialize_with = "crate::lenient::string")]
25338    pub behavior_es: String,
25339    /// How deletions are handled on the specified side: retain, archive or delete.
25340    /// Allowed values: `alwaysArchive`, `alwaysDelete`, `never`.
25341    #[serde(rename = "behaviorMaster", deserialize_with = "crate::lenient::string")]
25342    pub behavior_master: String,
25343    /// Fields not described by the spec, e.g. instance-specific DB fields.
25344    #[serde(flatten)]
25345    pub extra: serde_json::Map<String, serde_json::Value>,
25346}
25347
25348#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25349pub struct SyncExecutionBehaviorLink {
25350    /// Whether matching records are linked: never, use an existing record, or merge when linking.
25351    /// Allowed values: `alwaysMerge`, `alwaysUse`, `never`.
25352    #[serde(deserialize_with = "crate::lenient::string")]
25353    pub behavior: String,
25354    /// Which side supplies data: the most recently updated record, ChurchTools, or the external system.
25355    /// Allowed values: `es`, `lastUpdated`, `master`.
25356    #[serde(deserialize_with = "crate::lenient::string")]
25357    pub data: String,
25358    /// Fields not described by the spec, e.g. instance-specific DB fields.
25359    #[serde(flatten)]
25360    pub extra: serde_json::Map<String, serde_json::Value>,
25361}
25362
25363#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25364pub struct SyncExecutionBehaviorUpdate {
25365    /// Whether records may be created or updated.
25366    /// Allowed values: `always`, `never`.
25367    #[serde(deserialize_with = "crate::lenient::string")]
25368    pub behavior: String,
25369    /// Which side supplies data: the most recently updated record, ChurchTools, or the external system.
25370    /// Allowed values: `es`, `lastUpdated`, `master`.
25371    #[serde(deserialize_with = "crate::lenient::string")]
25372    pub data: String,
25373    /// Fields not described by the spec, e.g. instance-specific DB fields.
25374    #[serde(flatten)]
25375    pub extra: serde_json::Map<String, serde_json::Value>,
25376}
25377
25378#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25379pub struct SyncExecutionCounts {
25380    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
25381    pub create: Option<i64>,
25382    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
25383    pub delete: Option<i64>,
25384    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
25385    pub link: Option<i64>,
25386    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
25387    pub update: Option<i64>,
25388    /// Fields not described by the spec, e.g. instance-specific DB fields.
25389    #[serde(flatten)]
25390    pub extra: serde_json::Map<String, serde_json::Value>,
25391}
25392
25393#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25394pub struct SyncExecutionCreate {
25395    /// Schedule a dry run; the worker is instructed not to change synchronized records.
25396    #[serde(rename = "isDryRun", default, skip_serializing_if = "Option::is_none")]
25397    pub is_dry_run: Option<bool>,
25398    /// Schedule configuration validation only.
25399    #[serde(rename = "isValidationOnly", default, skip_serializing_if = "Option::is_none")]
25400    pub is_validation_only: Option<bool>,
25401    /// Fields not described by the spec, e.g. instance-specific DB fields.
25402    #[serde(flatten)]
25403    pub extra: serde_json::Map<String, serde_json::Value>,
25404}
25405
25406#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25407pub struct SyncExecutionDetails {
25408    /// Domain saved with this execution.
25409    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
25410    pub domain_type: String,
25411    /// Filter snapshot indexed by domain, then by ES and Master.
25412    #[serde(deserialize_with = "crate::lenient::map")]
25413    pub filter: std::collections::BTreeMap<String, SyncExecutionDetailsFilterValue>,
25414    /// Numeric job configuration ID.
25415    #[serde(rename = "jobId", deserialize_with = "crate::lenient::number")]
25416    pub job_id: i64,
25417    /// Mapping snapshot indexed by the configured domain name.
25418    #[serde(deserialize_with = "crate::lenient::map")]
25419    pub mapping: std::collections::BTreeMap<String, SyncExecutionMapping>,
25420    #[serde(rename = "syncBehavior")]
25421    pub sync_behavior: SyncExecutionBehavior,
25422    #[serde(rename = "systemES")]
25423    pub system_es: SyncExecutionDetailsSystemES,
25424    /// Adapter credentials are removed from this snapshot.
25425    #[serde(rename = "systemMaster")]
25426    pub system_master: Vec<serde_json::Value>,
25427    #[serde(rename = "validationOnly")]
25428    pub validation_only: bool,
25429    /// Fields not described by the spec, e.g. instance-specific DB fields.
25430    #[serde(flatten)]
25431    pub extra: serde_json::Map<String, serde_json::Value>,
25432}
25433
25434#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25435pub struct SyncExecutionDetailsFilterValue {
25436    #[serde(rename = "ES")]
25437    pub es: Vec<SyncJobFilter>,
25438    #[serde(rename = "Master")]
25439    pub master: Vec<SyncJobFilter>,
25440    /// Fields not described by the spec, e.g. instance-specific DB fields.
25441    #[serde(flatten)]
25442    pub extra: serde_json::Map<String, serde_json::Value>,
25443}
25444
25445#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25446pub struct SyncExecutionDetailsSystemES {
25447    /// External connection ID.
25448    #[serde(rename = "systemId", deserialize_with = "crate::lenient::number")]
25449    pub system_id: i64,
25450    /// External connection name.
25451    #[serde(rename = "systemName", deserialize_with = "crate::lenient::string")]
25452    pub system_name: String,
25453    /// Fields not described by the spec, e.g. instance-specific DB fields.
25454    #[serde(flatten)]
25455    pub extra: serde_json::Map<String, serde_json::Value>,
25456}
25457
25458#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25459pub struct SyncExecutionMapping {
25460    #[serde(rename = "propertyMappingsESToMaster", default, skip_serializing_if = "serde_json::Value::is_null")]
25461    pub property_mappings_es_to_master: serde_json::Value,
25462    #[serde(rename = "propertyMappingsMasterToES", default, skip_serializing_if = "serde_json::Value::is_null")]
25463    pub property_mappings_master_to_es: serde_json::Value,
25464    /// Fields not described by the spec, e.g. instance-specific DB fields.
25465    #[serde(flatten)]
25466    pub extra: serde_json::Map<String, serde_json::Value>,
25467}
25468
25469/// Stored directional field mapping. No separate entry ID is returned.
25470#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25471pub struct SyncExecutionProperty {
25472    /// Source field name supported by the adapter.
25473    #[serde(deserialize_with = "crate::lenient::string")]
25474    pub from: String,
25475    /// Adapter-specific source-field qualifier.
25476    #[serde(rename = "fromFilter", deserialize_with = "crate::lenient::string")]
25477    pub from_filter: String,
25478    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
25479    pub others: serde_json::Value,
25480    /// Side of synchronization: `master` is ChurchTools and `es` is the configured external system.
25481    /// Allowed values: `es`, `master`.
25482    #[serde(deserialize_with = "crate::lenient::string")]
25483    pub system: String,
25484    /// Target field name supported by the adapter.
25485    #[serde(deserialize_with = "crate::lenient::string")]
25486    pub to: String,
25487    /// Adapter-specific target-field qualifier.
25488    #[serde(rename = "toFilter", deserialize_with = "crate::lenient::string")]
25489    pub to_filter: String,
25490    #[serde(rename = "valueMapping", default, skip_serializing_if = "serde_json::Value::is_null")]
25491    pub value_mapping: serde_json::Value,
25492    /// Fields not described by the spec, e.g. instance-specific DB fields.
25493    #[serde(flatten)]
25494    pub extra: serde_json::Map<String, serde_json::Value>,
25495}
25496
25497#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25498pub struct SyncExecutionSummary {
25499    pub both: SyncExecutionCounts,
25500    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
25501    #[serde(rename = "createdDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
25502    pub created_date: Option<chrono::DateTime<chrono::Utc>>,
25503    /// Latest log timestamp; this is not necessarily a completion timestamp.
25504    #[serde(rename = "endDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
25505    pub end_date: Option<chrono::DateTime<chrono::Utc>>,
25506    #[serde(rename = "errorCount", deserialize_with = "crate::lenient::number")]
25507    pub error_count: i64,
25508    pub es: SyncExecutionCounts,
25509    /// Background execution ID.
25510    #[serde(rename = "executionId", deserialize_with = "crate::lenient::string")]
25511    pub execution_id: String,
25512    #[serde(rename = "isDryRun")]
25513    pub is_dry_run: bool,
25514    /// Numeric sync job configuration ID.
25515    #[serde(rename = "jobId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
25516    pub job_id: Option<i64>,
25517    pub master: SyncExecutionCounts,
25518    /// Earliest log timestamp.
25519    #[serde(rename = "startDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
25520    pub start_date: Option<chrono::DateTime<chrono::Utc>>,
25521    /// Background execution status, distinct from entity mapping status.
25522    /// Allowed values: `CANCELED`, `DONE`, `ERROR`, `IN_PROGRESS`, `QUEUED`.
25523    #[serde(deserialize_with = "crate::lenient::string")]
25524    pub status: String,
25525    /// Fields not described by the spec, e.g. instance-specific DB fields.
25526    #[serde(flatten)]
25527    pub extra: serde_json::Map<String, serde_json::Value>,
25528}
25529
25530/// Proposed connection settings to test. `id` loads an existing connection and merges the supplied headers before testing; connection configuration is not saved.
25531#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25532pub struct SyncExternalSystemTestCreate {
25533    /// Adapter-specific HTTP header values used to access the external system.
25534    #[serde(rename = "accessHeaderValues", default, skip_serializing_if = "serde_json::Value::is_null")]
25535    pub access_header_values: serde_json::Value,
25536    /// Name of a registered adapter from `/sync/adapters`. Custom adapter names are supported.
25537    #[serde(deserialize_with = "crate::lenient::string")]
25538    pub adapter: String,
25539    /// Display name of the external connection.
25540    #[serde(deserialize_with = "crate::lenient::string")]
25541    pub name: String,
25542    /// Existing connection to base the test on.
25543    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
25544    pub id: Option<i64>,
25545    /// Fields not described by the spec, e.g. instance-specific DB fields.
25546    #[serde(flatten)]
25547    pub extra: serde_json::Map<String, serde_json::Value>,
25548}
25549
25550#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25551pub struct SyncFieldMappingEntries {
25552    #[serde(rename = "propertyMappingsESToMaster")]
25553    pub property_mappings_es_to_master: Vec<FieldMappingEntry>,
25554    #[serde(rename = "propertyMappingsMasterToES")]
25555    pub property_mappings_master_to_es: Vec<FieldMappingEntry>,
25556    /// Fields not described by the spec, e.g. instance-specific DB fields.
25557    #[serde(flatten)]
25558    pub extra: serde_json::Map<String, serde_json::Value>,
25559}
25560
25561#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25562pub struct SyncFieldMappingEntryCreate {
25563    /// Source field name supported by the adapter.
25564    #[serde(deserialize_with = "crate::lenient::string")]
25565    pub from: String,
25566    /// Adapter-specific source-field qualifier.
25567    #[serde(rename = "fromFilter", deserialize_with = "crate::lenient::string")]
25568    pub from_filter: String,
25569    /// Adapter-specific JSON object or list.
25570    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
25571    pub others: serde_json::Value,
25572    /// Target field name supported by the adapter.
25573    #[serde(deserialize_with = "crate::lenient::string")]
25574    pub to: String,
25575    /// Adapter-specific target-field qualifier.
25576    #[serde(rename = "toFilter", deserialize_with = "crate::lenient::string")]
25577    pub to_filter: String,
25578    /// Adapter-specific JSON object or list.
25579    #[serde(rename = "valueMapping", default, skip_serializing_if = "serde_json::Value::is_null")]
25580    pub value_mapping: serde_json::Value,
25581    /// Fields not described by the spec, e.g. instance-specific DB fields.
25582    #[serde(flatten)]
25583    pub extra: serde_json::Map<String, serde_json::Value>,
25584}
25585
25586/// Replaces both direction lists. The enclosing list sets `system`.
25587#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25588pub struct SyncFieldMappingUpdate {
25589    #[serde(rename = "propertyMappingsESToMaster")]
25590    pub property_mappings_es_to_master: Vec<SyncFieldMappingEntryCreate>,
25591    #[serde(rename = "propertyMappingsMasterToES")]
25592    pub property_mappings_master_to_es: Vec<SyncFieldMappingEntryCreate>,
25593    /// Fields not described by the spec, e.g. instance-specific DB fields.
25594    #[serde(flatten)]
25595    pub extra: serde_json::Map<String, serde_json::Value>,
25596}
25597
25598#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25599pub struct SyncJobConfigurationCreate {
25600    /// Whether the periodic scheduler can start this job.
25601    #[serde(rename = "autoScheduleEnabled")]
25602    pub auto_schedule_enabled: bool,
25603    /// Whether records may be created or updated.
25604    /// Allowed values: `always`, `never`.
25605    #[serde(rename = "createBehaviorES", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25606    pub create_behavior_es: Option<String>,
25607    /// Whether records may be created or updated.
25608    /// Allowed values: `always`, `never`.
25609    #[serde(rename = "createBehaviorMaster", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25610    pub create_behavior_master: Option<String>,
25611    #[serde(rename = "createDefaultsES", default, skip_serializing_if = "serde_json::Value::is_null")]
25612    pub create_defaults_es: serde_json::Value,
25613    #[serde(rename = "createDefaultsMaster", default, skip_serializing_if = "serde_json::Value::is_null")]
25614    pub create_defaults_master: serde_json::Value,
25615    /// How deletions are handled on the specified side: retain, archive or delete.
25616    /// Allowed values: `alwaysArchive`, `alwaysDelete`, `never`.
25617    #[serde(rename = "deleteBehaviorES", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25618    pub delete_behavior_es: Option<String>,
25619    /// How deletions are handled on the specified side: retain, archive or delete.
25620    /// Allowed values: `alwaysArchive`, `alwaysDelete`, `never`.
25621    #[serde(rename = "deleteBehaviorMaster", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25622    pub delete_behavior_master: Option<String>,
25623    /// Domain supported by the adapter, such as person. Job configuration accepts adapter-specific domain names.
25624    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
25625    pub domain_type: String,
25626    /// Whether matching records are linked: never, use an existing record, or merge when linking.
25627    /// Allowed values: `alwaysMerge`, `alwaysUse`, `never`.
25628    #[serde(rename = "linkBehavior", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25629    pub link_behavior: Option<String>,
25630    /// Which side supplies data: the most recently updated record, ChurchTools, or the external system.
25631    /// Allowed values: `es`, `lastUpdated`, `master`.
25632    #[serde(rename = "linkData", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25633    pub link_data: Option<String>,
25634    /// Job display name.
25635    #[serde(deserialize_with = "crate::lenient::string")]
25636    pub name: String,
25637    /// Whether records may be created or updated.
25638    /// Allowed values: `always`, `never`.
25639    #[serde(rename = "updateBehavior", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25640    pub update_behavior: Option<String>,
25641    /// Which side supplies data: the most recently updated record, ChurchTools, or the external system.
25642    /// Allowed values: `es`, `lastUpdated`, `master`.
25643    #[serde(rename = "updateData", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25644    pub update_data: Option<String>,
25645    /// Fields not described by the spec, e.g. instance-specific DB fields.
25646    #[serde(flatten)]
25647    pub extra: serde_json::Map<String, serde_json::Value>,
25648}
25649
25650/// Updates the job configuration.
25651#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25652pub struct SyncJobConfigurationUpdate {
25653    /// Whether the periodic scheduler can start this job.
25654    #[serde(rename = "autoScheduleEnabled")]
25655    pub auto_schedule_enabled: bool,
25656    /// Whether records may be created or updated.
25657    /// Allowed values: `always`, `never`.
25658    #[serde(rename = "createBehaviorES", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25659    pub create_behavior_es: Option<String>,
25660    /// Whether records may be created or updated.
25661    /// Allowed values: `always`, `never`.
25662    #[serde(rename = "createBehaviorMaster", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25663    pub create_behavior_master: Option<String>,
25664    /// Adapter-specific defaults for newly created records on this side.
25665    #[serde(rename = "createDefaultsES", default, skip_serializing_if = "serde_json::Value::is_null")]
25666    pub create_defaults_es: serde_json::Value,
25667    /// Adapter-specific defaults for newly created records on this side.
25668    #[serde(rename = "createDefaultsMaster", default, skip_serializing_if = "serde_json::Value::is_null")]
25669    pub create_defaults_master: serde_json::Value,
25670    /// How deletions are handled on the specified side: retain, archive or delete.
25671    /// Allowed values: `alwaysArchive`, `alwaysDelete`, `never`.
25672    #[serde(rename = "deleteBehaviorES", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25673    pub delete_behavior_es: Option<String>,
25674    /// How deletions are handled on the specified side: retain, archive or delete.
25675    /// Allowed values: `alwaysArchive`, `alwaysDelete`, `never`.
25676    #[serde(rename = "deleteBehaviorMaster", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25677    pub delete_behavior_master: Option<String>,
25678    /// Domain supported by the adapter, such as person. Job configuration accepts adapter-specific domain names.
25679    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
25680    pub domain_type: String,
25681    /// Whether matching records are linked: never, use an existing record, or merge when linking.
25682    /// Allowed values: `alwaysMerge`, `alwaysUse`, `never`.
25683    #[serde(rename = "linkBehavior", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25684    pub link_behavior: Option<String>,
25685    /// Which side supplies data: the most recently updated record, ChurchTools, or the external system.
25686    /// Allowed values: `es`, `lastUpdated`, `master`.
25687    #[serde(rename = "linkData", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25688    pub link_data: Option<String>,
25689    /// Job display name.
25690    #[serde(deserialize_with = "crate::lenient::string")]
25691    pub name: String,
25692    /// Whether records may be created or updated.
25693    /// Allowed values: `always`, `never`.
25694    #[serde(rename = "updateBehavior", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25695    pub update_behavior: Option<String>,
25696    /// Which side supplies data: the most recently updated record, ChurchTools, or the external system.
25697    /// Allowed values: `es`, `lastUpdated`, `master`.
25698    #[serde(rename = "updateData", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25699    pub update_data: Option<String>,
25700    /// Existing job configuration ID.
25701    #[serde(deserialize_with = "crate::lenient::number")]
25702    pub id: i64,
25703    /// Fields not described by the spec, e.g. instance-specific DB fields.
25704    #[serde(flatten)]
25705    pub extra: serde_json::Map<String, serde_json::Value>,
25706}
25707
25708#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25709pub struct SyncJobFilter {
25710    /// Adapter field to filter.
25711    #[serde(deserialize_with = "crate::lenient::string")]
25712    pub field: String,
25713    /// Adapter-specific comparison operator. ChurchTools does not enforce a fixed operator list.
25714    #[serde(deserialize_with = "crate::lenient::string")]
25715    pub operator: String,
25716    /// Side of synchronization: `master` is ChurchTools and `es` is the configured external system.
25717    /// Allowed values: `es`, `master`.
25718    #[serde(deserialize_with = "crate::lenient::string")]
25719    pub system: String,
25720    /// Adapter-specific filter values.
25721    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
25722    pub values: serde_json::Value,
25723    /// Fields not described by the spec, e.g. instance-specific DB fields.
25724    #[serde(flatten)]
25725    pub extra: serde_json::Map<String, serde_json::Value>,
25726}
25727
25728#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25729pub struct SyncJobFilterCreate {
25730    /// Adapter field to filter.
25731    #[serde(deserialize_with = "crate::lenient::string")]
25732    pub field: String,
25733    /// Adapter-specific comparison operator. ChurchTools does not enforce a fixed operator list.
25734    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25735    pub operator: Option<String>,
25736    /// Side of synchronization: `master` is ChurchTools and `es` is the configured external system.
25737    /// Allowed values: `es`, `master`.
25738    #[serde(deserialize_with = "crate::lenient::string")]
25739    pub system: String,
25740    /// Filter values passed to the adapter. Value types depend on the field and adapter.
25741    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
25742    pub values: serde_json::Value,
25743    /// Fields not described by the spec, e.g. instance-specific DB fields.
25744    #[serde(flatten)]
25745    pub extra: serde_json::Map<String, serde_json::Value>,
25746}
25747
25748#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25749pub struct SyncJobFilters {
25750    pub es: Vec<SyncJobFilter>,
25751    pub master: Vec<SyncJobFilter>,
25752    /// Fields not described by the spec, e.g. instance-specific DB fields.
25753    #[serde(flatten)]
25754    pub extra: serde_json::Map<String, serde_json::Value>,
25755}
25756
25757/// Replaces all job filters, grouped by each entry's `system`.
25758#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25759pub struct SyncJobFiltersUpdate {
25760    pub es: Vec<SyncJobFilterCreate>,
25761    pub master: Vec<SyncJobFilterCreate>,
25762    /// Fields not described by the spec, e.g. instance-specific DB fields.
25763    #[serde(flatten)]
25764    pub extra: serde_json::Map<String, serde_json::Value>,
25765}
25766
25767#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25768pub struct SyncJobProperties {
25769    /// Domain configured for the job.
25770    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
25771    pub domain_type: String,
25772    /// Configured external connection with masked access credentials.
25773    #[serde(rename = "externalSystem")]
25774    pub external_system: ExternalSystem,
25775    pub properties: SyncJobPropertyLists,
25776    /// Fields not described by the spec, e.g. instance-specific DB fields.
25777    #[serde(flatten)]
25778    pub extra: serde_json::Map<String, serde_json::Value>,
25779}
25780
25781/// Replaces the selected fields in both directions. Each entry's `system` determines its stored direction.
25782#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25783pub struct SyncJobPropertiesUpdate {
25784    #[serde(rename = "propertyMappingsESToMaster")]
25785    pub property_mappings_es_to_master: Vec<SyncJobPropertyCreate>,
25786    #[serde(rename = "propertyMappingsMasterToES")]
25787    pub property_mappings_master_to_es: Vec<SyncJobPropertyCreate>,
25788    /// Fields not described by the spec, e.g. instance-specific DB fields.
25789    #[serde(flatten)]
25790    pub extra: serde_json::Map<String, serde_json::Value>,
25791}
25792
25793/// Selected job field. `valueMapping` and `others` are resolved from the referenced field mapping.
25794#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25795pub struct SyncJobProperty {
25796    /// Field mapping whose domain must match the job.
25797    #[serde(rename = "fieldMappingId", deserialize_with = "crate::lenient::number")]
25798    pub field_mapping_id: i64,
25799    /// Source field name supported by the adapter.
25800    #[serde(deserialize_with = "crate::lenient::string")]
25801    pub from: String,
25802    /// Adapter-specific source-field qualifier.
25803    #[serde(rename = "fromFilter", deserialize_with = "crate::lenient::string")]
25804    pub from_filter: String,
25805    /// Side of synchronization: `master` is ChurchTools and `es` is the configured external system.
25806    /// Allowed values: `es`, `master`.
25807    #[serde(deserialize_with = "crate::lenient::string")]
25808    pub system: String,
25809    /// Target field name supported by the adapter.
25810    #[serde(deserialize_with = "crate::lenient::string")]
25811    pub to: String,
25812    /// Adapter-specific target-field qualifier.
25813    #[serde(rename = "toFilter", deserialize_with = "crate::lenient::string")]
25814    pub to_filter: String,
25815    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
25816    pub others: serde_json::Value,
25817    #[serde(rename = "valueMapping", default, skip_serializing_if = "serde_json::Value::is_null")]
25818    pub value_mapping: serde_json::Value,
25819    /// Fields not described by the spec, e.g. instance-specific DB fields.
25820    #[serde(flatten)]
25821    pub extra: serde_json::Map<String, serde_json::Value>,
25822}
25823
25824#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25825pub struct SyncJobPropertyCreate {
25826    /// Field mapping whose domain must match the job.
25827    #[serde(rename = "fieldMappingId", deserialize_with = "crate::lenient::number")]
25828    pub field_mapping_id: i64,
25829    /// Source field name supported by the adapter.
25830    #[serde(deserialize_with = "crate::lenient::string")]
25831    pub from: String,
25832    /// Adapter-specific source-field qualifier.
25833    #[serde(rename = "fromFilter", deserialize_with = "crate::lenient::string")]
25834    pub from_filter: String,
25835    /// Side of synchronization: `master` is ChurchTools and `es` is the configured external system.
25836    /// Allowed values: `es`, `master`.
25837    #[serde(deserialize_with = "crate::lenient::string")]
25838    pub system: String,
25839    /// Target field name supported by the adapter.
25840    #[serde(deserialize_with = "crate::lenient::string")]
25841    pub to: String,
25842    /// Adapter-specific target-field qualifier.
25843    #[serde(rename = "toFilter", deserialize_with = "crate::lenient::string")]
25844    pub to_filter: String,
25845    /// Fields not described by the spec, e.g. instance-specific DB fields.
25846    #[serde(flatten)]
25847    pub extra: serde_json::Map<String, serde_json::Value>,
25848}
25849
25850#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25851pub struct SyncJobPropertyLists {
25852    #[serde(rename = "propertyMappingsESToMaster")]
25853    pub property_mappings_es_to_master: Vec<SyncJobProperty>,
25854    #[serde(rename = "propertyMappingsMasterToES")]
25855    pub property_mappings_master_to_es: Vec<SyncJobProperty>,
25856    /// Fields not described by the spec, e.g. instance-specific DB fields.
25857    #[serde(flatten)]
25858    pub extra: serde_json::Map<String, serde_json::Value>,
25859}
25860
25861/// Log entry during a sync execution.
25862#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25863pub struct SyncLog {
25864    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
25865    #[serde(serialize_with = "crate::datetime::serialize_utc")]
25866    pub date: chrono::DateTime<chrono::Utc>,
25867    /// `domainId` of the affected record.
25868    #[serde(rename = "domainId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25869    pub domain_id: Option<String>,
25870    /// `domainType` of the affected record.
25871    #[serde(rename = "domainType", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25872    pub domain_type: Option<String>,
25873    /// Background execution identifier.
25874    #[serde(rename = "executionId", deserialize_with = "crate::lenient::string")]
25875    pub execution_id: String,
25876    #[serde(deserialize_with = "crate::lenient::number")]
25877    pub id: i64,
25878    #[serde(rename = "isDryRun")]
25879    pub is_dry_run: bool,
25880    pub job: SyncLogJob,
25881    /// PSR log severity.
25882    /// Allowed values: `alert`, `critical`, `debug`, `emergency`, `error`, `info`, `notice`, `warning`.
25883    #[serde(deserialize_with = "crate::lenient::string")]
25884    pub level: String,
25885    /// Rendered, translated log message including formatted changes. Original messageKey and args are not returned.
25886    #[serde(deserialize_with = "crate::lenient::string")]
25887    pub message: String,
25888    /// `sourceEntityId` of the affected record.
25889    #[serde(rename = "sourceEntityId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25890    pub source_entity_id: Option<String>,
25891    /// Allowed values: `both`, `es`, `master`.
25892    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25893    pub system: Option<String>,
25894    /// Operation described by a sync log entry.
25895    /// Allowed values: `create`, `delete`, `execution`, `link`, `update`.
25896    #[serde(deserialize_with = "crate::lenient::string")]
25897    pub r#type: String,
25898    /// Fields not described by the spec, e.g. instance-specific DB fields.
25899    #[serde(flatten)]
25900    pub extra: serde_json::Map<String, serde_json::Value>,
25901}
25902
25903#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25904pub struct SyncLogCreate {
25905    /// Translation arguments; keys and values are passed to the translation system.
25906    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
25907    pub args: serde_json::Value,
25908    #[serde(default, skip_serializing_if = "Option::is_none")]
25909    pub changes: Option<Vec<SyncLogCreateChangesItem>>,
25910    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
25911    #[serde(serialize_with = "crate::datetime::serialize_utc")]
25912    pub date: chrono::DateTime<chrono::Utc>,
25913    /// `None` leaves the field out, `Some(None)` sends `null`.
25914    #[serde(rename = "domainId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
25915    pub domain_id: Option<Option<String>>,
25916    /// `None` leaves the field out, `Some(None)` sends `null`.
25917    #[serde(rename = "domainType", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
25918    pub domain_type: Option<Option<String>>,
25919    /// Background execution identifier, not the job configuration ID.
25920    #[serde(rename = "executionId", deserialize_with = "crate::lenient::string")]
25921    pub execution_id: String,
25922    #[serde(rename = "isDryRun", default, skip_serializing_if = "Option::is_none")]
25923    pub is_dry_run: Option<bool>,
25924    #[serde(rename = "jobId", deserialize_with = "crate::lenient::number")]
25925    pub job_id: i64,
25926    /// PSR log severity.
25927    /// Allowed values: `alert`, `critical`, `debug`, `emergency`, `error`, `info`, `notice`, `warning`.
25928    #[serde(deserialize_with = "crate::lenient::string")]
25929    pub level: String,
25930    /// Translation Key
25931    #[serde(rename = "messageKey", deserialize_with = "crate::lenient::string")]
25932    pub message_key: String,
25933    /// `None` leaves the field out, `Some(None)` sends `null`.
25934    #[serde(rename = "sourceEntityId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
25935    pub source_entity_id: Option<Option<String>>,
25936    /// Affected side.
25937    /// Allowed values: `both`, `es`, `master`.
25938    ///
25939    /// `None` leaves the field out, `Some(None)` sends `null`.
25940    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
25941    pub system: Option<Option<String>>,
25942    /// Operation described by a sync log entry.
25943    /// Allowed values: `create`, `delete`, `execution`, `link`, `update`.
25944    #[serde(deserialize_with = "crate::lenient::string")]
25945    pub r#type: String,
25946    /// Fields not described by the spec, e.g. instance-specific DB fields.
25947    #[serde(flatten)]
25948    pub extra: serde_json::Map<String, serde_json::Value>,
25949}
25950
25951#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25952pub struct SyncLogCreateChangesItem {
25953    /// Secondary value for FieldName. Used for Group Roles.
25954    ///
25955    /// `None` leaves the field out, `Some(None)` sends `null`.
25956    #[serde(rename = "fieldAttribute", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
25957    pub field_attribute: Option<Option<String>>,
25958    /// Name of field. Translation Key allowed
25959    #[serde(rename = "fieldName", deserialize_with = "crate::lenient::string")]
25960    pub field_name: String,
25961    /// `None` leaves the field out, `Some(None)` sends `null`.
25962    #[serde(rename = "newValue", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
25963    pub new_value: Option<Option<String>>,
25964    /// `None` leaves the field out, `Some(None)` sends `null`.
25965    #[serde(rename = "oldValue", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
25966    pub old_value: Option<Option<String>>,
25967    /// Fields not described by the spec, e.g. instance-specific DB fields.
25968    #[serde(flatten)]
25969    pub extra: serde_json::Map<String, serde_json::Value>,
25970}
25971
25972#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25973pub struct SyncLogJob {
25974    #[serde(rename = "externalSystem")]
25975    pub external_system: SyncLogJobExternalSystem,
25976    #[serde(deserialize_with = "crate::lenient::number")]
25977    pub id: i64,
25978    #[serde(deserialize_with = "crate::lenient::string")]
25979    pub name: String,
25980    /// Fields not described by the spec, e.g. instance-specific DB fields.
25981    #[serde(flatten)]
25982    pub extra: serde_json::Map<String, serde_json::Value>,
25983}
25984
25985#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25986pub struct SyncLogJobExternalSystem {
25987    #[serde(deserialize_with = "crate::lenient::number")]
25988    pub id: i64,
25989    #[serde(deserialize_with = "crate::lenient::string")]
25990    pub name: String,
25991    /// Fields not described by the spec, e.g. instance-specific DB fields.
25992    #[serde(flatten)]
25993    pub extra: serde_json::Map<String, serde_json::Value>,
25994}
25995
25996#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25997pub struct SyncLogsCreate {
25998    pub logs: Vec<SyncLogCreate>,
25999    /// Fields not described by the spec, e.g. instance-specific DB fields.
26000    #[serde(flatten)]
26001    pub extra: serde_json::Map<String, serde_json::Value>,
26002}
26003
26004#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26005pub struct SyncLogsPersisted {
26006    /// Number of stored entries.
26007    #[serde(deserialize_with = "crate::lenient::number")]
26008    pub persisted: i64,
26009    /// Fields not described by the spec, e.g. instance-specific DB fields.
26010    #[serde(flatten)]
26011    pub extra: serde_json::Map<String, serde_json::Value>,
26012}
26013
26014/// Tag label and display properties. The REST tag controller does not return the tag domain or audit metadata.
26015#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26016pub struct Tag {
26017    /// Stored semantic color, or `basic` when no color is stored.
26018    /// 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`.
26019    #[serde(deserialize_with = "crate::lenient::string")]
26020    pub color: String,
26021    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
26022    pub description: Option<String>,
26023    #[serde(deserialize_with = "crate::lenient::number")]
26024    pub id: i64,
26025    #[serde(deserialize_with = "crate::lenient::string")]
26026    pub name: String,
26027    #[serde(rename = "modifiedAt", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
26028    #[deprecated = "deprecated in the ChurchTools API"]
26029    pub modified_at: Option<String>,
26030    #[serde(rename = "modifiedBy", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26031    #[deprecated = "deprecated in the ChurchTools API"]
26032    pub modified_by: Option<i64>,
26033    #[serde(rename = "modifiedDate", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
26034    #[deprecated = "deprecated in the ChurchTools API"]
26035    pub modified_date: Option<String>,
26036    #[serde(rename = "modifiedPid", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
26037    #[deprecated = "deprecated in the ChurchTools API"]
26038    pub modified_pid: Option<String>,
26039    /// Fields not described by the spec, e.g. instance-specific DB fields.
26040    #[serde(flatten)]
26041    pub extra: serde_json::Map<String, serde_json::Value>,
26042}
26043
26044#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26045pub struct TagAssignmentCreate {
26046    /// Name of an existing or newly created tag in this domain.
26047    #[serde(deserialize_with = "crate::lenient::string")]
26048    pub name: String,
26049    /// Fields not described by the spec, e.g. instance-specific DB fields.
26050    #[serde(flatten)]
26051    pub extra: serde_json::Map<String, serde_json::Value>,
26052}
26053
26054#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26055pub struct TagCreate {
26056    /// Semantic tag color; responses use `basic` when unset.
26057    /// 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`.
26058    ///
26059    /// `None` leaves the field out, `Some(None)` sends `null`.
26060    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26061    pub color: Option<Option<String>>,
26062    /// `None` leaves the field out, `Some(None)` sends `null`.
26063    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26064    pub description: Option<Option<String>>,
26065    /// Tag name, unique within the domain.
26066    #[serde(deserialize_with = "crate::lenient::string")]
26067    pub name: String,
26068    /// Fields not described by the spec, e.g. instance-specific DB fields.
26069    #[serde(flatten)]
26070    pub extra: serde_json::Map<String, serde_json::Value>,
26071}
26072
26073/// Replacement tag properties. The tag’s domain cannot be changed.
26074#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26075pub struct TagUpdate {
26076    /// Semantic tag color; responses use `basic` when unset.
26077    /// 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`.
26078    ///
26079    /// `None` leaves the field out, `Some(None)` sends `null`.
26080    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26081    pub color: Option<Option<String>>,
26082    /// `None` leaves the field out, `Some(None)` sends `null`.
26083    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26084    pub description: Option<Option<String>>,
26085    /// Tag name, unique within the domain.
26086    #[serde(deserialize_with = "crate::lenient::string")]
26087    pub name: String,
26088    /// Fields not described by the spec, e.g. instance-specific DB fields.
26089    #[serde(flatten)]
26090    pub extra: serde_json::Map<String, serde_json::Value>,
26091}
26092
26093/// 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.
26094#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26095pub struct TagWithCount {
26096    /// Stored semantic color, or `basic` when no color is stored.
26097    /// 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`.
26098    #[serde(deserialize_with = "crate::lenient::string")]
26099    pub color: String,
26100    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
26101    pub description: Option<String>,
26102    #[serde(deserialize_with = "crate::lenient::number")]
26103    pub id: i64,
26104    #[serde(deserialize_with = "crate::lenient::string")]
26105    pub name: String,
26106    /// Link count only for the domain-wide catalog; other endpoint contexts use `0` on creation or normally `1`.
26107    #[serde(deserialize_with = "crate::lenient::number")]
26108    pub count: i64,
26109    /// Fields not described by the spec, e.g. instance-specific DB fields.
26110    #[serde(flatten)]
26111    pub extra: serde_json::Map<String, serde_json::Value>,
26112}
26113
26114/// 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.
26115#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26116pub struct TargetGroup {
26117    /// Stored label configured in this installation. Use nameTranslated from the response for a localized display name.
26118    #[serde(deserialize_with = "crate::lenient::string")]
26119    pub name: String,
26120    /// Display order. Lower values come first; list endpoints sort equal values by the stored name.
26121    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
26122    pub sort_key: i64,
26123    /// ID of this master-data record in this ChurchTools installation. Use it when assigning this classification to a group.
26124    #[serde(deserialize_with = "crate::lenient::number")]
26125    pub id: i64,
26126    /// Localized display name, translated from the stored name when a translation exists.
26127    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
26128    pub name_translated: String,
26129    /// Fields not described by the spec, e.g. instance-specific DB fields.
26130    #[serde(flatten)]
26131    pub extra: serde_json::Map<String, serde_json::Value>,
26132}
26133
26134#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26135pub struct TargetGroupCreate {
26136    /// Stored label configured in this installation. Use nameTranslated from the response for a localized display name.
26137    #[serde(deserialize_with = "crate::lenient::string")]
26138    pub name: String,
26139    /// Display order. Lower values come first; list endpoints sort equal values by the stored name.
26140    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
26141    pub sort_key: i64,
26142    /// Fields not described by the spec, e.g. instance-specific DB fields.
26143    #[serde(flatten)]
26144    pub extra: serde_json::Map<String, serde_json::Value>,
26145}
26146
26147/// 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.
26148#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26149pub struct TaxRate {
26150    /// ID of the existing ledger account receiving this amount. It also determines the accounting period.
26151    #[serde(rename = "accountId", deserialize_with = "crate::lenient::number")]
26152    pub account_id: i64,
26153    #[serde(deserialize_with = "crate::lenient::number")]
26154    pub id: i64,
26155    pub meta: MetaDataEntityId,
26156    /// Description, trimmed before storage. Omitted, null or blank clears it.
26157    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
26158    pub note: Option<String>,
26159    /// Percentage points: 7 means 7%. Legacy or internally created records can contain null.
26160    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26161    pub rate: Option<f64>,
26162    /// Existing tax type from /finance/taxtypes.
26163    #[serde(rename = "taxTypeId", deserialize_with = "crate::lenient::number")]
26164    pub tax_type_id: i64,
26165    /// Fields not described by the spec, e.g. instance-specific DB fields.
26166    #[serde(flatten)]
26167    pub extra: serde_json::Map<String, serde_json::Value>,
26168}
26169
26170/// 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.
26171#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26172pub struct TaxRateCreate {
26173    /// ID of the existing ledger account receiving this amount. It also determines the accounting period.
26174    #[serde(rename = "accountId", deserialize_with = "crate::lenient::number")]
26175    pub account_id: i64,
26176    /// Description, trimmed before storage. Omitted, null or blank clears it.
26177    ///
26178    /// `None` leaves the field out, `Some(None)` sends `null`.
26179    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26180    pub note: Option<Option<String>>,
26181    /// Percentage points: 7 means 7%, not 0.07. The API validates a number but does not enforce a percentage range.
26182    #[serde(deserialize_with = "crate::lenient::number")]
26183    pub rate: f64,
26184    /// Existing tax type from /finance/taxtypes.
26185    #[serde(rename = "taxTypeId", deserialize_with = "crate::lenient::number")]
26186    pub tax_type_id: i64,
26187    /// Fields not described by the spec, e.g. instance-specific DB fields.
26188    #[serde(flatten)]
26189    pub extra: serde_json::Map<String, serde_json::Value>,
26190}
26191
26192/// Replacement values for this tax rate. If transactions already reference it, only note may change; send the existing rate, taxTypeId and accountId unchanged.
26193#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26194pub struct TaxRateUpdate {
26195    /// ID of the existing ledger account receiving this amount. It also determines the accounting period.
26196    #[serde(rename = "accountId", deserialize_with = "crate::lenient::number")]
26197    pub account_id: i64,
26198    /// Description, trimmed before storage. Omitted, null or blank clears it.
26199    ///
26200    /// `None` leaves the field out, `Some(None)` sends `null`.
26201    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26202    pub note: Option<Option<String>>,
26203    /// Percentage points: 7 means 7%, not 0.07. The API validates a number but does not enforce a percentage range.
26204    #[serde(deserialize_with = "crate::lenient::number")]
26205    pub rate: f64,
26206    /// Existing tax type from /finance/taxtypes.
26207    #[serde(rename = "taxTypeId", deserialize_with = "crate::lenient::number")]
26208    pub tax_type_id: i64,
26209    /// Fields not described by the spec, e.g. instance-specific DB fields.
26210    #[serde(flatten)]
26211    pub extra: serde_json::Map<String, serde_json::Value>,
26212}
26213
26214/// 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.
26215#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26216pub struct TaxType {
26217    /// Unique name, trimmed before storage. Omitted, null or blank becomes null, including on update.
26218    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
26219    pub name: Option<String>,
26220    /// Ascending display order. Required for creation and update; there is no API default.
26221    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
26222    pub sort_key: i64,
26223    #[serde(deserialize_with = "crate::lenient::number")]
26224    pub id: i64,
26225    pub meta: MetaDataEntityId,
26226    /// Fields not described by the spec, e.g. instance-specific DB fields.
26227    #[serde(flatten)]
26228    pub extra: serde_json::Map<String, serde_json::Value>,
26229}
26230
26231/// 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.
26232#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26233pub struct TaxTypeCreate {
26234    /// Unique name, trimmed before storage. Omitted, null or blank becomes null, including on update.
26235    ///
26236    /// `None` leaves the field out, `Some(None)` sends `null`.
26237    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26238    pub name: Option<Option<String>>,
26239    /// Ascending display order. Required for creation and update; there is no API default.
26240    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
26241    pub sort_key: i64,
26242    /// Fields not described by the spec, e.g. instance-specific DB fields.
26243    #[serde(flatten)]
26244    pub extra: serde_json::Map<String, serde_json::Value>,
26245}
26246
26247/// Replacement values for this tax type.
26248#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26249pub struct TaxTypeUpdate {
26250    /// Unique name, trimmed before storage. Omitted, null or blank becomes null, including on update.
26251    ///
26252    /// `None` leaves the field out, `Some(None)` sends `null`.
26253    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26254    pub name: Option<Option<String>>,
26255    /// Ascending display order. Required for creation and update; there is no API default.
26256    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
26257    pub sort_key: i64,
26258    /// Fields not described by the spec, e.g. instance-specific DB fields.
26259    #[serde(flatten)]
26260    pub extra: serde_json::Map<String, serde_json::Value>,
26261}
26262
26263/// 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.
26264#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26265pub struct Transaction {
26266    /// Compatibility marker mapping the deprecated donor ID fields to their replacements.
26267    #[serde(rename = "@deprecated")]
26268    pub deprecated: TransactionDeprecated,
26269    /// ID of the debit account the amount is posted to.
26270    #[serde(rename = "accountId", deserialize_with = "crate::lenient::number")]
26271    pub account_id: i64,
26272    /// 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.
26273    #[serde(deserialize_with = "crate::lenient::number")]
26274    pub amount: i64,
26275    /// Receipts attached to this booking, included when include\[\]=bills is requested.
26276    #[serde(default, skip_serializing_if = "Option::is_none")]
26277    pub bills: Option<Vec<Bill>>,
26278    /// Granted cash discount in the currency's smallest denomination (e.g. cents). `null` if no cash discount applies.
26279    #[serde(rename = "cashDiscountAmount", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26280    pub cash_discount_amount: Option<i64>,
26281    /// ID of the applied cash discount, or `null` if none.
26282    #[serde(rename = "cashDiscountId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26283    pub cash_discount_id: Option<i64>,
26284    /// ID of the credit (contra) account the amount is posted from.
26285    #[serde(rename = "contraAccountId", deserialize_with = "crate::lenient::number")]
26286    pub contra_account_id: i64,
26287    /// ID of the target cost center for a cost center transfer. Required when `accountId` and `contraAccountId` are equal, otherwise it must be `null`.
26288    #[serde(rename = "contraCostCenterId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26289    pub contra_cost_center_id: Option<i64>,
26290    /// ID of the assigned cost center, or `null` if none. For a cost center transfer this is the source cost center.
26291    #[serde(rename = "costCenterId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26292    pub cost_center_id: Option<i64>,
26293    /// Document date of the booking. Used for accounting-period validation, date filters and accounting reports.
26294    #[serde(rename = "documentDate")]
26295    pub document_date: chrono::NaiveDate,
26296    /// Document number of the transaction. Auto-generated when the accounting period increments document numbers, otherwise required on creation.
26297    #[serde(rename = "documentNumber", deserialize_with = "crate::lenient::string")]
26298    pub document_number: String,
26299    /// Resolved donor person, or null when no person has been resolved. Without donor visibility the response contains a censored person placeholder.
26300    #[serde(default, skip_serializing_if = "Option::is_none")]
26301    pub donator: Option<DomainObjectPerson>,
26302    /// Deprecated: use `donator` instead.
26303    #[serde(rename = "donatorId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26304    #[deprecated = "deprecated in the ChurchTools API"]
26305    pub donator_id: Option<i64>,
26306    /// Resolved spouse for joint donation receipts, or null. Without donor visibility the response contains a censored person placeholder.
26307    #[serde(rename = "donatorSpouse", default, skip_serializing_if = "Option::is_none")]
26308    pub donator_spouse: Option<DomainObjectPerson>,
26309    /// Deprecated: use `donatorSpouse` instead.
26310    #[serde(rename = "donatorSpouseId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26311    #[deprecated = "deprecated in the ChurchTools API"]
26312    pub donator_spouse_id: Option<i64>,
26313    /// Unique ID of the transaction.
26314    #[serde(deserialize_with = "crate::lenient::number")]
26315    pub id: i64,
26316    /// If a transaction is immutable, none of its fields can be changed and it cannot be deleted (it has been finalized/locked).
26317    #[serde(rename = "isImmutable")]
26318    pub is_immutable: bool,
26319    /// True, if the transaction has been created through a sync.
26320    #[serde(rename = "isSynced")]
26321    pub is_synced: bool,
26322    /// True, if this transaction is a waiver of reimbursement of expenses ("Aufwandsspende").
26323    #[serde(rename = "isWaiverOfReimbursementOfExpenses")]
26324    pub is_waiver_of_reimbursement_of_expenses: bool,
26325    pub meta: MetaDataEntityId,
26326    /// Free-text booking note. Null when unset or hidden because the current user may view the transaction but not its donor information.
26327    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
26328    pub note: Option<String>,
26329    /// Permissions calculated for the current caller, or null when this booking was serialized without a permission collection, for example a newly generated tax child.
26330    #[serde(default, skip_serializing_if = "Option::is_none")]
26331    pub permissions: Option<TransactionPermissions>,
26332    /// ID of the parent split transaction, or `null` if this is a normal standalone transaction.
26333    #[serde(rename = "splitTransactionId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26334    pub split_transaction_id: Option<i64>,
26335    /// Reference to the transaction which gets stornoed by this transaction.
26336    #[serde(rename = "stornoBaseId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26337    pub storno_base_id: Option<i64>,
26338    /// Reference to the transaction which stornoed this transaction.
26339    #[serde(rename = "stornoTransactionId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26340    pub storno_transaction_id: Option<i64>,
26341    /// Reference to the transaction which is the base for a tax split booking.
26342    #[serde(rename = "taxBaseId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26343    pub tax_base_id: Option<i64>,
26344    /// If a tax rate is set for the transaction, the corresponding tax transaction is returned in the field taxTransactionId.
26345    #[serde(rename = "taxRateId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26346    pub tax_rate_id: Option<i64>,
26347    /// Reference to the transaction which is a split booking for taxes.
26348    #[serde(rename = "taxTransactionId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26349    pub tax_transaction_id: Option<i64>,
26350    /// Date on which the transaction was created, derived from meta.createdDate. Date filters and accounting reports use documentDate.
26351    #[serde(rename = "transactionDate")]
26352    pub transaction_date: chrono::NaiveDate,
26353    /// Fields not described by the spec, e.g. instance-specific DB fields.
26354    #[serde(flatten)]
26355    pub extra: serde_json::Map<String, serde_json::Value>,
26356}
26357
26358/// 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.
26359#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26360pub struct TransactionBatchFilter {
26361    /// Filter by account/contra account. All transactions match, where either account or contra account is in the list.
26362    #[serde(rename = "accountIds", default, skip_serializing_if = "Option::is_none")]
26363    pub account_ids: Option<Vec<i64>>,
26364    /// ID of accounting period to get master data for
26365    #[serde(rename = "accountingPeriodId", deserialize_with = "crate::lenient::number")]
26366    pub accounting_period_id: i64,
26367    /// Filter by cost centers.
26368    #[serde(rename = "costCenterIds", default, skip_serializing_if = "Option::is_none")]
26369    pub cost_center_ids: Option<Vec<i64>>,
26370    /// Filter by person ID. Get all transactions the person has created. But only show those the user can see.
26371    #[serde(rename = "createdPid", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26372    pub created_pid: Option<i64>,
26373    /// Person IDs matching either donor or spouse, including donors of the original booking when matching cancellations.
26374    #[serde(rename = "donatorIds", default, skip_serializing_if = "Option::is_none")]
26375    pub donator_ids: Option<Vec<i64>>,
26376    /// Inclusive upper bound for documentDate.
26377    #[serde(rename = "endDate", default, skip_serializing_if = "Option::is_none")]
26378    pub end_date: Option<chrono::NaiveDate>,
26379    /// Legacy alias for excludeIds. When both are present, this alias takes precedence.
26380    #[serde(default, skip_serializing_if = "Option::is_none")]
26381    #[deprecated = "deprecated in the ChurchTools API"]
26382    pub exclude: Option<Vec<i64>>,
26383    /// Filter by ids to exclude.
26384    #[serde(rename = "excludeIds", default, skip_serializing_if = "Option::is_none")]
26385    pub exclude_ids: Option<Vec<i64>>,
26386    /// Legacy alias for includeIds. When both are present, this alias takes precedence.
26387    #[serde(default, skip_serializing_if = "Option::is_none")]
26388    #[deprecated = "deprecated in the ChurchTools API"]
26389    pub include: Option<Vec<i64>>,
26390    /// Filter by ids to include.
26391    #[serde(rename = "includeIds", default, skip_serializing_if = "Option::is_none")]
26392    pub include_ids: Option<Vec<i64>>,
26393    /// Currently, either true or false selects bookings with a positive donor ID. Omit this parameter to include both donations and other bookings.
26394    #[serde(rename = "isDonation", default, skip_serializing_if = "Option::is_none")]
26395    pub is_donation: Option<bool>,
26396    /// Filter transactions, whether transaction is immutable.
26397    #[serde(rename = "isImmutable", default, skip_serializing_if = "Option::is_none")]
26398    pub is_immutable: Option<bool>,
26399    /// 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.
26400    #[serde(rename = "isIncome", default, skip_serializing_if = "Option::is_none")]
26401    pub is_income: Option<bool>,
26402    /// 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.
26403    /// Allowed values: `account`, `amount`, `bills`, `contra_account`, `cost_center`, `date`, `donator`, `modified`, `note`, `number`.
26404    #[serde(rename = "orderBy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
26405    pub order_by: Option<String>,
26406    /// Search note, document number or amount. For amount matching, leading zeros and decimal separators are removed.
26407    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
26408    pub query: Option<String>,
26409    /// Inclusive lower bound for documentDate.
26410    #[serde(rename = "startDate", default, skip_serializing_if = "Option::is_none")]
26411    pub start_date: Option<chrono::NaiveDate>,
26412    /// Fields not described by the spec, e.g. instance-specific DB fields.
26413    #[serde(flatten)]
26414    pub extra: serde_json::Map<String, serde_json::Value>,
26415}
26416
26417/// Result counters. They do not enumerate the affected booking IDs.
26418#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26419pub struct TransactionBatchResult {
26420    /// Finalization: selected and automatically added related bookings. Deletion: initial selected rows, excluding additional rows removed through dependencies.
26421    #[serde(rename = "affectedRows", deserialize_with = "crate::lenient::number")]
26422    pub affected_rows: i64,
26423    /// Finalization: previously mutable rows actually updated. Deletion currently always reports zero, even when rows were deleted.
26424    #[serde(rename = "changedRows", deserialize_with = "crate::lenient::number")]
26425    pub changed_rows: i64,
26426    /// Fields not described by the spec, e.g. instance-specific DB fields.
26427    #[serde(flatten)]
26428    pub extra: serde_json::Map<String, serde_json::Value>,
26429}
26430
26431/// 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.
26432#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26433pub struct TransactionBatchUpdate {
26434    /// 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.
26435    pub changeset: TransactionBatchUpdateChangeset,
26436    /// Scopes to combine with OR. Each scope requires an accountingPeriodId.
26437    pub filters: Vec<TransactionBatchFilter>,
26438    /// Fields not described by the spec, e.g. instance-specific DB fields.
26439    #[serde(flatten)]
26440    pub extra: serde_json::Map<String, serde_json::Value>,
26441}
26442
26443/// 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.
26444#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26445pub struct TransactionBatchUpdateChangeset {
26446    /// Delete matched bookings, including immutable ones. This is the period-cleanup operation, not ordinary per-booking deletion.
26447    #[serde(default, skip_serializing_if = "Option::is_none")]
26448    pub delete: Option<bool>,
26449    /// Finalize the matched bookings and related tax/base bookings.
26450    #[serde(rename = "isImmutable", default, skip_serializing_if = "Option::is_none")]
26451    pub is_immutable: Option<bool>,
26452    /// Fields not described by the spec, e.g. instance-specific DB fields.
26453    #[serde(flatten)]
26454    pub extra: serde_json::Map<String, serde_json::Value>,
26455}
26456
26457/// 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.
26458#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26459pub struct TransactionBulkCreateItem {
26460    /// ID of the debit account the amount is posted to.
26461    #[serde(rename = "accountId", deserialize_with = "crate::lenient::number")]
26462    pub account_id: i64,
26463    /// 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.
26464    #[serde(deserialize_with = "crate::lenient::number")]
26465    pub amount: i64,
26466    /// Cash discount in the smallest currency unit. Used only together with cashDiscountId.
26467    ///
26468    /// `None` leaves the field out, `Some(None)` sends `null`.
26469    #[serde(rename = "cashDiscountAmount", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26470    pub cash_discount_amount: Option<Option<i64>>,
26471    /// Cash-discount definition from the same accounting period. When supplied, cashDiscountAmount must also be non-null.
26472    ///
26473    /// `None` leaves the field out, `Some(None)` sends `null`.
26474    #[serde(rename = "cashDiscountId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26475    pub cash_discount_id: Option<Option<i64>>,
26476    /// ID of the credit (contra) account the amount is posted from. Equal to `accountId` only for a cost center transfer.
26477    #[serde(rename = "contraAccountId", deserialize_with = "crate::lenient::number")]
26478    pub contra_account_id: i64,
26479    /// 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`.
26480    ///
26481    /// `None` leaves the field out, `Some(None)` sends `null`.
26482    #[serde(rename = "contraCostCenterId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26483    pub contra_cost_center_id: Option<Option<i64>>,
26484    /// 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.
26485    ///
26486    /// `None` leaves the field out, `Some(None)` sends `null`.
26487    #[serde(rename = "costCenterId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26488    pub cost_center_id: Option<Option<i64>>,
26489    /// Date printed on the underlying document/receipt.
26490    #[serde(rename = "documentDate")]
26491    pub document_date: chrono::NaiveDate,
26492    /// 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.
26493    ///
26494    /// `None` leaves the field out, `Some(None)` sends `null`.
26495    #[serde(rename = "donatorId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26496    pub donator_id: Option<Option<i64>>,
26497    /// Spouse for joint donation receipts. Requires a different donor person and an existing spouse relationship; inconsistent assignments return 422.
26498    ///
26499    /// `None` leaves the field out, `Some(None)` sends `null`.
26500    #[serde(rename = "donatorSpouseId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26501    pub donator_spouse_id: Option<Option<i64>>,
26502    /// Whether this is a donation through waived reimbursement of expenses. Defaults to false, including on update.
26503    #[serde(rename = "isWaiverOfReimbursementOfExpenses", default, skip_serializing_if = "Option::is_none")]
26504    pub is_waiver_of_reimbursement_of_expenses: Option<bool>,
26505    /// Free-text note describing the booking.
26506    #[serde(deserialize_with = "crate::lenient::string")]
26507    pub note: String,
26508    /// Tax rate from the same accounting period. Generates or updates a separate tax booking. On update, omission or null removes the existing tax booking.
26509    ///
26510    /// `None` leaves the field out, `Some(None)` sends `null`.
26511    #[serde(rename = "taxRateId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26512    pub tax_rate_id: Option<Option<i64>>,
26513    /// Explicit document number for this item.
26514    #[serde(rename = "documentNumber", deserialize_with = "crate::lenient::string")]
26515    pub document_number: String,
26516    /// Mark this booking as created through a sync.
26517    #[serde(rename = "isSynced", default, skip_serializing_if = "Option::is_none")]
26518    pub is_synced: Option<bool>,
26519    /// Fields not described by the spec, e.g. instance-specific DB fields.
26520    #[serde(flatten)]
26521    pub extra: serde_json::Map<String, serde_json::Value>,
26522}
26523
26524/// 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.
26525#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26526pub struct TransactionCreate {
26527    /// ID of the debit account the amount is posted to.
26528    #[serde(rename = "accountId", deserialize_with = "crate::lenient::number")]
26529    pub account_id: i64,
26530    /// 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.
26531    #[serde(deserialize_with = "crate::lenient::number")]
26532    pub amount: i64,
26533    /// Cash discount in the smallest currency unit. Used only together with cashDiscountId.
26534    ///
26535    /// `None` leaves the field out, `Some(None)` sends `null`.
26536    #[serde(rename = "cashDiscountAmount", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26537    pub cash_discount_amount: Option<Option<i64>>,
26538    /// Cash-discount definition from the same accounting period. When supplied, cashDiscountAmount must also be non-null.
26539    ///
26540    /// `None` leaves the field out, `Some(None)` sends `null`.
26541    #[serde(rename = "cashDiscountId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26542    pub cash_discount_id: Option<Option<i64>>,
26543    /// ID of the credit (contra) account the amount is posted from. Equal to `accountId` only for a cost center transfer.
26544    #[serde(rename = "contraAccountId", deserialize_with = "crate::lenient::number")]
26545    pub contra_account_id: i64,
26546    /// 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`.
26547    ///
26548    /// `None` leaves the field out, `Some(None)` sends `null`.
26549    #[serde(rename = "contraCostCenterId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26550    pub contra_cost_center_id: Option<Option<i64>>,
26551    /// 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.
26552    ///
26553    /// `None` leaves the field out, `Some(None)` sends `null`.
26554    #[serde(rename = "costCenterId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26555    pub cost_center_id: Option<Option<i64>>,
26556    /// Date printed on the underlying document/receipt.
26557    #[serde(rename = "documentDate")]
26558    pub document_date: chrono::NaiveDate,
26559    /// 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.
26560    ///
26561    /// `None` leaves the field out, `Some(None)` sends `null`.
26562    #[serde(rename = "donatorId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26563    pub donator_id: Option<Option<i64>>,
26564    /// Spouse for joint donation receipts. Requires a different donor person and an existing spouse relationship; inconsistent assignments return 422.
26565    ///
26566    /// `None` leaves the field out, `Some(None)` sends `null`.
26567    #[serde(rename = "donatorSpouseId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26568    pub donator_spouse_id: Option<Option<i64>>,
26569    /// Whether this is a donation through waived reimbursement of expenses. Defaults to false, including on update.
26570    #[serde(rename = "isWaiverOfReimbursementOfExpenses", default, skip_serializing_if = "Option::is_none")]
26571    pub is_waiver_of_reimbursement_of_expenses: Option<bool>,
26572    /// Free-text note describing the booking.
26573    #[serde(deserialize_with = "crate::lenient::string")]
26574    pub note: String,
26575    /// Tax rate from the same accounting period. Generates or updates a separate tax booking. On update, omission or null removes the existing tax booking.
26576    ///
26577    /// `None` leaves the field out, `Some(None)` sends `null`.
26578    #[serde(rename = "taxRateId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26579    pub tax_rate_id: Option<Option<i64>>,
26580    /// Document number, required unless automatic numbering is enabled. An explicitly supplied value is used as-is.
26581    ///
26582    /// `None` leaves the field out, `Some(None)` sends `null`.
26583    #[serde(rename = "documentNumber", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26584    pub document_number: Option<Option<String>>,
26585    /// Mark this booking as created through a sync.
26586    #[serde(rename = "isSynced", default, skip_serializing_if = "Option::is_none")]
26587    pub is_synced: Option<bool>,
26588    /// Fields not described by the spec, e.g. instance-specific DB fields.
26589    #[serde(flatten)]
26590    pub extra: serde_json::Map<String, serde_json::Value>,
26591}
26592
26593/// Compatibility marker mapping the deprecated donor ID fields to their replacements.
26594#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26595pub struct TransactionDeprecated {
26596    /// Allowed values: `donator`.
26597    #[serde(rename = "donatorId", deserialize_with = "crate::lenient::string")]
26598    pub donator_id: String,
26599    /// Allowed values: `donatorSpouse`.
26600    #[serde(rename = "donatorSpouseId", deserialize_with = "crate::lenient::string")]
26601    pub donator_spouse_id: String,
26602    /// Fields not described by the spec, e.g. instance-specific DB fields.
26603    #[serde(flatten)]
26604    pub extra: serde_json::Map<String, serde_json::Value>,
26605}
26606
26607/// Permissions calculated for the current caller, or null when this booking was serialized without a permission collection, for example a newly generated tax child.
26608#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26609pub struct TransactionPermissions {
26610    /// Flag if user can edit this transaction
26611    #[serde(rename = "canEdit", default, skip_serializing_if = "Option::is_none")]
26612    pub can_edit: Option<bool>,
26613    /// Fields not described by the spec, e.g. instance-specific DB fields.
26614    #[serde(flatten)]
26615    pub extra: serde_json::Map<String, serde_json::Value>,
26616}
26617
26618/// 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.
26619#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26620pub struct TransactionPurpose {
26621    /// Resolved, distinct ledger account IDs. Can be empty when input IDs could not be resolved. No order is guaranteed.
26622    #[serde(rename = "accountIds")]
26623    pub account_ids: Vec<i64>,
26624    /// Optional cost center. Omitted or null removes it, including on update. If supplied, its period must match the fixed account and all resolved accountIds.
26625    #[serde(rename = "costCenterId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26626    pub cost_center_id: Option<i64>,
26627    #[serde(deserialize_with = "crate::lenient::number")]
26628    pub id: i64,
26629    /// True for income presets, false for expense presets. Determines which side of a transaction uses purposeAccountId.
26630    #[serde(rename = "isIncome")]
26631    pub is_income: bool,
26632    pub meta: MetaDataEntityId,
26633    /// Trimmed display name. Names are not required to be unique.
26634    #[serde(deserialize_with = "crate::lenient::string")]
26635    pub name: String,
26636    /// Fixed ledger account: the contra account for income, or the account for expenses. Its period must be open.
26637    #[serde(rename = "purposeAccountId", deserialize_with = "crate::lenient::number")]
26638    pub purpose_account_id: i64,
26639    /// Ascending display order. Required in creation and update.
26640    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
26641    pub sort_key: i64,
26642    /// Fields not described by the spec, e.g. instance-specific DB fields.
26643    #[serde(flatten)]
26644    pub extra: serde_json::Map<String, serde_json::Value>,
26645}
26646
26647/// 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.
26648#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26649pub struct TransactionPurposeCreate {
26650    /// Accounts offered for the other side of the posting. Duplicate IDs are collapsed; unknown IDs are currently omitted by the lookup. Supply existing accounts.
26651    #[serde(rename = "accountIds")]
26652    pub account_ids: Vec<i64>,
26653    /// Optional cost center. Omitted or null removes it, including on update. If supplied, its period must match the fixed account and all resolved accountIds.
26654    ///
26655    /// `None` leaves the field out, `Some(None)` sends `null`.
26656    #[serde(rename = "costCenterId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26657    pub cost_center_id: Option<Option<i64>>,
26658    /// True for income presets, false for expense presets. Determines which side of a transaction uses purposeAccountId.
26659    #[serde(rename = "isIncome")]
26660    pub is_income: bool,
26661    /// Trimmed display name. Names are not required to be unique.
26662    #[serde(deserialize_with = "crate::lenient::string")]
26663    pub name: String,
26664    /// Fixed ledger account: the contra account for income, or the account for expenses. Its period must be open.
26665    #[serde(rename = "purposeAccountId", deserialize_with = "crate::lenient::number")]
26666    pub purpose_account_id: i64,
26667    /// Ascending display order. Required in creation and update.
26668    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
26669    pub sort_key: i64,
26670    /// Fields not described by the spec, e.g. instance-specific DB fields.
26671    #[serde(flatten)]
26672    pub extra: serde_json::Map<String, serde_json::Value>,
26673}
26674
26675/// Replacement preset, including the complete accountIds selection. Omitted costCenterId clears the linked cost center.
26676#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26677pub struct TransactionPurposeUpdate {
26678    /// Accounts offered for the other side of the posting. Duplicate IDs are collapsed; unknown IDs are currently omitted by the lookup. Supply existing accounts.
26679    #[serde(rename = "accountIds")]
26680    pub account_ids: Vec<i64>,
26681    /// Optional cost center. Omitted or null removes it, including on update. If supplied, its period must match the fixed account and all resolved accountIds.
26682    ///
26683    /// `None` leaves the field out, `Some(None)` sends `null`.
26684    #[serde(rename = "costCenterId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26685    pub cost_center_id: Option<Option<i64>>,
26686    /// True for income presets, false for expense presets. Determines which side of a transaction uses purposeAccountId.
26687    #[serde(rename = "isIncome")]
26688    pub is_income: bool,
26689    /// Trimmed display name. Names are not required to be unique.
26690    #[serde(deserialize_with = "crate::lenient::string")]
26691    pub name: String,
26692    /// Fixed ledger account: the contra account for income, or the account for expenses. Its period must be open.
26693    #[serde(rename = "purposeAccountId", deserialize_with = "crate::lenient::number")]
26694    pub purpose_account_id: i64,
26695    /// Ascending display order. Required in creation and update.
26696    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
26697    pub sort_key: i64,
26698    /// Fields not described by the spec, e.g. instance-specific DB fields.
26699    #[serde(flatten)]
26700    pub extra: serde_json::Map<String, serde_json::Value>,
26701}
26702
26703/// Reason to record when cancelling a booking.
26704#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26705pub struct TransactionStornoCreate {
26706    /// Reason added to the original booking note in a localized cancellation prefix. A repeated cancellation keeps the existing cancellation note.
26707    #[serde(deserialize_with = "crate::lenient::string")]
26708    pub note: String,
26709    /// Fields not described by the spec, e.g. instance-specific DB fields.
26710    #[serde(flatten)]
26711    pub extra: serde_json::Map<String, serde_json::Value>,
26712}
26713
26714/// Income, expense and net amount for the selected cost centers. Previous-year values are null when no previous period exists.
26715#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26716pub struct TransactionSummaryCostCenter {
26717    pub periods: TransactionSummaryCostCenterPeriods,
26718    pub summary: TransactionSummaryCostCenterSummary,
26719    /// Allowed values: `costcenter-sum`.
26720    #[serde(deserialize_with = "crate::lenient::string")]
26721    pub r#type: String,
26722    /// Fields not described by the spec, e.g. instance-specific DB fields.
26723    #[serde(flatten)]
26724    pub extra: serde_json::Map<String, serde_json::Value>,
26725}
26726
26727#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26728pub struct TransactionSummaryCostCenterPeriods {
26729    #[serde(rename = "endDate")]
26730    pub end_date: TransactionSummaryCostCenterPeriodsEndDate,
26731    #[serde(rename = "startDate")]
26732    pub start_date: TransactionSummaryCostCenterPeriodsEndDate,
26733    /// Fields not described by the spec, e.g. instance-specific DB fields.
26734    #[serde(flatten)]
26735    pub extra: serde_json::Map<String, serde_json::Value>,
26736}
26737
26738#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26739pub struct TransactionSummaryCostCenterPeriodsEndDate {
26740    /// A simple date in ISO format, e.g. '2022-10-19'
26741    #[serde(rename = "lastYear")]
26742    pub last_year: chrono::NaiveDate,
26743    /// A simple date in ISO format, e.g. '2022-10-19'
26744    #[serde(rename = "thisYear")]
26745    pub this_year: chrono::NaiveDate,
26746    /// Fields not described by the spec, e.g. instance-specific DB fields.
26747    #[serde(flatten)]
26748    pub extra: serde_json::Map<String, serde_json::Value>,
26749}
26750
26751#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26752pub struct TransactionSummaryCostCenterSummary {
26753    /// 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.
26754    pub income: FinanceYearValueComparison,
26755    /// 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.
26756    pub outcome: FinanceYearValueComparison,
26757    /// 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.
26758    pub sum: FinanceYearValueComparison,
26759    /// Fields not described by the spec, e.g. instance-specific DB fields.
26760    #[serde(flatten)]
26761    pub extra: serde_json::Map<String, serde_json::Value>,
26762}
26763
26764/// 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.
26765#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26766pub struct TransactionSummaryCreditDebit {
26767    pub periods: TransactionSummaryCostCenterPeriods,
26768    pub summary: TransactionSummaryCreditDebitSummary,
26769    /// Allowed values: `credit-debit`.
26770    #[serde(deserialize_with = "crate::lenient::string")]
26771    pub r#type: String,
26772    /// Fields not described by the spec, e.g. instance-specific DB fields.
26773    #[serde(flatten)]
26774    pub extra: serde_json::Map<String, serde_json::Value>,
26775}
26776
26777#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26778pub struct TransactionSummaryCreditDebitSummary {
26779    /// 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.
26780    pub accounts: Vec<TransactionSummaryCreditDebitSummaryAccountsItem>,
26781    /// 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.
26782    pub credit: FinanceYearValueComparison,
26783    /// 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.
26784    pub debit: FinanceYearValueComparison,
26785    /// 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.
26786    pub sum: FinanceYearValueComparison,
26787    /// Fields not described by the spec, e.g. instance-specific DB fields.
26788    #[serde(flatten)]
26789    pub extra: serde_json::Map<String, serde_json::Value>,
26790}
26791
26792#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26793pub struct TransactionSummaryCreditDebitSummaryAccountsItem {
26794    /// 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.
26795    pub balance: FinanceYearValueComparison,
26796    /// 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.
26797    pub credit: FinanceYearValueComparison,
26798    /// 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.
26799    pub debit: FinanceYearValueComparison,
26800    #[serde(deserialize_with = "crate::lenient::number")]
26801    pub id: i64,
26802    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
26803    pub name: Option<String>,
26804    #[serde(deserialize_with = "crate::lenient::string")]
26805    pub number: String,
26806    /// Fields not described by the spec, e.g. instance-specific DB fields.
26807    #[serde(flatten)]
26808    pub extra: serde_json::Map<String, serde_json::Value>,
26809}
26810
26811/// Net donations with repayments subtracted and cancellation pairs excluded. Missing previous-year donations are represented by zero.
26812#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26813pub struct TransactionSummaryDonation {
26814    pub periods: TransactionSummaryCostCenterPeriods,
26815    pub summary: TransactionSummaryDonationSummary,
26816    /// Allowed values: `donation-sum`.
26817    #[serde(deserialize_with = "crate::lenient::string")]
26818    pub r#type: String,
26819    /// Fields not described by the spec, e.g. instance-specific DB fields.
26820    #[serde(flatten)]
26821    pub extra: serde_json::Map<String, serde_json::Value>,
26822}
26823
26824#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26825pub struct TransactionSummaryDonationSummary {
26826    /// 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.
26827    pub donators: Vec<TransactionSummaryDonationSummaryDonatorsItem>,
26828    /// 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.
26829    pub sum: FinanceYearValueComparison,
26830    /// Fields not described by the spec, e.g. instance-specific DB fields.
26831    #[serde(flatten)]
26832    pub extra: serde_json::Map<String, serde_json::Value>,
26833}
26834
26835#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26836pub struct TransactionSummaryDonationSummaryDonatorsItem {
26837    /// Person as Domain Object
26838    pub person: DomainObjectPerson,
26839    /// 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.
26840    pub sum: FinanceYearValueComparison,
26841    /// Fields not described by the spec, e.g. instance-specific DB fields.
26842    #[serde(flatten)]
26843    pub extra: serde_json::Map<String, serde_json::Value>,
26844}
26845
26846/// 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.
26847#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26848pub struct TransactionUpdate {
26849    /// ID of the debit account the amount is posted to.
26850    #[serde(rename = "accountId", deserialize_with = "crate::lenient::number")]
26851    pub account_id: i64,
26852    /// 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.
26853    #[serde(deserialize_with = "crate::lenient::number")]
26854    pub amount: i64,
26855    /// Cash discount in the smallest currency unit. Used only together with cashDiscountId.
26856    ///
26857    /// `None` leaves the field out, `Some(None)` sends `null`.
26858    #[serde(rename = "cashDiscountAmount", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26859    pub cash_discount_amount: Option<Option<i64>>,
26860    /// Cash-discount definition from the same accounting period. When supplied, cashDiscountAmount must also be non-null.
26861    ///
26862    /// `None` leaves the field out, `Some(None)` sends `null`.
26863    #[serde(rename = "cashDiscountId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26864    pub cash_discount_id: Option<Option<i64>>,
26865    /// ID of the credit (contra) account the amount is posted from. Equal to `accountId` only for a cost center transfer.
26866    #[serde(rename = "contraAccountId", deserialize_with = "crate::lenient::number")]
26867    pub contra_account_id: i64,
26868    /// 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`.
26869    ///
26870    /// `None` leaves the field out, `Some(None)` sends `null`.
26871    #[serde(rename = "contraCostCenterId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26872    pub contra_cost_center_id: Option<Option<i64>>,
26873    /// 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.
26874    ///
26875    /// `None` leaves the field out, `Some(None)` sends `null`.
26876    #[serde(rename = "costCenterId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26877    pub cost_center_id: Option<Option<i64>>,
26878    /// Date printed on the underlying document/receipt.
26879    #[serde(rename = "documentDate")]
26880    pub document_date: chrono::NaiveDate,
26881    /// 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.
26882    ///
26883    /// `None` leaves the field out, `Some(None)` sends `null`.
26884    #[serde(rename = "donatorId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26885    pub donator_id: Option<Option<i64>>,
26886    /// Spouse for joint donation receipts. Requires a different donor person and an existing spouse relationship; inconsistent assignments return 422.
26887    ///
26888    /// `None` leaves the field out, `Some(None)` sends `null`.
26889    #[serde(rename = "donatorSpouseId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26890    pub donator_spouse_id: Option<Option<i64>>,
26891    /// Whether this is a donation through waived reimbursement of expenses. Defaults to false, including on update.
26892    #[serde(rename = "isWaiverOfReimbursementOfExpenses", default, skip_serializing_if = "Option::is_none")]
26893    pub is_waiver_of_reimbursement_of_expenses: Option<bool>,
26894    /// Free-text note describing the booking.
26895    #[serde(deserialize_with = "crate::lenient::string")]
26896    pub note: String,
26897    /// Tax rate from the same accounting period. Generates or updates a separate tax booking. On update, omission or null removes the existing tax booking.
26898    ///
26899    /// `None` leaves the field out, `Some(None)` sends `null`.
26900    #[serde(rename = "taxRateId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26901    pub tax_rate_id: Option<Option<i64>>,
26902    /// Replacement document number; never generated automatically on update.
26903    #[serde(rename = "documentNumber", deserialize_with = "crate::lenient::string")]
26904    pub document_number: String,
26905    /// Skip the normal donation-account/donor constraint. Spouse-consistency checks still apply when assignments change.
26906    #[serde(rename = "ignoreDonationConstraint", default, skip_serializing_if = "Option::is_none")]
26907    pub ignore_donation_constraint: Option<bool>,
26908    /// Finalize this booking and its tax booking. This cannot unlock an already immutable booking.
26909    #[serde(rename = "isImmutable", default, skip_serializing_if = "Option::is_none")]
26910    pub is_immutable: Option<bool>,
26911    /// Fields not described by the spec, e.g. instance-specific DB fields.
26912    #[serde(flatten)]
26913    pub extra: serde_json::Map<String, serde_json::Value>,
26914}
26915
26916/// Text and maintenance flags for one language of a translation key. The enclosing map identifies the language code.
26917#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26918pub struct Translation {
26919    /// Whether this language entry is marked deleted.
26920    pub deleted: bool,
26921    /// Whether this translation needs review.
26922    #[serde(rename = "needsCheck")]
26923    pub needs_check: bool,
26924    /// The translation value for the key
26925    #[serde(deserialize_with = "crate::lenient::string")]
26926    pub translation: String,
26927    /// Last updated
26928    #[serde(deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
26929    pub updated: Option<chrono::DateTime<chrono::Utc>>,
26930    /// Determines if the translation was updated or created by the church
26931    #[serde(rename = "updatedByChurch")]
26932    pub updated_by_church: bool,
26933    /// Fields not described by the spec, e.g. instance-specific DB fields.
26934    #[serde(flatten)]
26935    pub extra: serde_json::Map<String, serde_json::Value>,
26936}
26937
26938/// Translation identifier and its texts by language code. Local keys are marked createdByChurch; supplied product keys cannot be renamed or deleted through these endpoints.
26939#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26940pub struct TranslationKey {
26941    /// Whether the key was created locally by this installation.
26942    #[serde(rename = "createdByChurch")]
26943    pub created_by_church: bool,
26944    /// Whether the key is marked deleted.
26945    pub deleted: bool,
26946    #[serde(deserialize_with = "crate::lenient::number")]
26947    pub id: i64,
26948    #[serde(deserialize_with = "crate::lenient::string")]
26949    pub key: String,
26950    #[serde(deserialize_with = "crate::lenient::string")]
26951    pub module: String,
26952    /// Translations keyed by language code, for example de or en. An empty collection serializes as \[\].
26953    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
26954    pub translations: serde_json::Value,
26955    /// Last updated
26956    #[serde(deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
26957    pub updated: Option<chrono::DateTime<chrono::Utc>>,
26958    /// Fields not described by the spec, e.g. instance-specific DB fields.
26959    #[serde(flatten)]
26960    pub extra: serde_json::Map<String, serde_json::Value>,
26961}
26962
26963/// Rename or move a locally created translation key to a module. Both fields are required; translation texts are unchanged.
26964#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26965pub struct TranslationKeyUpdate {
26966    /// Translation key, trimmed before validation.
26967    #[serde(deserialize_with = "crate::lenient::string")]
26968    pub key: String,
26969    /// Module grouping, trimmed before validation. This value is stored as text rather than checked against a fixed module enum.
26970    #[serde(deserialize_with = "crate::lenient::string")]
26971    pub module: String,
26972    /// Fields not described by the spec, e.g. instance-specific DB fields.
26973    #[serde(flatten)]
26974    pub extra: serde_json::Map<String, serde_json::Value>,
26975}
26976
26977#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26978pub struct TurnoverReportCreate {
26979    /// 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.
26980    ///
26981    /// `None` leaves the field out, `Some(None)` sends `null`.
26982    #[serde(rename = "accountTypes", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26983    pub account_types: Option<Option<Vec<i64>>>,
26984    /// Accounting period owning the accounts. Requires finance edit masterdata or explicit view/edit permission for this period.
26985    #[serde(rename = "accountingPeriodId", deserialize_with = "crate::lenient::number")]
26986    pub accounting_period_id: i64,
26987    /// 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.
26988    /// Allowed values: `csv`, `pdf`, `xlsx`.
26989    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
26990    pub format: Option<String>,
26991    /// Use twelve calendar-month columns or four calendar-quarter columns for the year of the accounting period’s start date.
26992    /// Allowed values: `monthly`, `quarterly`.
26993    #[serde(deserialize_with = "crate::lenient::string")]
26994    pub period: String,
26995    /// Accepted by the shared validator but ignored by the turnover report.
26996    #[serde(rename = "showAccountGroups", default, skip_serializing_if = "Option::is_none")]
26997    pub show_account_groups: Option<bool>,
26998    /// Include zero-value accounts according to the selected report’s balance/activity calculation.
26999    #[serde(rename = "showEmptyAccounts", default, skip_serializing_if = "Option::is_none")]
27000    pub show_empty_accounts: Option<bool>,
27001    /// Fields not described by the spec, e.g. instance-specific DB fields.
27002    #[serde(flatten)]
27003    pub extra: serde_json::Map<String, serde_json::Value>,
27004}
27005
27006/// Two-factor completion result. The legacy disabled-two-factor branch returns only status and does not complete login.
27007#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27008pub struct TwoFactorLoginResult {
27009    /// 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.
27010    #[serde(rename = "redirectTo", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27011    pub redirect_to: Option<String>,
27012    #[serde(deserialize_with = "crate::lenient::string")]
27013    pub status: String,
27014    /// Fields not described by the spec, e.g. instance-specific DB fields.
27015    #[serde(flatten)]
27016    pub extra: serde_json::Map<String, serde_json::Value>,
27017}
27018
27019#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27020pub struct TwoFactorSetupActivate {
27021    /// 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.
27022    #[serde(deserialize_with = "crate::lenient::string")]
27023    pub code: String,
27024    /// Fields not described by the spec, e.g. instance-specific DB fields.
27025    #[serde(flatten)]
27026    pub extra: serde_json::Map<String, serde_json::Value>,
27027}
27028
27029/// New authenticator enrollment material. Both fields contain the same sensitive TOTP secret; initialize once and keep the result for activation.
27030#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27031pub struct TwoFactorSetupSecret {
27032    /// QR-code image as a data URI, suitable for an image element. It is not an HTTP URL.
27033    #[serde(deserialize_with = "crate::lenient::string")]
27034    pub qrcode: String,
27035    /// New Base32 authenticator secret.
27036    #[serde(deserialize_with = "crate::lenient::string")]
27037    pub secret: String,
27038    /// Fields not described by the spec, e.g. instance-specific DB fields.
27039    #[serde(flatten)]
27040    pub extra: serde_json::Map<String, serde_json::Value>,
27041}
27042
27043/// Stored statement suggestion rule. Historical values are returned as stored, including unsupported values accepted by the write validator.
27044#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27045pub struct UserRule {
27046    /// Accounts whose statement movements are eligible when allAccounts is false. An empty list then matches no accounts.
27047    #[serde(rename = "accountIds")]
27048    pub account_ids: Vec<i64>,
27049    /// Accounting period owning these rules.
27050    #[serde(rename = "accountingPeriodId", deserialize_with = "crate::lenient::number")]
27051    pub accounting_period_id: i64,
27052    /// Apply to all statement accounts in this accounting period instead of accountIds.
27053    #[serde(rename = "allAccounts")]
27054    pub all_accounts: bool,
27055    /// Generated ID, replaced when the rule set is saved.
27056    #[serde(deserialize_with = "crate::lenient::number")]
27057    pub id: i64,
27058    /// True matches incoming movements, false matches outgoing movements.
27059    #[serde(rename = "isIncome")]
27060    pub is_income: bool,
27061    /// 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.
27062    #[serde(deserialize_with = "crate::lenient::string")]
27063    pub operator: String,
27064    /// Text to match against the movement purpose, or a complete PHP regular expression including delimiters for regex (for example /donation/i).
27065    #[serde(rename = "searchString", deserialize_with = "crate::lenient::string")]
27066    pub search_string: String,
27067    /// Movement field to search. Only purpose is implemented. The storage API also accepts other strings; unsupported search types/operators produce no match.
27068    #[serde(rename = "searchType", deserialize_with = "crate::lenient::string")]
27069    pub search_type: String,
27070    /// Ascending rule order. IDs are regenerated when the complete rule set is replaced.
27071    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
27072    pub sort_key: i64,
27073    /// Booking field for which a value is suggested. The storage API also accepts other strings; unsupported search types/operators produce no match.
27074    #[serde(rename = "suggestionType", deserialize_with = "crate::lenient::string")]
27075    pub suggestion_type: String,
27076    /// Suggested account or cost-center ID encoded as a string. Referenced IDs are not validated when saving the rules.
27077    #[serde(rename = "suggestionValue", deserialize_with = "crate::lenient::string")]
27078    pub suggestion_value: String,
27079    /// Fields not described by the spec, e.g. instance-specific DB fields.
27080    #[serde(flatten)]
27081    pub extra: serde_json::Map<String, serde_json::Value>,
27082}
27083
27084/// Rule for generating booking suggestions from imported statement movements. Rules belong to an accounting period, not to the currently logged-in person.
27085#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27086pub struct UserRuleCreate {
27087    /// Accounts whose statement movements are eligible when allAccounts is false. An empty list then matches no accounts.
27088    #[serde(rename = "accountIds")]
27089    pub account_ids: Vec<i64>,
27090    /// Apply to all statement accounts in this accounting period instead of accountIds.
27091    #[serde(rename = "allAccounts")]
27092    pub all_accounts: bool,
27093    /// True matches incoming movements, false matches outgoing movements.
27094    #[serde(rename = "isIncome")]
27095    pub is_income: bool,
27096    /// contains and = compare case-insensitively. regex uses PHP preg_match with the supplied pattern and flags.
27097    /// Allowed values: `=`, `contains`, `regex`.
27098    #[serde(deserialize_with = "crate::lenient::string")]
27099    pub operator: String,
27100    /// Text to match against the movement purpose, or a complete PHP regular expression including delimiters for regex (for example /donation/i).
27101    #[serde(rename = "searchString", deserialize_with = "crate::lenient::string")]
27102    pub search_string: String,
27103    /// Movement field to search. Only purpose is implemented.
27104    /// Allowed values: `purpose`.
27105    #[serde(rename = "searchType", deserialize_with = "crate::lenient::string")]
27106    pub search_type: String,
27107    /// Ascending rule order. IDs are regenerated when the complete rule set is replaced.
27108    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
27109    pub sort_key: i64,
27110    /// Booking field for which a value is suggested.
27111    /// Allowed values: `accountId`, `contraAccountId`, `costCenterId`.
27112    #[serde(rename = "suggestionType", deserialize_with = "crate::lenient::string")]
27113    pub suggestion_type: String,
27114    /// Suggested account or cost-center ID encoded as a string. Referenced IDs are not validated when saving the rules.
27115    #[serde(rename = "suggestionValue", deserialize_with = "crate::lenient::string")]
27116    pub suggestion_value: String,
27117    /// Fields not described by the spec, e.g. instance-specific DB fields.
27118    #[serde(flatten)]
27119    pub extra: serde_json::Map<String, serde_json::Value>,
27120}
27121
27122/// Complete replacement of an accounting period’s rules. Existing rule IDs are discarded.
27123#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27124pub struct UserRulesUpdate {
27125    /// All rules to retain. An empty array removes every rule for this period.
27126    pub rules: Vec<UserRuleCreate>,
27127    /// Fields not described by the spec, e.g. instance-specific DB fields.
27128    #[serde(flatten)]
27129    pub extra: serde_json::Map<String, serde_json::Value>,
27130}
27131
27132#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27133pub struct WebsiteDataCalendar {
27134    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
27135    pub domain_id: i64,
27136    #[serde(deserialize_with = "crate::lenient::number")]
27137    pub id: i64,
27138    #[serde(rename = "additionalId", deserialize_with = "crate::lenient::number")]
27139    pub additional_id: i64,
27140    /// 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.
27141    #[serde(rename = "domainData", default, skip_serializing_if = "Option::is_none")]
27142    pub domain_data: Option<Calendar>,
27143    /// Allowed values: `calendar`.
27144    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
27145    pub domain_type: String,
27146    /// Fields not described by the spec, e.g. instance-specific DB fields.
27147    #[serde(flatten)]
27148    pub extra: serde_json::Map<String, serde_json::Value>,
27149}
27150
27151#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27152pub struct WebsiteDataCreate {
27153    #[serde(rename = "additionalId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
27154    pub additional_id: Option<i64>,
27155    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
27156    pub domain_id: i64,
27157    /// Allowed values: `calendar`, `person`, `posts-in-group`, `staff`.
27158    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
27159    pub domain_type: String,
27160    /// Fields not described by the spec, e.g. instance-specific DB fields.
27161    #[serde(flatten)]
27162    pub extra: serde_json::Map<String, serde_json::Value>,
27163}
27164
27165#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27166pub struct WebsiteDataPerson {
27167    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
27168    pub domain_id: i64,
27169    #[serde(deserialize_with = "crate::lenient::number")]
27170    pub id: i64,
27171    /// The role id
27172    #[serde(rename = "additionalId", deserialize_with = "crate::lenient::number")]
27173    pub additional_id: i64,
27174    #[serde(rename = "domainData", default, skip_serializing_if = "Option::is_none")]
27175    pub domain_data: Option<WebsiteDataPersonDomainData>,
27176    /// Allowed values: `person`.
27177    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
27178    pub domain_type: String,
27179    /// Fields not described by the spec, e.g. instance-specific DB fields.
27180    #[serde(flatten)]
27181    pub extra: serde_json::Map<String, serde_json::Value>,
27182}
27183
27184#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27185pub struct WebsiteDataPersonDomainData {
27186    pub group: DomainObjectGroup,
27187    pub members: Vec<DomainObjectPerson>,
27188    /// 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.
27189    pub role: Role,
27190    /// Fields not described by the spec, e.g. instance-specific DB fields.
27191    #[serde(flatten)]
27192    pub extra: serde_json::Map<String, serde_json::Value>,
27193}
27194
27195#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27196pub struct WebsiteDataPostsInGroup {
27197    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
27198    pub domain_id: i64,
27199    #[serde(deserialize_with = "crate::lenient::number")]
27200    pub id: i64,
27201    #[serde(rename = "additionalId", deserialize_with = "crate::lenient::number")]
27202    pub additional_id: i64,
27203    #[serde(rename = "domainData", default, skip_serializing_if = "Option::is_none")]
27204    pub domain_data: Option<WebsiteDataPostsInGroupDomainData>,
27205    /// Allowed values: `posts-in-group`.
27206    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
27207    pub domain_type: String,
27208    /// Fields not described by the spec, e.g. instance-specific DB fields.
27209    #[serde(flatten)]
27210    pub extra: serde_json::Map<String, serde_json::Value>,
27211}
27212
27213#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27214pub struct WebsiteDataPostsInGroupDomainData {
27215    pub group: DomainObjectGroup,
27216    #[serde(rename = "groupVisiblePostCount", deserialize_with = "crate::lenient::number")]
27217    pub group_visible_post_count: i64,
27218    /// Fields not described by the spec, e.g. instance-specific DB fields.
27219    #[serde(flatten)]
27220    pub extra: serde_json::Map<String, serde_json::Value>,
27221}
27222
27223#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27224pub struct WebsiteDataStaff {
27225    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
27226    pub domain_id: i64,
27227    #[serde(deserialize_with = "crate::lenient::number")]
27228    pub id: i64,
27229    #[serde(rename = "additionalId", deserialize_with = "crate::lenient::number")]
27230    pub additional_id: i64,
27231    /// Person as Domain Object
27232    #[serde(rename = "domainData", default, skip_serializing_if = "Option::is_none")]
27233    pub domain_data: Option<DomainObjectPerson>,
27234    /// Allowed values: `staff`.
27235    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
27236    pub domain_type: String,
27237    /// Fields not described by the spec, e.g. instance-specific DB fields.
27238    #[serde(flatten)]
27239    pub extra: serde_json::Map<String, serde_json::Value>,
27240}
27241
27242#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27243pub struct WebsiteDataWithoutInclude {
27244    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
27245    pub domain_id: i64,
27246    #[serde(deserialize_with = "crate::lenient::number")]
27247    pub id: i64,
27248    #[serde(rename = "additionalId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
27249    pub additional_id: Option<i64>,
27250    /// Allowed values: `calendar`, `person`, `posts-in-group`, `staff`.
27251    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
27252    pub domain_type: String,
27253    /// Fields not described by the spec, e.g. instance-specific DB fields.
27254    #[serde(flatten)]
27255    pub extra: serde_json::Map<String, serde_json::Value>,
27256}
27257
27258#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27259pub struct Weekday {
27260    #[serde(deserialize_with = "crate::lenient::number")]
27261    pub id: i64,
27262    #[serde(deserialize_with = "crate::lenient::string")]
27263    pub name: String,
27264    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
27265    pub name_translated: String,
27266    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
27267    pub sort_key: i64,
27268    /// Fields not described by the spec, e.g. instance-specific DB fields.
27269    #[serde(flatten)]
27270    pub extra: serde_json::Map<String, serde_json::Value>,
27271}
27272
27273#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27274pub struct WidgetActionAllBirthdaysAll {
27275    /// Flavor of widget action
27276    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
27277    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27278    pub flavor: Option<String>,
27279    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27280    pub icon: Option<String>,
27281    /// Allowed values: `action.allBirthdays.all`.
27282    #[serde(deserialize_with = "crate::lenient::string")]
27283    pub key: String,
27284    #[serde(deserialize_with = "crate::lenient::string")]
27285    pub label: String,
27286    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27287    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27288    /// Type of widget action
27289    /// Allowed values: `details`, `other`, `primary`, `secondary`.
27290    #[serde(deserialize_with = "crate::lenient::string")]
27291    pub r#type: String,
27292    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27293    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27294    /// Fields not described by the spec, e.g. instance-specific DB fields.
27295    #[serde(flatten)]
27296    pub extra: serde_json::Map<String, serde_json::Value>,
27297}
27298
27299#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27300pub struct WidgetActionAppointmentsAll {
27301    /// Flavor of widget action
27302    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
27303    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27304    pub flavor: Option<String>,
27305    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27306    pub icon: Option<String>,
27307    /// Allowed values: `action.appointments.all`.
27308    #[serde(deserialize_with = "crate::lenient::string")]
27309    pub key: String,
27310    #[serde(deserialize_with = "crate::lenient::string")]
27311    pub label: String,
27312    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27313    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27314    /// Type of widget action
27315    /// Allowed values: `details`, `other`, `primary`, `secondary`.
27316    #[serde(deserialize_with = "crate::lenient::string")]
27317    pub r#type: String,
27318    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27319    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27320    /// Fields not described by the spec, e.g. instance-specific DB fields.
27321    #[serde(flatten)]
27322    pub extra: serde_json::Map<String, serde_json::Value>,
27323}
27324
27325#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27326pub struct WidgetActionDataAppointment {
27327    #[serde(rename = "appointmentId", deserialize_with = "crate::lenient::number")]
27328    pub appointment_id: i64,
27329    #[serde(rename = "calendarId", deserialize_with = "crate::lenient::number")]
27330    pub calendar_id: i64,
27331    /// A simple date in ISO format, e.g. '2022-10-19'
27332    #[serde(rename = "startDate")]
27333    pub start_date: chrono::NaiveDate,
27334    /// Fields not described by the spec, e.g. instance-specific DB fields.
27335    #[serde(flatten)]
27336    pub extra: serde_json::Map<String, serde_json::Value>,
27337}
27338
27339#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27340pub struct WidgetActionDataBooking {
27341    #[serde(rename = "bookingId", deserialize_with = "crate::lenient::number")]
27342    pub booking_id: i64,
27343    /// A simple date in ISO format, e.g. '2022-10-19'
27344    #[serde(rename = "startDate")]
27345    pub start_date: chrono::NaiveDate,
27346    /// Fields not described by the spec, e.g. instance-specific DB fields.
27347    #[serde(flatten)]
27348    pub extra: serde_json::Map<String, serde_json::Value>,
27349}
27350
27351#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27352pub struct WidgetActionDataEvent {
27353    #[serde(rename = "eventId", deserialize_with = "crate::lenient::number")]
27354    pub event_id: i64,
27355    /// Fields not described by the spec, e.g. instance-specific DB fields.
27356    #[serde(flatten)]
27357    pub extra: serde_json::Map<String, serde_json::Value>,
27358}
27359
27360#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27361pub struct WidgetActionDataGroup {
27362    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
27363    pub group_id: i64,
27364    /// Fields not described by the spec, e.g. instance-specific DB fields.
27365    #[serde(flatten)]
27366    pub extra: serde_json::Map<String, serde_json::Value>,
27367}
27368
27369#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27370pub struct WidgetActionDataPerson {
27371    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
27372    pub person_id: i64,
27373    /// Fields not described by the spec, e.g. instance-specific DB fields.
27374    #[serde(flatten)]
27375    pub extra: serde_json::Map<String, serde_json::Value>,
27376}
27377
27378#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27379pub struct WidgetActionDataPostExternal {
27380    #[serde(rename = "groupGuid", deserialize_with = "crate::lenient::string")]
27381    pub group_guid: String,
27382    #[serde(deserialize_with = "crate::lenient::string")]
27383    pub guid: String,
27384    #[serde(rename = "instanceGuid", deserialize_with = "crate::lenient::string")]
27385    pub instance_guid: String,
27386    #[serde(rename = "postId", deserialize_with = "crate::lenient::number")]
27387    pub post_id: i64,
27388    /// Fields not described by the spec, e.g. instance-specific DB fields.
27389    #[serde(flatten)]
27390    pub extra: serde_json::Map<String, serde_json::Value>,
27391}
27392
27393#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27394pub struct WidgetActionDataPostInternal {
27395    #[serde(deserialize_with = "crate::lenient::string")]
27396    pub guid: String,
27397    #[serde(rename = "postId", deserialize_with = "crate::lenient::number")]
27398    pub post_id: i64,
27399    /// Fields not described by the spec, e.g. instance-specific DB fields.
27400    #[serde(flatten)]
27401    pub extra: serde_json::Map<String, serde_json::Value>,
27402}
27403
27404#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27405pub struct WidgetActionDataResource {
27406    #[serde(rename = "resourceId", deserialize_with = "crate::lenient::number")]
27407    pub resource_id: i64,
27408    /// Fields not described by the spec, e.g. instance-specific DB fields.
27409    #[serde(flatten)]
27410    pub extra: serde_json::Map<String, serde_json::Value>,
27411}
27412
27413#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27414pub struct WidgetActionDataUrl {
27415    #[serde(deserialize_with = "crate::lenient::string")]
27416    pub url: String,
27417    /// Fields not described by the spec, e.g. instance-specific DB fields.
27418    #[serde(flatten)]
27419    pub extra: serde_json::Map<String, serde_json::Value>,
27420}
27421
27422#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27423pub struct WidgetActionExchangeRequestsAll {
27424    /// Flavor of widget action
27425    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
27426    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27427    pub flavor: Option<String>,
27428    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27429    pub icon: Option<String>,
27430    /// Allowed values: `action.exchange-requests.all`.
27431    #[serde(deserialize_with = "crate::lenient::string")]
27432    pub key: String,
27433    #[serde(deserialize_with = "crate::lenient::string")]
27434    pub label: String,
27435    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27436    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27437    /// Type of widget action
27438    /// Allowed values: `details`, `other`, `primary`, `secondary`.
27439    #[serde(deserialize_with = "crate::lenient::string")]
27440    pub r#type: String,
27441    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27442    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27443    /// Fields not described by the spec, e.g. instance-specific DB fields.
27444    #[serde(flatten)]
27445    pub extra: serde_json::Map<String, serde_json::Value>,
27446}
27447
27448#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27449pub struct WidgetActionFavoriteGroupsAll {
27450    /// Flavor of widget action
27451    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
27452    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27453    pub flavor: Option<String>,
27454    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27455    pub icon: Option<String>,
27456    /// Allowed values: `action.favorite-groups.all`.
27457    #[serde(deserialize_with = "crate::lenient::string")]
27458    pub key: String,
27459    #[serde(deserialize_with = "crate::lenient::string")]
27460    pub label: String,
27461    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27462    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27463    /// Type of widget action
27464    /// Allowed values: `details`, `other`, `primary`, `secondary`.
27465    #[serde(deserialize_with = "crate::lenient::string")]
27466    pub r#type: String,
27467    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27468    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27469    /// Fields not described by the spec, e.g. instance-specific DB fields.
27470    #[serde(flatten)]
27471    pub extra: serde_json::Map<String, serde_json::Value>,
27472}
27473
27474#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27475pub struct WidgetActionGeneralUrl {
27476    /// Flavor of widget action
27477    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
27478    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27479    pub flavor: Option<String>,
27480    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27481    pub icon: Option<String>,
27482    /// Allowed values: `action.general.url`.
27483    #[serde(deserialize_with = "crate::lenient::string")]
27484    pub key: String,
27485    #[serde(deserialize_with = "crate::lenient::string")]
27486    pub label: String,
27487    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27488    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27489    /// Type of widget action
27490    /// Allowed values: `details`, `other`, `primary`, `secondary`.
27491    #[serde(deserialize_with = "crate::lenient::string")]
27492    pub r#type: String,
27493    #[serde(rename = "actionData", default, skip_serializing_if = "Option::is_none")]
27494    pub action_data: Option<WidgetActionDataUrl>,
27495    /// Fields not described by the spec, e.g. instance-specific DB fields.
27496    #[serde(flatten)]
27497    pub extra: serde_json::Map<String, serde_json::Value>,
27498}
27499
27500#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27501pub struct WidgetActionGroupMeetingAll {
27502    /// Flavor of widget action
27503    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
27504    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27505    pub flavor: Option<String>,
27506    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27507    pub icon: Option<String>,
27508    /// Allowed values: `action.groupmeeting.all`.
27509    #[serde(deserialize_with = "crate::lenient::string")]
27510    pub key: String,
27511    #[serde(deserialize_with = "crate::lenient::string")]
27512    pub label: String,
27513    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27514    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27515    /// Type of widget action
27516    /// Allowed values: `details`, `other`, `primary`, `secondary`.
27517    #[serde(deserialize_with = "crate::lenient::string")]
27518    pub r#type: String,
27519    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27520    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27521    /// Fields not described by the spec, e.g. instance-specific DB fields.
27522    #[serde(flatten)]
27523    pub extra: serde_json::Map<String, serde_json::Value>,
27524}
27525
27526#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27527pub struct WidgetActionMyBookingsAll {
27528    /// Flavor of widget action
27529    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
27530    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27531    pub flavor: Option<String>,
27532    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27533    pub icon: Option<String>,
27534    /// Allowed values: `action.my-bookings.all`.
27535    #[serde(deserialize_with = "crate::lenient::string")]
27536    pub key: String,
27537    #[serde(deserialize_with = "crate::lenient::string")]
27538    pub label: String,
27539    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27540    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27541    /// Type of widget action
27542    /// Allowed values: `details`, `other`, `primary`, `secondary`.
27543    #[serde(deserialize_with = "crate::lenient::string")]
27544    pub r#type: String,
27545    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27546    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27547    /// Fields not described by the spec, e.g. instance-specific DB fields.
27548    #[serde(flatten)]
27549    pub extra: serde_json::Map<String, serde_json::Value>,
27550}
27551
27552#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27553pub struct WidgetActionMyGroupsAll {
27554    /// Flavor of widget action
27555    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
27556    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27557    pub flavor: Option<String>,
27558    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27559    pub icon: Option<String>,
27560    /// Allowed values: `action.my-groups.all`.
27561    #[serde(deserialize_with = "crate::lenient::string")]
27562    pub key: String,
27563    #[serde(deserialize_with = "crate::lenient::string")]
27564    pub label: String,
27565    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27566    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27567    /// Type of widget action
27568    /// Allowed values: `details`, `other`, `primary`, `secondary`.
27569    #[serde(deserialize_with = "crate::lenient::string")]
27570    pub r#type: String,
27571    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27572    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27573    /// Fields not described by the spec, e.g. instance-specific DB fields.
27574    #[serde(flatten)]
27575    pub extra: serde_json::Map<String, serde_json::Value>,
27576}
27577
27578#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27579pub struct WidgetActionMyResourcesAll {
27580    /// Flavor of widget action
27581    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
27582    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27583    pub flavor: Option<String>,
27584    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27585    pub icon: Option<String>,
27586    /// Allowed values: `action.my-resources.all`.
27587    #[serde(deserialize_with = "crate::lenient::string")]
27588    pub key: String,
27589    #[serde(deserialize_with = "crate::lenient::string")]
27590    pub label: String,
27591    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27592    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27593    /// Type of widget action
27594    /// Allowed values: `details`, `other`, `primary`, `secondary`.
27595    #[serde(deserialize_with = "crate::lenient::string")]
27596    pub r#type: String,
27597    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27598    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27599    /// Fields not described by the spec, e.g. instance-specific DB fields.
27600    #[serde(flatten)]
27601    pub extra: serde_json::Map<String, serde_json::Value>,
27602}
27603
27604#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27605pub struct WidgetActionPostsAll {
27606    /// Flavor of widget action
27607    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
27608    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27609    pub flavor: Option<String>,
27610    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27611    pub icon: Option<String>,
27612    /// Allowed values: `action.posts.all`.
27613    #[serde(deserialize_with = "crate::lenient::string")]
27614    pub key: String,
27615    #[serde(deserialize_with = "crate::lenient::string")]
27616    pub label: String,
27617    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27618    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27619    /// Type of widget action
27620    /// Allowed values: `details`, `other`, `primary`, `secondary`.
27621    #[serde(deserialize_with = "crate::lenient::string")]
27622    pub r#type: String,
27623    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27624    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27625    /// Fields not described by the spec, e.g. instance-specific DB fields.
27626    #[serde(flatten)]
27627    pub extra: serde_json::Map<String, serde_json::Value>,
27628}
27629
27630#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27631pub struct WidgetActionServiceRequestsAll {
27632    /// Flavor of widget action
27633    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
27634    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27635    pub flavor: Option<String>,
27636    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27637    pub icon: Option<String>,
27638    /// Allowed values: `action.service-requests.all`.
27639    #[serde(deserialize_with = "crate::lenient::string")]
27640    pub key: String,
27641    #[serde(deserialize_with = "crate::lenient::string")]
27642    pub label: String,
27643    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27644    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27645    /// Type of widget action
27646    /// Allowed values: `details`, `other`, `primary`, `secondary`.
27647    #[serde(deserialize_with = "crate::lenient::string")]
27648    pub r#type: String,
27649    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27650    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27651    /// Fields not described by the spec, e.g. instance-specific DB fields.
27652    #[serde(flatten)]
27653    pub extra: serde_json::Map<String, serde_json::Value>,
27654}
27655
27656#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27657pub struct WidgetActionSongsToLearnAll {
27658    /// Flavor of widget action
27659    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
27660    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27661    pub flavor: Option<String>,
27662    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27663    pub icon: Option<String>,
27664    /// Allowed values: `action.songsToLearn.all`.
27665    #[serde(deserialize_with = "crate::lenient::string")]
27666    pub key: String,
27667    #[serde(deserialize_with = "crate::lenient::string")]
27668    pub label: String,
27669    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27670    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27671    /// Type of widget action
27672    /// Allowed values: `details`, `other`, `primary`, `secondary`.
27673    #[serde(deserialize_with = "crate::lenient::string")]
27674    pub r#type: String,
27675    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27676    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27677    /// Fields not described by the spec, e.g. instance-specific DB fields.
27678    #[serde(flatten)]
27679    pub extra: serde_json::Map<String, serde_json::Value>,
27680}
27681
27682#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27683pub struct WidgetActionUpcomingServicesAll {
27684    /// Flavor of widget action
27685    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
27686    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27687    pub flavor: Option<String>,
27688    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27689    pub icon: Option<String>,
27690    /// Allowed values: `action.upcoming-services.all`.
27691    #[serde(deserialize_with = "crate::lenient::string")]
27692    pub key: String,
27693    #[serde(deserialize_with = "crate::lenient::string")]
27694    pub label: String,
27695    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27696    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27697    /// Type of widget action
27698    /// Allowed values: `details`, `other`, `primary`, `secondary`.
27699    #[serde(deserialize_with = "crate::lenient::string")]
27700    pub r#type: String,
27701    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27702    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27703    /// Fields not described by the spec, e.g. instance-specific DB fields.
27704    #[serde(flatten)]
27705    pub extra: serde_json::Map<String, serde_json::Value>,
27706}
27707
27708/// Avatar for widget items
27709#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27710pub struct WidgetAvatar {
27711    #[serde(rename = "primaryDomainObject", default, skip_serializing_if = "serde_json::Value::is_null")]
27712    pub primary_domain_object: serde_json::Value,
27713    #[serde(rename = "secondaryDomainObject", default, skip_serializing_if = "serde_json::Value::is_null")]
27714    pub secondary_domain_object: serde_json::Value,
27715    /// Fields not described by the spec, e.g. instance-specific DB fields.
27716    #[serde(flatten)]
27717    pub extra: serde_json::Map<String, serde_json::Value>,
27718}
27719
27720#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27721pub struct WidgetCommon {
27722    #[serde(default, skip_serializing_if = "Option::is_none")]
27723    pub actions: Option<Vec<serde_json::Value>>,
27724    /// Strategy for handling empty widget content
27725    /// Allowed values: `HIDE`, `SHOW`.
27726    #[serde(rename = "emptyStrategy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27727    pub empty_strategy: Option<String>,
27728    #[serde(rename = "emptyText", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27729    pub empty_text: Option<String>,
27730    #[serde(default, skip_serializing_if = "Option::is_none")]
27731    pub filter: Option<WidgetDateFilterVariant1>,
27732    #[serde(rename = "helpLink", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27733    pub help_link: Option<String>,
27734    #[serde(rename = "isMandatory", default, skip_serializing_if = "Option::is_none")]
27735    pub is_mandatory: Option<bool>,
27736    #[serde(deserialize_with = "crate::lenient::string")]
27737    pub key: String,
27738    /// Allowed values: `horizontal`, `vertical`.
27739    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27740    pub orientation: Option<String>,
27741    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27742    pub replacement: Option<String>,
27743    #[serde(deserialize_with = "crate::lenient::string")]
27744    pub title: String,
27745    /// Settings specific to common widgets
27746    #[serde(rename = "widgetSettings")]
27747    pub widget_settings: WidgetSettingsCommon,
27748    /// Grouping configuration for widgets
27749    #[serde(deserialize_with = "crate::lenient::map")]
27750    pub groupings: std::collections::BTreeMap<String, WidgetGroupingOption>,
27751    pub items: Vec<WidgetCommonItem>,
27752    /// Allowed values: `common`.
27753    #[serde(rename = "widgetType", deserialize_with = "crate::lenient::string")]
27754    pub widget_type: String,
27755    /// Fields not described by the spec, e.g. instance-specific DB fields.
27756    #[serde(flatten)]
27757    pub extra: serde_json::Map<String, serde_json::Value>,
27758}
27759
27760/// Common widget item structure
27761#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27762pub struct WidgetCommonItem {
27763    #[serde(rename = "actionData", default, skip_serializing_if = "serde_json::Value::is_null")]
27764    pub action_data: serde_json::Value,
27765    pub actions: Vec<serde_json::Value>,
27766    /// Details for common widget items
27767    pub details: WidgetCommonItemDetails,
27768    #[serde(rename = "filterKeys")]
27769    pub filter_keys: Vec<String>,
27770    #[serde(rename = "groupingKeys", default, skip_serializing_if = "Option::is_none")]
27771    pub grouping_keys: Option<Vec<String>>,
27772    pub infos: Vec<WidgetDomainObjectItemInfosItem>,
27773    #[serde(rename = "summaryText", deserialize_with = "crate::lenient::string")]
27774    pub summary_text: String,
27775    #[serde(deserialize_with = "crate::lenient::string")]
27776    pub title: String,
27777    /// Fields not described by the spec, e.g. instance-specific DB fields.
27778    #[serde(flatten)]
27779    pub extra: serde_json::Map<String, serde_json::Value>,
27780}
27781
27782/// Details for common widget items
27783#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27784pub struct WidgetCommonItemDetails {
27785    #[serde(default, skip_serializing_if = "Option::is_none")]
27786    pub avatar: Option<WidgetAvatar>,
27787    #[serde(default, skip_serializing_if = "Option::is_none")]
27788    pub count: Option<WidgetCount>,
27789    #[serde(rename = "infoLists")]
27790    pub info_lists: Vec<WidgetInfoList>,
27791    #[serde(rename = "initialInfoList", default, skip_serializing_if = "Option::is_none")]
27792    pub initial_info_list: Option<WidgetInfoList>,
27793    #[serde(rename = "primaryInfoList", default, skip_serializing_if = "Option::is_none")]
27794    pub primary_info_list: Option<WidgetInfoList>,
27795    #[serde(rename = "topLine", default, skip_serializing_if = "Option::is_none")]
27796    pub top_line: Option<WidgetTopLine>,
27797    /// Fields not described by the spec, e.g. instance-specific DB fields.
27798    #[serde(flatten)]
27799    pub extra: serde_json::Map<String, serde_json::Value>,
27800}
27801
27802/// Count display for widgets
27803#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27804pub struct WidgetCount {
27805    /// A color in ChurchTools
27806    /// 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`.
27807    #[serde(deserialize_with = "crate::lenient::string")]
27808    pub color: String,
27809    #[serde(deserialize_with = "crate::lenient::string")]
27810    pub text: String,
27811    /// Allowed values: `bubble`, `regular`.
27812    #[serde(deserialize_with = "crate::lenient::string")]
27813    pub r#type: String,
27814    /// Fields not described by the spec, e.g. instance-specific DB fields.
27815    #[serde(flatten)]
27816    pub extra: serde_json::Map<String, serde_json::Value>,
27817}
27818
27819#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27820pub struct WidgetDate {
27821    #[serde(default, skip_serializing_if = "Option::is_none")]
27822    pub actions: Option<Vec<serde_json::Value>>,
27823    /// Strategy for handling empty widget content
27824    /// Allowed values: `HIDE`, `SHOW`.
27825    #[serde(rename = "emptyStrategy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27826    pub empty_strategy: Option<String>,
27827    #[serde(rename = "emptyText", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27828    pub empty_text: Option<String>,
27829    #[serde(default, skip_serializing_if = "Option::is_none")]
27830    pub filter: Option<WidgetDateFilterVariant1>,
27831    #[serde(rename = "helpLink", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27832    pub help_link: Option<String>,
27833    #[serde(rename = "isMandatory", default, skip_serializing_if = "Option::is_none")]
27834    pub is_mandatory: Option<bool>,
27835    #[serde(deserialize_with = "crate::lenient::string")]
27836    pub key: String,
27837    /// Allowed values: `horizontal`, `vertical`.
27838    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27839    pub orientation: Option<String>,
27840    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27841    pub replacement: Option<String>,
27842    #[serde(deserialize_with = "crate::lenient::string")]
27843    pub title: String,
27844    #[serde(rename = "widgetSettings")]
27845    pub widget_settings: WidgetDateWidgetSettings,
27846    pub items: Vec<WidgetDateItem>,
27847    /// Allowed values: `date`.
27848    #[serde(rename = "widgetType", deserialize_with = "crate::lenient::string")]
27849    pub widget_type: String,
27850    /// Fields not described by the spec, e.g. instance-specific DB fields.
27851    #[serde(flatten)]
27852    pub extra: serde_json::Map<String, serde_json::Value>,
27853}
27854
27855#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27856pub struct WidgetDateFilterVariant1 {
27857    #[serde(default, skip_serializing_if = "Option::is_none")]
27858    pub options: Option<Vec<WidgetDateFilterVariant1OptionsItem>>,
27859    /// Fields not described by the spec, e.g. instance-specific DB fields.
27860    #[serde(flatten)]
27861    pub extra: serde_json::Map<String, serde_json::Value>,
27862}
27863
27864#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27865pub struct WidgetDateFilterVariant1OptionsItem {
27866    #[serde(deserialize_with = "crate::lenient::string")]
27867    pub id: String,
27868    #[serde(deserialize_with = "crate::lenient::string")]
27869    pub name: String,
27870    /// Total number of groups available for this filter option.
27871    #[serde(rename = "totalCount", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
27872    pub total_count: Option<i64>,
27873    /// Fields not described by the spec, e.g. instance-specific DB fields.
27874    #[serde(flatten)]
27875    pub extra: serde_json::Map<String, serde_json::Value>,
27876}
27877
27878/// Item for widget date lists
27879#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27880pub struct WidgetDateItem {
27881    #[serde(rename = "actionData")]
27882    pub action_data: WidgetActionDataAppointment,
27883    pub actions: Vec<serde_json::Value>,
27884    pub details: WidgetDateItemDetails,
27885    #[serde(rename = "filterKeys", default, skip_serializing_if = "serde_json::Value::is_null")]
27886    pub filter_keys: serde_json::Value,
27887    pub infos: Vec<WidgetDateItemInfosItem>,
27888    #[serde(rename = "summaryText", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27889    pub summary_text: Option<String>,
27890    #[serde(deserialize_with = "crate::lenient::string")]
27891    pub title: String,
27892    /// Fields not described by the spec, e.g. instance-specific DB fields.
27893    #[serde(flatten)]
27894    pub extra: serde_json::Map<String, serde_json::Value>,
27895}
27896
27897#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27898pub struct WidgetDateItemDetails {
27899    #[serde(rename = "allDay")]
27900    pub all_day: bool,
27901    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
27902    #[serde(rename = "dateTime", serialize_with = "crate::datetime::serialize_utc")]
27903    pub date_time: chrono::DateTime<chrono::Utc>,
27904    #[serde(deserialize_with = "crate::lenient::string")]
27905    pub title: String,
27906    /// Fields not described by the spec, e.g. instance-specific DB fields.
27907    #[serde(flatten)]
27908    pub extra: serde_json::Map<String, serde_json::Value>,
27909}
27910
27911#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27912pub struct WidgetDateItemInfosItem {
27913    #[serde(deserialize_with = "crate::lenient::string")]
27914    pub text: String,
27915    /// Fields not described by the spec, e.g. instance-specific DB fields.
27916    #[serde(flatten)]
27917    pub extra: serde_json::Map<String, serde_json::Value>,
27918}
27919
27920#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27921pub struct WidgetDateWidgetSettings {
27922    /// Value for Tailwind color
27923    #[serde(rename = "backgroundColor", default, skip_serializing_if = "Option::is_none")]
27924    pub background_color: Option<Color>,
27925    /// Fields not described by the spec, e.g. instance-specific DB fields.
27926    #[serde(flatten)]
27927    pub extra: serde_json::Map<String, serde_json::Value>,
27928}
27929
27930#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27931pub struct WidgetDetail {
27932    #[serde(default, skip_serializing_if = "Option::is_none")]
27933    pub actions: Option<Vec<serde_json::Value>>,
27934    /// Strategy for handling empty widget content
27935    /// Allowed values: `HIDE`, `SHOW`.
27936    #[serde(rename = "emptyStrategy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27937    pub empty_strategy: Option<String>,
27938    #[serde(rename = "emptyText", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27939    pub empty_text: Option<String>,
27940    #[serde(default, skip_serializing_if = "Option::is_none")]
27941    pub filter: Option<WidgetDateFilterVariant1>,
27942    #[serde(rename = "helpLink", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27943    pub help_link: Option<String>,
27944    #[serde(rename = "isMandatory", default, skip_serializing_if = "Option::is_none")]
27945    pub is_mandatory: Option<bool>,
27946    #[serde(deserialize_with = "crate::lenient::string")]
27947    pub key: String,
27948    /// Allowed values: `horizontal`, `vertical`.
27949    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27950    pub orientation: Option<String>,
27951    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27952    pub replacement: Option<String>,
27953    #[serde(deserialize_with = "crate::lenient::string")]
27954    pub title: String,
27955    #[serde(rename = "widgetSettings")]
27956    pub widget_settings: WidgetDateWidgetSettings,
27957    pub items: Vec<WidgetDetailItem>,
27958    /// Allowed values: `detail`.
27959    #[serde(rename = "widgetType", deserialize_with = "crate::lenient::string")]
27960    pub widget_type: String,
27961    /// Fields not described by the spec, e.g. instance-specific DB fields.
27962    #[serde(flatten)]
27963    pub extra: serde_json::Map<String, serde_json::Value>,
27964}
27965
27966/// Item for widget detail lists
27967#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27968pub struct WidgetDetailItem {
27969    #[serde(rename = "actionData", default, skip_serializing_if = "serde_json::Value::is_null")]
27970    pub action_data: serde_json::Value,
27971    pub actions: Vec<serde_json::Value>,
27972    pub rows: Vec<serde_json::Value>,
27973    #[serde(rename = "summaryText", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27974    pub summary_text: Option<String>,
27975    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27976    pub title: Option<String>,
27977    /// Fields not described by the spec, e.g. instance-specific DB fields.
27978    #[serde(flatten)]
27979    pub extra: serde_json::Map<String, serde_json::Value>,
27980}
27981
27982/// Entry row type for widget detail items
27983#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27984pub struct WidgetDetailItemRowEntry {
27985    /// Value for Tailwind color
27986    pub color: Color,
27987    #[serde(deserialize_with = "crate::lenient::string")]
27988    pub icon: String,
27989    #[serde(deserialize_with = "crate::lenient::string")]
27990    pub text: String,
27991    /// Allowed values: `entry`.
27992    #[serde(deserialize_with = "crate::lenient::string")]
27993    pub r#type: String,
27994    /// Fields not described by the spec, e.g. instance-specific DB fields.
27995    #[serde(flatten)]
27996    pub extra: serde_json::Map<String, serde_json::Value>,
27997}
27998
27999/// Domain objects row type for widget detail items
28000#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28001pub struct WidgetDetailRowDomainObjects {
28002    #[serde(rename = "domainObjects")]
28003    pub domain_objects: Vec<serde_json::Value>,
28004    #[serde(deserialize_with = "crate::lenient::string")]
28005    pub text: String,
28006    /// Allowed values: `domainObjects`.
28007    #[serde(deserialize_with = "crate::lenient::string")]
28008    pub r#type: String,
28009    /// Fields not described by the spec, e.g. instance-specific DB fields.
28010    #[serde(flatten)]
28011    pub extra: serde_json::Map<String, serde_json::Value>,
28012}
28013
28014/// Info line row type for widget detail items
28015#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28016pub struct WidgetDetailRowInfoLine {
28017    pub infos: Vec<String>,
28018    /// Allowed values: `info-line`.
28019    #[serde(deserialize_with = "crate::lenient::string")]
28020    pub r#type: String,
28021    /// Fields not described by the spec, e.g. instance-specific DB fields.
28022    #[serde(flatten)]
28023    pub extra: serde_json::Map<String, serde_json::Value>,
28024}
28025
28026/// Primary row type for widget detail items
28027#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28028pub struct WidgetDetailRowPrimary {
28029    #[serde(deserialize_with = "crate::lenient::string")]
28030    pub text: String,
28031    /// Allowed values: `primary`.
28032    #[serde(deserialize_with = "crate::lenient::string")]
28033    pub r#type: String,
28034    /// Fields not described by the spec, e.g. instance-specific DB fields.
28035    #[serde(flatten)]
28036    pub extra: serde_json::Map<String, serde_json::Value>,
28037}
28038
28039/// Properties row type for widget detail items
28040#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28041pub struct WidgetDetailRowProperties {
28042    pub properties: Vec<WidgetDetailRowPropertiesPropertiesItem>,
28043    /// Allowed values: `properties`.
28044    #[serde(deserialize_with = "crate::lenient::string")]
28045    pub r#type: String,
28046    /// Fields not described by the spec, e.g. instance-specific DB fields.
28047    #[serde(flatten)]
28048    pub extra: serde_json::Map<String, serde_json::Value>,
28049}
28050
28051#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28052pub struct WidgetDetailRowPropertiesPropertiesItem {
28053    #[serde(deserialize_with = "crate::lenient::string")]
28054    pub label: String,
28055    pub property: Vec<String>,
28056    /// Fields not described by the spec, e.g. instance-specific DB fields.
28057    #[serde(flatten)]
28058    pub extra: serde_json::Map<String, serde_json::Value>,
28059}
28060
28061/// Status row type for widget detail items
28062#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28063pub struct WidgetDetailRowStatus {
28064    pub status: Vec<WidgetDetailRowStatusStatusItem>,
28065    /// Allowed values: `status`.
28066    #[serde(deserialize_with = "crate::lenient::string")]
28067    pub r#type: String,
28068    /// Fields not described by the spec, e.g. instance-specific DB fields.
28069    #[serde(flatten)]
28070    pub extra: serde_json::Map<String, serde_json::Value>,
28071}
28072
28073#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28074pub struct WidgetDetailRowStatusStatusItem {
28075    /// Value for Tailwind color
28076    pub color: Color,
28077    #[serde(deserialize_with = "crate::lenient::string")]
28078    pub icon: String,
28079    pub infos: Vec<String>,
28080    #[serde(deserialize_with = "crate::lenient::string")]
28081    pub status: String,
28082    /// Fields not described by the spec, e.g. instance-specific DB fields.
28083    #[serde(flatten)]
28084    pub extra: serde_json::Map<String, serde_json::Value>,
28085}
28086
28087/// Top line row type for widget detail items
28088#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28089pub struct WidgetDetailRowTopLine {
28090    /// Value for Tailwind color
28091    pub color: Color,
28092    pub infos: Vec<String>,
28093    /// Allowed values: `top-line`.
28094    #[serde(deserialize_with = "crate::lenient::string")]
28095    pub r#type: String,
28096    /// Fields not described by the spec, e.g. instance-specific DB fields.
28097    #[serde(flatten)]
28098    pub extra: serde_json::Map<String, serde_json::Value>,
28099}
28100
28101#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28102pub struct WidgetDomainObject {
28103    #[serde(default, skip_serializing_if = "Option::is_none")]
28104    pub actions: Option<Vec<serde_json::Value>>,
28105    /// Strategy for handling empty widget content
28106    /// Allowed values: `HIDE`, `SHOW`.
28107    #[serde(rename = "emptyStrategy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28108    pub empty_strategy: Option<String>,
28109    #[serde(rename = "emptyText", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28110    pub empty_text: Option<String>,
28111    #[serde(default, skip_serializing_if = "Option::is_none")]
28112    pub filter: Option<WidgetDateFilterVariant1>,
28113    #[serde(rename = "helpLink", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28114    pub help_link: Option<String>,
28115    #[serde(rename = "isMandatory", default, skip_serializing_if = "Option::is_none")]
28116    pub is_mandatory: Option<bool>,
28117    #[serde(deserialize_with = "crate::lenient::string")]
28118    pub key: String,
28119    /// Allowed values: `horizontal`, `vertical`.
28120    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28121    pub orientation: Option<String>,
28122    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28123    pub replacement: Option<String>,
28124    #[serde(deserialize_with = "crate::lenient::string")]
28125    pub title: String,
28126    #[serde(rename = "widgetSettings")]
28127    pub widget_settings: WidgetDateWidgetSettings,
28128    pub items: Vec<WidgetDomainObjectItem>,
28129    /// Allowed values: `domainObject`.
28130    #[serde(rename = "widgetType", deserialize_with = "crate::lenient::string")]
28131    pub widget_type: String,
28132    /// Fields not described by the spec, e.g. instance-specific DB fields.
28133    #[serde(flatten)]
28134    pub extra: serde_json::Map<String, serde_json::Value>,
28135}
28136
28137/// Item for widget domain object lists
28138#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28139pub struct WidgetDomainObjectItem {
28140    #[serde(rename = "actionData", default, skip_serializing_if = "serde_json::Value::is_null")]
28141    pub action_data: serde_json::Value,
28142    pub actions: Vec<serde_json::Value>,
28143    pub details: WidgetDomainObjectItemDetails,
28144    #[serde(rename = "filterKeys", default, skip_serializing_if = "serde_json::Value::is_null")]
28145    pub filter_keys: serde_json::Value,
28146    pub infos: Vec<WidgetDomainObjectItemInfosItem>,
28147    #[serde(rename = "summaryText", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28148    pub summary_text: Option<String>,
28149    #[serde(deserialize_with = "crate::lenient::string")]
28150    pub title: String,
28151    /// Fields not described by the spec, e.g. instance-specific DB fields.
28152    #[serde(flatten)]
28153    pub extra: serde_json::Map<String, serde_json::Value>,
28154}
28155
28156#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28157pub struct WidgetDomainObjectItemDetails {
28158    #[serde(rename = "domainObject", default, skip_serializing_if = "serde_json::Value::is_null")]
28159    pub domain_object: serde_json::Value,
28160    /// Fields not described by the spec, e.g. instance-specific DB fields.
28161    #[serde(flatten)]
28162    pub extra: serde_json::Map<String, serde_json::Value>,
28163}
28164
28165#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28166pub struct WidgetDomainObjectItemInfosItem {
28167    #[serde(deserialize_with = "crate::lenient::string")]
28168    pub text: String,
28169    /// Fields not described by the spec, e.g. instance-specific DB fields.
28170    #[serde(flatten)]
28171    pub extra: serde_json::Map<String, serde_json::Value>,
28172}
28173
28174/// Individual grouping option configuration
28175#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28176pub struct WidgetGroupingOption {
28177    #[serde(default, skip_serializing_if = "Option::is_none")]
28178    pub count: Option<WidgetCount>,
28179    #[serde(rename = "filterKeys")]
28180    pub filter_keys: Vec<String>,
28181    #[serde(rename = "infoList", default, skip_serializing_if = "Option::is_none")]
28182    pub info_list: Option<WidgetInfoList>,
28183    /// The title
28184    #[serde(deserialize_with = "crate::lenient::string")]
28185    pub title: String,
28186    /// Fields not described by the spec, e.g. instance-specific DB fields.
28187    #[serde(flatten)]
28188    pub extra: serde_json::Map<String, serde_json::Value>,
28189}
28190
28191#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28192pub struct WidgetHidden {
28193    #[serde(default, skip_serializing_if = "Option::is_none")]
28194    pub actions: Option<Vec<serde_json::Value>>,
28195    /// Strategy for handling empty widget content
28196    /// Allowed values: `HIDE`, `SHOW`.
28197    #[serde(rename = "emptyStrategy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28198    pub empty_strategy: Option<String>,
28199    #[serde(rename = "emptyText", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28200    pub empty_text: Option<String>,
28201    #[serde(default, skip_serializing_if = "Option::is_none")]
28202    pub filter: Option<WidgetDateFilterVariant1>,
28203    #[serde(rename = "helpLink", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28204    pub help_link: Option<String>,
28205    #[serde(rename = "isMandatory", default, skip_serializing_if = "Option::is_none")]
28206    pub is_mandatory: Option<bool>,
28207    #[serde(deserialize_with = "crate::lenient::string")]
28208    pub key: String,
28209    /// Allowed values: `horizontal`, `vertical`.
28210    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28211    pub orientation: Option<String>,
28212    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28213    pub replacement: Option<String>,
28214    #[serde(deserialize_with = "crate::lenient::string")]
28215    pub title: String,
28216    #[serde(rename = "widgetSettings")]
28217    pub widget_settings: WidgetDateWidgetSettings,
28218    /// Allowed values: `hidden`.
28219    #[serde(rename = "widgetType", deserialize_with = "crate::lenient::string")]
28220    pub widget_type: String,
28221    /// Fields not described by the spec, e.g. instance-specific DB fields.
28222    #[serde(flatten)]
28223    pub extra: serde_json::Map<String, serde_json::Value>,
28224}
28225
28226/// Information item for widget lists
28227#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28228pub struct WidgetInfoItem {
28229    /// A color in ChurchTools
28230    /// 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`.
28231    #[serde(deserialize_with = "crate::lenient::string")]
28232    pub color: String,
28233    #[serde(rename = "iconBefore", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28234    pub icon_before: Option<String>,
28235    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28236    pub label: Option<String>,
28237    #[serde(rename = "subItems")]
28238    pub sub_items: Vec<WidgetInfoSubItem>,
28239    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28240    pub text: Option<String>,
28241    /// Fields not described by the spec, e.g. instance-specific DB fields.
28242    #[serde(flatten)]
28243    pub extra: serde_json::Map<String, serde_json::Value>,
28244}
28245
28246/// List of information items for widgets
28247#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28248pub struct WidgetInfoList {
28249    /// Direction for widget info lists
28250    /// Allowed values: `horizontal`, `vertical`, `wrapped`.
28251    #[serde(deserialize_with = "crate::lenient::string")]
28252    pub direction: String,
28253    #[serde(rename = "infoItems")]
28254    pub info_items: Vec<WidgetInfoItem>,
28255    /// Size options for widget info lists
28256    /// Allowed values: `medium`, `small`.
28257    #[serde(deserialize_with = "crate::lenient::string")]
28258    pub size: String,
28259    #[serde(rename = "withLabel")]
28260    pub with_label: bool,
28261    /// Fields not described by the spec, e.g. instance-specific DB fields.
28262    #[serde(flatten)]
28263    pub extra: serde_json::Map<String, serde_json::Value>,
28264}
28265
28266/// Sub-item for widget information items
28267#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28268pub struct WidgetInfoSubItem {
28269    /// A color in ChurchTools
28270    /// 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`.
28271    #[serde(deserialize_with = "crate::lenient::string")]
28272    pub color: String,
28273    #[serde(rename = "iconBefore", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28274    pub icon_before: Option<String>,
28275    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28276    pub text: Option<String>,
28277    /// Fields not described by the spec, e.g. instance-specific DB fields.
28278    #[serde(flatten)]
28279    pub extra: serde_json::Map<String, serde_json::Value>,
28280}
28281
28282#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28283pub struct WidgetItemActionAppointmentDetails {
28284    /// Flavor of widget action
28285    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
28286    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28287    pub flavor: Option<String>,
28288    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28289    pub icon: Option<String>,
28290    /// Allowed values: `action.appointment.details`.
28291    #[serde(deserialize_with = "crate::lenient::string")]
28292    pub key: String,
28293    #[serde(deserialize_with = "crate::lenient::string")]
28294    pub label: String,
28295    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
28296    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
28297    /// Type of widget action
28298    /// Allowed values: `details`, `other`, `primary`, `secondary`.
28299    #[serde(deserialize_with = "crate::lenient::string")]
28300    pub r#type: String,
28301    #[serde(rename = "actionData", default, skip_serializing_if = "Option::is_none")]
28302    pub action_data: Option<WidgetActionDataAppointment>,
28303    /// Fields not described by the spec, e.g. instance-specific DB fields.
28304    #[serde(flatten)]
28305    pub extra: serde_json::Map<String, serde_json::Value>,
28306}
28307
28308#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28309pub struct WidgetItemActionBirthdayDetails {
28310    /// Flavor of widget action
28311    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
28312    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28313    pub flavor: Option<String>,
28314    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28315    pub icon: Option<String>,
28316    /// Allowed values: `action.birthday.details`.
28317    #[serde(deserialize_with = "crate::lenient::string")]
28318    pub key: String,
28319    #[serde(deserialize_with = "crate::lenient::string")]
28320    pub label: String,
28321    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
28322    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
28323    /// Type of widget action
28324    /// Allowed values: `details`, `other`, `primary`, `secondary`.
28325    #[serde(deserialize_with = "crate::lenient::string")]
28326    pub r#type: String,
28327    #[serde(rename = "actionData", default, skip_serializing_if = "Option::is_none")]
28328    pub action_data: Option<WidgetActionDataPerson>,
28329    /// Fields not described by the spec, e.g. instance-specific DB fields.
28330    #[serde(flatten)]
28331    pub extra: serde_json::Map<String, serde_json::Value>,
28332}
28333
28334#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28335pub struct WidgetItemActionBookingDetails {
28336    /// Flavor of widget action
28337    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
28338    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28339    pub flavor: Option<String>,
28340    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28341    pub icon: Option<String>,
28342    /// Allowed values: `action.my-bookings.details`.
28343    #[serde(deserialize_with = "crate::lenient::string")]
28344    pub key: String,
28345    #[serde(deserialize_with = "crate::lenient::string")]
28346    pub label: String,
28347    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
28348    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
28349    /// Type of widget action
28350    /// Allowed values: `details`, `other`, `primary`, `secondary`.
28351    #[serde(deserialize_with = "crate::lenient::string")]
28352    pub r#type: String,
28353    #[serde(rename = "actionData", default, skip_serializing_if = "Option::is_none")]
28354    pub action_data: Option<WidgetActionDataBooking>,
28355    /// Fields not described by the spec, e.g. instance-specific DB fields.
28356    #[serde(flatten)]
28357    pub extra: serde_json::Map<String, serde_json::Value>,
28358}
28359
28360#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28361pub struct WidgetItemActionEventAgenda {
28362    /// Flavor of widget action
28363    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
28364    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28365    pub flavor: Option<String>,
28366    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28367    pub icon: Option<String>,
28368    /// Allowed values: `action.event.agenda`.
28369    #[serde(deserialize_with = "crate::lenient::string")]
28370    pub key: String,
28371    #[serde(deserialize_with = "crate::lenient::string")]
28372    pub label: String,
28373    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
28374    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
28375    /// Type of widget action
28376    /// Allowed values: `details`, `other`, `primary`, `secondary`.
28377    #[serde(deserialize_with = "crate::lenient::string")]
28378    pub r#type: String,
28379    #[serde(rename = "actionData", default, skip_serializing_if = "Option::is_none")]
28380    pub action_data: Option<WidgetActionDataEvent>,
28381    /// Fields not described by the spec, e.g. instance-specific DB fields.
28382    #[serde(flatten)]
28383    pub extra: serde_json::Map<String, serde_json::Value>,
28384}
28385
28386#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28387pub struct WidgetItemActionEventDetails {
28388    /// Flavor of widget action
28389    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
28390    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28391    pub flavor: Option<String>,
28392    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28393    pub icon: Option<String>,
28394    /// Allowed values: `action.event.details`.
28395    #[serde(deserialize_with = "crate::lenient::string")]
28396    pub key: String,
28397    #[serde(deserialize_with = "crate::lenient::string")]
28398    pub label: String,
28399    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
28400    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
28401    /// Type of widget action
28402    /// Allowed values: `details`, `other`, `primary`, `secondary`.
28403    #[serde(deserialize_with = "crate::lenient::string")]
28404    pub r#type: String,
28405    #[serde(rename = "actionData", default, skip_serializing_if = "Option::is_none")]
28406    pub action_data: Option<WidgetActionDataEvent>,
28407    /// Fields not described by the spec, e.g. instance-specific DB fields.
28408    #[serde(flatten)]
28409    pub extra: serde_json::Map<String, serde_json::Value>,
28410}
28411
28412#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28413pub struct WidgetItemActionEventfactDetails {
28414    /// Flavor of widget action
28415    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
28416    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28417    pub flavor: Option<String>,
28418    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28419    pub icon: Option<String>,
28420    /// Allowed values: `action.eventfact.details`.
28421    #[serde(deserialize_with = "crate::lenient::string")]
28422    pub key: String,
28423    #[serde(deserialize_with = "crate::lenient::string")]
28424    pub label: String,
28425    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
28426    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
28427    /// Type of widget action
28428    /// Allowed values: `details`, `other`, `primary`, `secondary`.
28429    #[serde(deserialize_with = "crate::lenient::string")]
28430    pub r#type: String,
28431    #[serde(rename = "actionData", default, skip_serializing_if = "Option::is_none")]
28432    pub action_data: Option<WidgetActionDataEvent>,
28433    /// Fields not described by the spec, e.g. instance-specific DB fields.
28434    #[serde(flatten)]
28435    pub extra: serde_json::Map<String, serde_json::Value>,
28436}
28437
28438#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28439pub struct WidgetItemActionExchangeRequests {
28440    /// Flavor of widget action
28441    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
28442    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28443    pub flavor: Option<String>,
28444    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28445    pub icon: Option<String>,
28446    /// Allowed values: `action.exchangeRequests.accept`, `action.exchangeRequests.cancel`, `action.exchangeRequests.decline`, `action.exchangeRequests.request`.
28447    #[serde(deserialize_with = "crate::lenient::string")]
28448    pub key: String,
28449    #[serde(deserialize_with = "crate::lenient::string")]
28450    pub label: String,
28451    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
28452    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
28453    /// Type of widget action
28454    /// Allowed values: `details`, `other`, `primary`, `secondary`.
28455    #[serde(deserialize_with = "crate::lenient::string")]
28456    pub r#type: String,
28457    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
28458    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
28459    /// Fields not described by the spec, e.g. instance-specific DB fields.
28460    #[serde(flatten)]
28461    pub extra: serde_json::Map<String, serde_json::Value>,
28462}
28463
28464#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28465pub struct WidgetItemActionGroupDetails {
28466    /// Flavor of widget action
28467    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
28468    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28469    pub flavor: Option<String>,
28470    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28471    pub icon: Option<String>,
28472    /// Allowed values: `action.group.details`.
28473    #[serde(deserialize_with = "crate::lenient::string")]
28474    pub key: String,
28475    #[serde(deserialize_with = "crate::lenient::string")]
28476    pub label: String,
28477    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
28478    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
28479    /// Type of widget action
28480    /// Allowed values: `details`, `other`, `primary`, `secondary`.
28481    #[serde(deserialize_with = "crate::lenient::string")]
28482    pub r#type: String,
28483    #[serde(rename = "actionData", default, skip_serializing_if = "Option::is_none")]
28484    pub action_data: Option<WidgetActionDataGroup>,
28485    /// Fields not described by the spec, e.g. instance-specific DB fields.
28486    #[serde(flatten)]
28487    pub extra: serde_json::Map<String, serde_json::Value>,
28488}
28489
28490#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28491pub struct WidgetItemActionMyResourcesDetails {
28492    /// Flavor of widget action
28493    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
28494    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28495    pub flavor: Option<String>,
28496    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28497    pub icon: Option<String>,
28498    /// Allowed values: `action.my-resources.details`.
28499    #[serde(deserialize_with = "crate::lenient::string")]
28500    pub key: String,
28501    #[serde(deserialize_with = "crate::lenient::string")]
28502    pub label: String,
28503    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
28504    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
28505    /// Type of widget action
28506    /// Allowed values: `details`, `other`, `primary`, `secondary`.
28507    #[serde(deserialize_with = "crate::lenient::string")]
28508    pub r#type: String,
28509    #[serde(rename = "actionData", default, skip_serializing_if = "Option::is_none")]
28510    pub action_data: Option<WidgetActionDataResource>,
28511    /// Fields not described by the spec, e.g. instance-specific DB fields.
28512    #[serde(flatten)]
28513    pub extra: serde_json::Map<String, serde_json::Value>,
28514}
28515
28516#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28517pub struct WidgetItemActionPostDetails {
28518    /// Flavor of widget action
28519    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
28520    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28521    pub flavor: Option<String>,
28522    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28523    pub icon: Option<String>,
28524    /// Allowed values: `action.post.details`.
28525    #[serde(deserialize_with = "crate::lenient::string")]
28526    pub key: String,
28527    #[serde(deserialize_with = "crate::lenient::string")]
28528    pub label: String,
28529    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
28530    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
28531    /// Type of widget action
28532    /// Allowed values: `details`, `other`, `primary`, `secondary`.
28533    #[serde(deserialize_with = "crate::lenient::string")]
28534    pub r#type: String,
28535    #[serde(rename = "actionData", default, skip_serializing_if = "serde_json::Value::is_null")]
28536    pub action_data: serde_json::Value,
28537    /// Fields not described by the spec, e.g. instance-specific DB fields.
28538    #[serde(flatten)]
28539    pub extra: serde_json::Map<String, serde_json::Value>,
28540}
28541
28542#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28543pub struct WidgetItemActionServiceRequests {
28544    /// Flavor of widget action
28545    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
28546    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28547    pub flavor: Option<String>,
28548    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28549    pub icon: Option<String>,
28550    /// Allowed values: `action.serviceRequests.absence`, `action.serviceRequests.accept`, `action.serviceRequests.comment`, `action.serviceRequests.decline`, `action.serviceRequests.exchange`, `action.serviceRequests.undo`.
28551    #[serde(deserialize_with = "crate::lenient::string")]
28552    pub key: String,
28553    #[serde(deserialize_with = "crate::lenient::string")]
28554    pub label: String,
28555    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
28556    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
28557    /// Type of widget action
28558    /// Allowed values: `details`, `other`, `primary`, `secondary`.
28559    #[serde(deserialize_with = "crate::lenient::string")]
28560    pub r#type: String,
28561    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
28562    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
28563    /// Fields not described by the spec, e.g. instance-specific DB fields.
28564    #[serde(flatten)]
28565    pub extra: serde_json::Map<String, serde_json::Value>,
28566}
28567
28568#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28569pub struct WidgetItemActionSongsToLearnDetails {
28570    /// Flavor of widget action
28571    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
28572    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28573    pub flavor: Option<String>,
28574    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28575    pub icon: Option<String>,
28576    /// Allowed values: `action.songsToLearn.details`.
28577    #[serde(deserialize_with = "crate::lenient::string")]
28578    pub key: String,
28579    #[serde(deserialize_with = "crate::lenient::string")]
28580    pub label: String,
28581    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
28582    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
28583    /// Type of widget action
28584    /// Allowed values: `details`, `other`, `primary`, `secondary`.
28585    #[serde(deserialize_with = "crate::lenient::string")]
28586    pub r#type: String,
28587    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
28588    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
28589    /// Fields not described by the spec, e.g. instance-specific DB fields.
28590    #[serde(flatten)]
28591    pub extra: serde_json::Map<String, serde_json::Value>,
28592}
28593
28594#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28595pub struct WidgetPost {
28596    #[serde(default, skip_serializing_if = "Option::is_none")]
28597    pub actions: Option<Vec<serde_json::Value>>,
28598    /// Strategy for handling empty widget content
28599    /// Allowed values: `HIDE`, `SHOW`.
28600    #[serde(rename = "emptyStrategy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28601    pub empty_strategy: Option<String>,
28602    #[serde(rename = "emptyText", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28603    pub empty_text: Option<String>,
28604    #[serde(default, skip_serializing_if = "Option::is_none")]
28605    pub filter: Option<WidgetDateFilterVariant1>,
28606    #[serde(rename = "helpLink", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28607    pub help_link: Option<String>,
28608    #[serde(rename = "isMandatory", default, skip_serializing_if = "Option::is_none")]
28609    pub is_mandatory: Option<bool>,
28610    #[serde(deserialize_with = "crate::lenient::string")]
28611    pub key: String,
28612    /// Allowed values: `horizontal`, `vertical`.
28613    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28614    pub orientation: Option<String>,
28615    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28616    pub replacement: Option<String>,
28617    #[serde(deserialize_with = "crate::lenient::string")]
28618    pub title: String,
28619    #[serde(rename = "widgetSettings")]
28620    pub widget_settings: WidgetDateWidgetSettings,
28621    pub items: Vec<WidgetPostItem>,
28622    /// Allowed values: `post`.
28623    #[serde(rename = "widgetType", deserialize_with = "crate::lenient::string")]
28624    pub widget_type: String,
28625    /// Fields not described by the spec, e.g. instance-specific DB fields.
28626    #[serde(flatten)]
28627    pub extra: serde_json::Map<String, serde_json::Value>,
28628}
28629
28630/// Item for widget post lists
28631#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28632pub struct WidgetPostItem {
28633    #[serde(rename = "actionData", default, skip_serializing_if = "serde_json::Value::is_null")]
28634    pub action_data: serde_json::Value,
28635    pub actions: Vec<serde_json::Value>,
28636    pub details: WidgetPostItemDetails,
28637    #[serde(rename = "filterKeys", default, skip_serializing_if = "serde_json::Value::is_null")]
28638    pub filter_keys: serde_json::Value,
28639    pub infos: Vec<WidgetDomainObjectItemInfosItem>,
28640    #[serde(rename = "summaryText", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28641    pub summary_text: Option<String>,
28642    #[serde(deserialize_with = "crate::lenient::string")]
28643    pub title: String,
28644    /// Fields not described by the spec, e.g. instance-specific DB fields.
28645    #[serde(flatten)]
28646    pub extra: serde_json::Map<String, serde_json::Value>,
28647}
28648
28649#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28650pub struct WidgetPostItemDetails {
28651    pub post: Post,
28652    /// Fields not described by the spec, e.g. instance-specific DB fields.
28653    #[serde(flatten)]
28654    pub extra: serde_json::Map<String, serde_json::Value>,
28655}
28656
28657/// Settings specific to common widgets
28658#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28659pub struct WidgetSettingsCommon {
28660    /// Density options for common widgets
28661    /// Allowed values: `compact`, `default`, `divided`.
28662    #[serde(deserialize_with = "crate::lenient::string")]
28663    pub density: String,
28664    /// Fields not described by the spec, e.g. instance-specific DB fields.
28665    #[serde(flatten)]
28666    pub extra: serde_json::Map<String, serde_json::Value>,
28667}
28668
28669/// Top line text for widget items
28670#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28671pub struct WidgetTopLine {
28672    #[serde(deserialize_with = "crate::lenient::string")]
28673    pub text: String,
28674    /// Fields not described by the spec, e.g. instance-specific DB fields.
28675    #[serde(flatten)]
28676    pub extra: serde_json::Map<String, serde_json::Value>,
28677}
28678
28679/// A category organizes wiki pages and is the unit of wiki access permissions.
28680#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28681pub struct WikiCategory {
28682    /// Campus association, or null when no campus is assigned.
28683    #[serde(rename = "campusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
28684    pub campus_id: Option<i64>,
28685    /// Whether files in this wiki category can be read without category-view permission. This flag does not make the wiki pages themselves public.
28686    #[serde(rename = "fileAccessWithoutPermission")]
28687    pub file_access_without_permission: bool,
28688    /// Whether the category should appear in navigation menus; it is still returned by the category catalog when false.
28689    #[serde(rename = "inMenu")]
28690    pub in_menu: bool,
28691    /// Category name; unlike page titles it is not trimmed.
28692    #[serde(deserialize_with = "crate::lenient::string")]
28693    pub name: String,
28694    /// Sort order; negative values are accepted.
28695    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
28696    pub sort_key: i64,
28697    /// Wiki category ID used in category/page endpoint URLs.
28698    #[serde(deserialize_with = "crate::lenient::number")]
28699    pub id: i64,
28700    /// Display name translated for the current request language.
28701    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
28702    pub name_translated: String,
28703    /// Page-operation hints based on category edit rights. Populated by the category list; normally empty in create/update and embedded page categories.
28704    pub permissions: GroupWikiCategoryPagesItemCategoryPermissions,
28705    /// Fields not described by the spec, e.g. instance-specific DB fields.
28706    #[serde(flatten)]
28707    pub extra: serde_json::Map<String, serde_json::Value>,
28708}
28709
28710#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28711pub struct WikiCategoryCreate {
28712    /// Optional campus association. Omission/null clears it; an unknown ID currently also resolves to no campus.
28713    ///
28714    /// `None` leaves the field out, `Some(None)` sends `null`.
28715    #[serde(rename = "campusId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
28716    pub campus_id: Option<Option<i64>>,
28717    /// Whether files in this wiki category can be read without category-view permission. This flag does not make the wiki pages themselves public.
28718    #[serde(rename = "fileAccessWithoutPermission")]
28719    pub file_access_without_permission: bool,
28720    /// Whether the category should appear in navigation menus; it is still returned by the category catalog when false.
28721    #[serde(rename = "inMenu")]
28722    pub in_menu: bool,
28723    /// Category name; unlike page titles it is not trimmed.
28724    #[serde(deserialize_with = "crate::lenient::string")]
28725    pub name: String,
28726    /// Sort order; negative values are accepted.
28727    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
28728    pub sort_key: i64,
28729    /// Fields not described by the spec, e.g. instance-specific DB fields.
28730    #[serde(flatten)]
28731    pub extra: serde_json::Map<String, serde_json::Value>,
28732}
28733
28734/// Replacement category settings. The optional campus association is cleared on omission.
28735#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28736pub struct WikiCategoryUpdate {
28737    /// Optional campus association. Omission/null clears it; an unknown ID currently also resolves to no campus.
28738    ///
28739    /// `None` leaves the field out, `Some(None)` sends `null`.
28740    #[serde(rename = "campusId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
28741    pub campus_id: Option<Option<i64>>,
28742    /// Whether files in this wiki category can be read without category-view permission. This flag does not make the wiki pages themselves public.
28743    #[serde(rename = "fileAccessWithoutPermission")]
28744    pub file_access_without_permission: bool,
28745    /// Whether the category should appear in navigation menus; it is still returned by the category catalog when false.
28746    #[serde(rename = "inMenu")]
28747    pub in_menu: bool,
28748    /// Category name; unlike page titles it is not trimmed.
28749    #[serde(deserialize_with = "crate::lenient::string")]
28750    pub name: String,
28751    /// Sort order; negative values are accepted.
28752    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
28753    pub sort_key: i64,
28754    /// Fields not described by the spec, e.g. instance-specific DB fields.
28755    #[serde(flatten)]
28756    pub extra: serde_json::Map<String, serde_json::Value>,
28757}
28758
28759/// 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.
28760#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28761pub struct WikiPage {
28762    /// Compatibility marker used by existing clients.
28763    #[serde(rename = "@deprecated")]
28764    pub deprecated: SimpleWikiPageDeprecated,
28765    /// Stable page GUID across versions in its category.
28766    #[serde(deserialize_with = "crate::lenient::string")]
28767    pub guid: String,
28768    /// Deprecated alias for `guid`. Use `guid` instead.
28769    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28770    #[deprecated = "Use `guid` instead."]
28771    pub identifier: Option<String>,
28772    /// Whether page text is Markdown rather than legacy HTML.
28773    #[serde(rename = "isMarkdown")]
28774    pub is_markdown: bool,
28775    pub meta: MetaDataEntityPerson,
28776    /// Whether the page is configured to appear on the wiki start page.
28777    #[serde(rename = "onStartpage")]
28778    pub on_startpage: bool,
28779    /// Page editing/deletion capabilities for the current user; system pages have additional restrictions.
28780    pub permissions: SimpleWikiPagePermissions,
28781    /// Stored redirect title. API reads return the page and this value; they do not follow the redirect.
28782    #[serde(rename = "redirectTo", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28783    pub redirect_to: Option<String>,
28784    /// Query-focused preview snippet. Present when the page list endpoint is called with a search query.
28785    #[serde(rename = "searchPreview", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28786    pub search_preview: Option<String>,
28787    #[serde(deserialize_with = "crate::lenient::string")]
28788    pub text: String,
28789    /// 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.
28790    #[serde(rename = "textPreview", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28791    pub text_preview: Option<String>,
28792    #[serde(deserialize_with = "crate::lenient::string")]
28793    pub title: String,
28794    /// Revision number of this page.
28795    #[serde(deserialize_with = "crate::lenient::number")]
28796    pub version: i64,
28797    /// A category organizes wiki pages and is the unit of wiki access permissions.
28798    #[serde(rename = "wikiCategory")]
28799    pub wiki_category: WikiCategory,
28800    /// Fields not described by the spec, e.g. instance-specific DB fields.
28801    #[serde(flatten)]
28802    pub extra: serde_json::Map<String, serde_json::Value>,
28803}
28804
28805#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28806pub struct WikiPageCreate {
28807    /// Whether text is Markdown. False selects legacy HTML, sanitized on normal text reads.
28808    #[serde(rename = "isMarkdown", default, skip_serializing_if = "Option::is_none")]
28809    pub is_markdown: Option<bool>,
28810    /// Whether this page is marked for display on the wiki start page.
28811    #[serde(rename = "onStartpage", default, skip_serializing_if = "Option::is_none")]
28812    pub on_startpage: Option<bool>,
28813    /// Trimmed Markdown or legacy HTML according to isMarkdown. Omitted, null or blank content is stored as null and read back as an empty string.
28814    ///
28815    /// `None` leaves the field out, `Some(None)` sends `null`.
28816    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
28817    pub text: Option<Option<String>>,
28818    /// Trimmed unique page title; Unicode ellipsis is normalized to three periods.
28819    #[serde(deserialize_with = "crate::lenient::string")]
28820    pub title: String,
28821    /// Fields not described by the spec, e.g. instance-specific DB fields.
28822    #[serde(flatten)]
28823    pub extra: serde_json::Map<String, serde_json::Value>,
28824}
28825
28826/// Partial page update; an empty object is accepted. The page title, GUID and category are not editable here.
28827#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28828pub struct WikiPageUpdate {
28829    #[serde(rename = "isMarkdown", default, skip_serializing_if = "Option::is_none")]
28830    pub is_markdown: Option<bool>,
28831    #[serde(rename = "onStartpage", default, skip_serializing_if = "Option::is_none")]
28832    pub on_startpage: Option<bool>,
28833    /// Trimmed replacement content. A different stored value creates a new version; null or blank clears the text. Omission leaves it unchanged.
28834    ///
28835    /// `None` leaves the field out, `Some(None)` sends `null`.
28836    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
28837    pub text: Option<Option<String>>,
28838    /// Fields not described by the spec, e.g. instance-specific DB fields.
28839    #[serde(flatten)]
28840    pub extra: serde_json::Map<String, serde_json::Value>,
28841}
28842
28843/// 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.
28844#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28845pub struct WikiSearchResult {
28846    /// URL for the full API resource, if available. Some legacy domain implementations produce inconsistent URLs.
28847    #[serde(rename = "apiUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28848    pub api_url: Option<String>,
28849    /// Optional display color.
28850    /// 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`.
28851    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
28852    pub color: serde_json::Value,
28853    /// Opaque identifier within the domain; do not assume that every domain uses a numeric ID.
28854    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::string")]
28855    pub domain_identifier: String,
28856    /// Optional image URL.
28857    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28858    pub image_url: Option<String>,
28859    /// Additional localized display lines; not structured resource fields.
28860    #[serde(default, skip_serializing_if = "Option::is_none")]
28861    pub infos: Option<Vec<String>>,
28862    /// Optional initials for an avatar fallback.
28863    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28864    pub initials: Option<String>,
28865    /// Display title of the referenced object.
28866    #[serde(deserialize_with = "crate::lenient::string")]
28867    pub title: String,
28868    #[serde(rename = "domainAttributes")]
28869    pub domain_attributes: DomainObjectWikiPageDomainAttributes,
28870    /// Allowed values: `wiki_page`.
28871    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
28872    pub domain_type: String,
28873    #[serde(rename = "frontendUrl", deserialize_with = "crate::lenient::string")]
28874    pub frontend_url: String,
28875    /// Allowed values: `file`.
28876    #[serde(deserialize_with = "crate::lenient::string")]
28877    pub icon: String,
28878    /// Search excerpt, possibly empty, with Markdown emphasis for matching text.
28879    #[serde(deserialize_with = "crate::lenient::string")]
28880    pub preview: String,
28881    #[serde(deserialize_with = "crate::lenient::string")]
28882    pub r#type: String,
28883    /// Fields not described by the spec, e.g. instance-specific DB fields.
28884    #[serde(flatten)]
28885    pub extra: serde_json::Map<String, serde_json::Value>,
28886}