zulip-api 0.0.8

Client library for interacting with the Zulip API
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
use serde::{Deserialize, Serialize};

use crate::{
    field_access, impl_default, impl_display, AutomaticallyFollowTopicsPolicy,
    AutomaticallyUnmuteTopicsInMutedStreamsPolicy, ColorScheme, DemoteInactiveStreams,
    DesktopIconCountDisplay, EmailAddressVisibility, Emojiset, RealmNameInEmailNotificationsPolicy,
    ResolvedTopicNoticeAutoReadPolicy, UserListStyle, WebAnimateImagePreviews,
    WebChannelDefaultView, WebHomeView, WebMarkReadOnScrollPolicy,
    WebStreamUnreadsCountDisplayPolicy,
};

mod emojiset_choice;

pub use emojiset_choice::UserSettingsEmojisetChoice;

/// Represents the user's personal settings.
///
/// **Changes**: Removed `dense_mode` setting in Zulip 10.0 (feature level 364) as we now have `web_font_size_px` and `web_line_height_percent` settings for more control.  New in Zulip 5.0 (feature level 89). Previously, these settings appeared in the top-level object, where they are available for clients without the `user_settings_object` client capability for backwards-compatibility.
///
/// Modified from `openapi-generator-cli` output:
///
/// ```shell,no_build,no_run
/// $ openapi-generator-cli generate -g rust -i ./zerver/openapi/zulip.yaml -o zulip-openapi --skip-validate-spec
/// ```
///
/// ```text
/// /*
/// * Zulip REST API
/// *
/// * Powerful open source group chat
/// *
/// * The version of the OpenAPI document: 1.0.0
/// *
/// * Generated by: https://openapi-generator.tech
/// */
/// ```
///
/// See [zerver/openapi/zulip.yaml](https://github.com/zulip/zulip/blob/main/zerver/openapi/zulip.yaml) for the original OpenAPI configuration.
///
/// Configuration slightly modified to work with the Rust generator of [`openapi-generator-cli`](https://openapi-generator.tech).
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct UserSettings {
    #[serde(skip_serializing_if = "Option::is_none")]
    twenty_four_hour_time: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    web_mark_read_on_scroll_policy: Option<WebMarkReadOnScrollPolicy>,
    #[serde(skip_serializing_if = "Option::is_none")]
    web_channel_default_view: Option<WebChannelDefaultView>,
    #[serde(skip_serializing_if = "Option::is_none")]
    starred_message_counts: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    receives_typing_notifications: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    web_suggest_update_timezone: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    fluid_layout_width: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    high_contrast_mode: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    web_font_size_px: Option<i32>,
    #[serde(skip_serializing_if = "Option::is_none")]
    web_line_height_percent: Option<i32>,
    #[serde(skip_serializing_if = "Option::is_none")]
    color_scheme: Option<ColorScheme>,
    #[serde(skip_serializing_if = "Option::is_none")]
    translate_emoticons: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    display_emoji_reaction_users: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    default_language: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    web_home_view: Option<WebHomeView>,
    #[serde(skip_serializing_if = "Option::is_none")]
    web_escape_navigates_to_home_view: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    left_side_userlist: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    emojiset: Option<Emojiset>,
    #[serde(skip_serializing_if = "Option::is_none")]
    demote_inactive_streams: Option<DemoteInactiveStreams>,
    #[serde(skip_serializing_if = "Option::is_none")]
    user_list_style: Option<UserListStyle>,
    #[serde(skip_serializing_if = "Option::is_none")]
    web_animate_image_previews: Option<WebAnimateImagePreviews>,
    #[serde(skip_serializing_if = "Option::is_none")]
    web_stream_unreads_count_display_policy: Option<WebStreamUnreadsCountDisplayPolicy>,
    #[serde(skip_serializing_if = "Option::is_none")]
    hide_ai_features: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    web_left_sidebar_show_channel_folders: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    web_left_sidebar_unreads_count_summary: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    timezone: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    enter_sends: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    enable_drafts_synchronization: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    enable_stream_desktop_notifications: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    enable_stream_email_notifications: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    enable_stream_push_notifications: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    enable_stream_audible_notifications: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    notification_sound: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    enable_desktop_notifications: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    enable_sounds: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    enable_followed_topic_desktop_notifications: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    enable_followed_topic_email_notifications: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    enable_followed_topic_push_notifications: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    enable_followed_topic_audible_notifications: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    email_notifications_batching_period_seconds: Option<i32>,
    #[serde(skip_serializing_if = "Option::is_none")]
    enable_offline_email_notifications: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    enable_offline_push_notifications: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    enable_online_push_notifications: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    enable_digest_emails: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    enable_marketing_emails: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    enable_login_emails: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    message_content_in_email_notifications: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pm_content_in_desktop_notifications: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    wildcard_mentions_notify: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    enable_followed_topic_wildcard_mentions_notify: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    desktop_icon_count_display: Option<DesktopIconCountDisplay>,
    #[serde(skip_serializing_if = "Option::is_none")]
    realm_name_in_email_notifications_policy: Option<RealmNameInEmailNotificationsPolicy>,
    #[serde(skip_serializing_if = "Option::is_none")]
    automatically_follow_topics_policy: Option<AutomaticallyFollowTopicsPolicy>,
    #[serde(skip_serializing_if = "Option::is_none")]
    automatically_unmute_topics_in_muted_streams_policy:
        Option<AutomaticallyUnmuteTopicsInMutedStreamsPolicy>,
    #[serde(skip_serializing_if = "Option::is_none")]
    automatically_follow_topics_where_mentioned: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    resolved_topic_notice_auto_read_policy: Option<ResolvedTopicNoticeAutoReadPolicy>,
    #[serde(skip_serializing_if = "Option::is_none")]
    presence_enabled: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    available_notification_sounds: Option<Vec<String>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    emojiset_choices: Option<Vec<UserSettingsEmojisetChoice>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    send_private_typing_notifications: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    send_stream_typing_notifications: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    send_read_receipts: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    allow_private_data_export: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    email_address_visibility: Option<EmailAddressVisibility>,
    #[serde(skip_serializing_if = "Option::is_none")]
    web_navigate_to_sent_message: Option<bool>,
}

impl UserSettings {
    /// Creates a new [UserSettings].
    pub const fn new() -> Self {
        Self {
            twenty_four_hour_time: None,
            web_mark_read_on_scroll_policy: None,
            web_channel_default_view: None,
            starred_message_counts: None,
            receives_typing_notifications: None,
            web_suggest_update_timezone: None,
            fluid_layout_width: None,
            high_contrast_mode: None,
            web_font_size_px: None,
            web_line_height_percent: None,
            color_scheme: None,
            translate_emoticons: None,
            display_emoji_reaction_users: None,
            default_language: None,
            web_home_view: None,
            web_escape_navigates_to_home_view: None,
            left_side_userlist: None,
            emojiset: None,
            demote_inactive_streams: None,
            user_list_style: None,
            web_animate_image_previews: None,
            web_stream_unreads_count_display_policy: None,
            hide_ai_features: None,
            web_left_sidebar_show_channel_folders: None,
            web_left_sidebar_unreads_count_summary: None,
            timezone: None,
            enter_sends: None,
            enable_drafts_synchronization: None,
            enable_stream_desktop_notifications: None,
            enable_stream_email_notifications: None,
            enable_stream_push_notifications: None,
            enable_stream_audible_notifications: None,
            notification_sound: None,
            enable_desktop_notifications: None,
            enable_sounds: None,
            enable_followed_topic_desktop_notifications: None,
            enable_followed_topic_email_notifications: None,
            enable_followed_topic_push_notifications: None,
            enable_followed_topic_audible_notifications: None,
            email_notifications_batching_period_seconds: None,
            enable_offline_email_notifications: None,
            enable_offline_push_notifications: None,
            enable_online_push_notifications: None,
            enable_digest_emails: None,
            enable_marketing_emails: None,
            enable_login_emails: None,
            message_content_in_email_notifications: None,
            pm_content_in_desktop_notifications: None,
            wildcard_mentions_notify: None,
            enable_followed_topic_wildcard_mentions_notify: None,
            desktop_icon_count_display: None,
            realm_name_in_email_notifications_policy: None,
            automatically_follow_topics_policy: None,
            automatically_unmute_topics_in_muted_streams_policy: None,
            automatically_follow_topics_where_mentioned: None,
            resolved_topic_notice_auto_read_policy: None,
            presence_enabled: None,
            available_notification_sounds: None,
            emojiset_choices: None,
            send_private_typing_notifications: None,
            send_stream_typing_notifications: None,
            send_read_receipts: None,
            allow_private_data_export: None,
            email_address_visibility: None,
            web_navigate_to_sent_message: None,
        }
    }
}

field_access! {
    UserSettings {
        /// Whether time should be [displayed in 24-hour notation](https://zulip.com/help/change-the-time-format).
        ///
        /// A `null` value indicates that the client should use the default time format for the user's locale.
        ///
        /// **Changes**: Prior to Zulip 11.0 (feature level 408),
        /// `null` was not a valid value for this setting.
        /// Note that it was not possible to actually set the time format to `null` at this feature level.
        twenty_four_hour_time: option { bool },
        /// Whether or not to mark messages as read when the user scrolls through their feed.
        web_mark_read_on_scroll_policy: option { WebMarkReadOnScrollPolicy },
        /// Web/desktop app setting controlling the default navigation behavior when clicking on a channel link.
        web_channel_default_view: option { WebChannelDefaultView },
        /// Whether clients should display the [number of starred messages](https://zulip.com/help/star-a-message#display-the-number-of-starred-messages).
        starred_message_counts: option { bool },
        /// Whether the user is configured to receive typing notifications from other users.
        ///
        /// The server will only deliver typing notifications events to users who for whom this is enabled.
        ///
        /// **Changes**: New in Zulip 9.0 (feature level 253). Previously, there were only options to disable sending typing notifications.
        receives_typing_notifications: option { bool },
        /// Whether the user should be shown an alert,
        /// offering to update their [profile time zone](https://zulip.com/help/change-your-timezone),
        /// when the time displayed for the profile time zone differs from the current time displayed by the time zone configured on their device.
        ///
        /// **Changes**: New in Zulip 10.0 (feature level 329).
        web_suggest_update_timezone: option { bool },
        /// Whether to use the [maximum available screen width](https://zulip.com/help/enable-full-width-display) for the web app's center panel (message feed, recent conversations) on wide screens.
        fluid_layout_width: option { bool },
        /// This setting is reserved for use to control variations in Zulip's design to help visually impaired users.
        high_contrast_mode: option { bool },
        /// User-configured primary `font-size` for the web application, in pixels.
        ///
        /// **Changes**: New in Zulip 9.0 (feature level 245). Previously, font size was only adjustable via browser zoom. Note that this setting was not fully implemented at this feature level.
        web_font_size_px: option { i32 },
        /// User-configured primary `line-height` for the web application, in percent, so a value of 120 represents a `line-height` of 1.2.
        ///
        /// **Changes**: New in Zulip 9.0 (feature level 245).
        /// Previously, line height was not user-configurable.
        /// Note that this setting was not fully implemented at this feature level.
        web_line_height_percent: option { i32 },
        /// Controls which [color theme](/help/dark-theme) to use.
        color_scheme: option { ColorScheme },
        /// Whether to [translate emoticons to emoji](/help/configure-emoticon-translations) in messages the user sends.
        translate_emoticons: option { bool },
        /// Whether to display the names of reacting users on a message.
        ///
        /// When enabled, clients should display the names of reacting users, rather than a count, for messages with few total reactions.
        /// The ideal cutoff may depend on the space available for displaying reactions;
        /// the official web application displays names when 3 or fewer total reactions are present with this setting enabled.
        ///
        /// **Changes**: New in Zulip 6.0 (feature level 125).
        display_emoji_reaction_users: option { bool },
        /// The [home view](https://zulip.com/help/configure-home-view) used when opening a new Zulip web app window or hitting the `Esc` keyboard shortcut repeatedly.
        web_home_view: option { WebHomeView },
        /// Whether the escape key navigates to the [configured home view](https://zulip.com/help/configure-home-view).
        ///
        /// **Changes**: New in Zulip 8.0 (feature level 219). Previously, this was called `escape_navigates_to_default_view`, which was new in Zulip 5.0 (feature level 107).
        web_escape_navigates_to_home_view: option { bool },
        /// Whether the users list on left sidebar in narrow windows.
        ///
        /// This feature is not heavily used and is likely to be reworked.
        left_side_userlist: option { bool },
        /// The user's configured [emoji set](https://zulip.com/help/emoji-and-emoticons#use-emoticons), used to display emoji to the user everywhere they appear in the UI.
        emojiset: option { Emojiset },
        /// Whether to [hide inactive channels](https://zulip.com/help/manage-inactive-channels) in the left sidebar.
        demote_inactive_streams: option { DemoteInactiveStreams },
        /// The style selected by the user for the right sidebar user list.
        user_list_style: option { UserListStyle },
        /// Controls how animated images should be played in the message feed in the web/desktop application.
        web_animate_image_previews: option { WebAnimateImagePreviews },
        /// Configuration for which channels should be displayed with a numeric unread count in the left sidebar.
        web_stream_unreads_count_display_policy: option { WebStreamUnreadsCountDisplayPolicy },
        /// Controls whether user wants AI features like topic summarization to be hidden in all Zulip clients.
        ///
        /// **Changes**: New in Zulip 10.0 (feature level 350).
        hide_ai_features: option { bool },
        /// Determines whether the web/desktop application's left sidebar displays any channel folders configured by the organization.
        ///
        /// **Changes**: New in Zulip 11.0 (feature level 411).
        web_left_sidebar_show_channel_folders: option { bool },
        /// Determines whether the web/desktop application's left sidebar displays the unread message count summary.
        ///
        /// **Changes**: New in Zulip 11.0 (feature level 398).
        web_left_sidebar_unreads_count_summary: option { bool },
        /// Whether the user setting for [sending on pressing Enter](https://zulip.com/help/configure-send-message-keys) in the compose box is enabled.
        enter_sends: option { bool },
        /// A boolean parameter to control whether synchronizing drafts is enabled for the user.
        ///
        /// When synchronization is disabled, all drafts stored in the server will be automatically deleted from the server.
        ///
        /// This does not do anything (like sending events) to delete local copies of drafts stored in clients.
        enable_drafts_synchronization: option { bool },
        /// Enable visual desktop notifications for channel messages.
        enable_stream_desktop_notifications: option { bool },
        /// Enable email notifications for channel messages.
        enable_stream_email_notifications: option { bool },
        /// Enable mobile notifications for channel messages.
        enable_stream_push_notifications: option { bool },
        /// Enable audible desktop notifications for channel messages.
        enable_stream_audible_notifications: option { bool },
        /// Enable visual desktop notifications for direct messages and @-mentions.
        enable_desktop_notifications: option { bool },
        /// Enable audible desktop notifications for direct messages and @-mentions.
        enable_sounds: option { bool },
        /// Enable visual desktop notifications for messages sent to followed topics.  **Changes**: New in Zulip 8.0 (feature level 189).
        enable_followed_topic_desktop_notifications: option { bool },
        /// Enable email notifications for messages sent to followed topics.  **Changes**: New in Zulip 8.0 (feature level 189).
        enable_followed_topic_email_notifications: option { bool },
        /// Enable push notifications for messages sent to followed topics.  **Changes**: New in Zulip 8.0 (feature level 189).
        enable_followed_topic_push_notifications: option { bool },
        /// Enable audible desktop notifications for messages sent to followed topics.  **Changes**: New in Zulip 8.0 (feature level 189).
        enable_followed_topic_audible_notifications: option { bool },
        /// The duration (in seconds) for which the server should wait to batch email notifications before sending them.
        email_notifications_batching_period_seconds: option { i32 },
        /// Enable email notifications for direct messages and @-mentions received when the user is offline.
        enable_offline_email_notifications: option { bool },
        /// Enable mobile notification for direct messages and @-mentions received when the user is offline.
        enable_offline_push_notifications: option { bool },
        /// Enable mobile notification for direct messages and @-mentions received when the user is online.
        enable_online_push_notifications: option { bool },
        /// Enable digest emails when the user is away.
        enable_digest_emails: option { bool },
        /// Enable marketing emails. Has no function outside Zulip Cloud.
        enable_marketing_emails: option { bool },
        /// Enable email notifications for new logins to account.
        enable_login_emails: option { bool },
        /// Include the message's content in email notifications for new messages.
        message_content_in_email_notifications: option { bool },
        /// Include content of direct messages in desktop notifications.
        pm_content_in_desktop_notifications: option { bool },
        /// Whether wildcard mentions (E.g. @**all**) should send notifications like a personal mention.
        wildcard_mentions_notify: option { bool },
        /// Whether wildcard mentions (e.g., @**all**) in messages sent to followed topics should send notifications like a personal mention.
        ///
        /// **Changes**: New in Zulip 8.0 (feature level 189).
        enable_followed_topic_wildcard_mentions_notify: option { bool },
        /// Unread count badge (appears in desktop sidebar and browser tab)
        desktop_icon_count_display: option { DesktopIconCountDisplay },
        /// Whether to [include organization name in subject of message notification emails](https://zulip.com/help/email-notifications#include-organization-name-in-subject-line).
        realm_name_in_email_notifications_policy: option { RealmNameInEmailNotificationsPolicy },
        /// Which [topics to follow automatically](https://zulip.com/help/mute-a-topic).
        automatically_follow_topics_policy: option { AutomaticallyFollowTopicsPolicy },
        /// Which [topics to unmute automatically in muted channels](https://zulip.com/help/mute-a-topic).
        automatically_unmute_topics_in_muted_streams_policy: option { AutomaticallyUnmuteTopicsInMutedStreamsPolicy },
        /// Whether the server will automatically mark the user as following topics where the user is mentioned.
        ///
        /// **Changes**: New in Zulip 8.0 (feature level 235).
        automatically_follow_topics_where_mentioned: option { bool },
        /// Controls whether the resolved-topic notices are marked as read.
        resolved_topic_notice_auto_read_policy: option { ResolvedTopicNoticeAutoReadPolicy },
        /// Display the presence status to other users when online.
        presence_enabled: option { bool },
        /// Whether the user has chosen to send [typing notifications](https://zulip.com/help/typing-notifications) when composing direct messages.
        ///
        /// The client should send typing notifications for direct messages if and only if this setting is enabled.
        ///
        /// **Changes**: New in Zulip 5.0 (feature level 105).
        send_private_typing_notifications: option { bool },
        /// Whether the user has chosen to send [typing notifications](https://zulip.com/help/typing-notifications) when composing channel messages.
        ///
        /// The client should send typing notifications for channel messages if and only if this setting is enabled.
        ///
        /// **Changes**: New in Zulip 5.0 (feature level 105).
        send_stream_typing_notifications: option { bool },
        /// Whether other users are allowed to see whether you've read messages.
        ///
        /// **Changes**: New in Zulip 5.0 (feature level 105).
        send_read_receipts: option { bool },
        /// Whether organization administrators are allowed to export your private data.
        ///
        /// **Changes**: New in Zulip 10.0 (feature level 293).
        allow_private_data_export: option { bool },
        /// The [policy](https://zulip.com/api/roles-and-permissions#permission-levels) for
        /// [which other users](https://zulip.com/help/configure-email-visibility) in this organization can see the user's real email address.
        email_address_visibility: option { EmailAddressVisibility },
        /// Web/desktop app setting for whether the user's view should automatically go to the conversation where they sent a message.
        ///
        /// **Changes**: New in Zulip 9.0 (feature level 268). Previously, this behavior was not configurable.
        web_navigate_to_sent_message: option { bool },
    }
}

field_access! {
    UserSettings {
        /// What [default language](https://zulip.com/help/change-your-language) to use for the account.
        ///
        /// This controls both the Zulip UI as well as email notifications sent to the user.
        ///
        /// The value needs to be a standard language code that the Zulip server has translation data for; for example, `\"en\"` for English or `\"de\"` for German.
        default_language: option_cow_deref { str, String },
        /// Notification sound name.
        notification_sound: option_cow_deref { str, String },
        /// The IANA identifier of the user's [profile time zone](https://zulip.com/help/change-your-timezone), which is used primarily to display the user's local time to other users.
        timezone: option_cow_deref { str, String },
        /// Array containing the names of the notification sound options supported by this Zulip server.
        ///
        /// Only relevant to support UI for configuring notification sounds.
        available_notification_sounds: option_cow_deref { [String], Vec<String> },
        /// Array of dictionaries where each dictionary describes an emoji set supported by this version of the Zulip server.
        ///
        /// Only relevant to clients with configuration UI for choosing an emoji set; the currently selected emoji set is available in the `emojiset` key.
        ///
        /// See [PATCH /settings](https://zulip.com/api/update-settings) for details on the meaning of this setting.
        emojiset_choices: option_cow_deref { [UserSettingsEmojisetChoice], Vec<UserSettingsEmojisetChoice> },
    }
}

impl_default!(UserSettings);
impl_display!(UserSettings);