Skip to main content

zulip_api/message/
realm_available_video_chat_provider.rs

1use serde::{Deserialize, Serialize};
2
3use crate::{field_access, impl_default, impl_display};
4
5/// Represents the details of the video call provider with the name of the chat provider as the key.
6///
7/// Modified from `openapi-generator-cli` output:
8///
9/// ```shell,no_build,no_run
10/// $ openapi-generator-cli generate -g rust -i ./zerver/openapi/zulip.yaml -o zulip-openapi --skip-validate-spec
11/// ```
12///
13/// ```text
14/// /*
15/// * Zulip REST API
16/// *
17/// * Powerful open source group chat
18/// *
19/// * The version of the OpenAPI document: 1.0.0
20/// *
21/// * Generated by: https://openapi-generator.tech
22/// */
23/// ```
24///
25/// See [zerver/openapi/zulip.yaml](https://github.com/zulip/zulip/blob/main/zerver/openapi/zulip.yaml) for the original OpenAPI configuration.
26///
27/// Configuration slightly modified to work with the Rust generator of [`openapi-generator-cli`](https://openapi-generator.tech).
28#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
29pub struct RealmAvailableVideoChatProvider {
30    #[serde(skip_serializing_if = "Option::is_none")]
31    name: Option<String>,
32    #[serde(skip_serializing_if = "Option::is_none")]
33    id: Option<u64>,
34}
35
36impl RealmAvailableVideoChatProvider {
37    /// Creates a new [RealmAvailableVideoChatProvider].
38    pub const fn new() -> Self {
39        Self {
40            name: None,
41            id: None,
42        }
43    }
44}
45
46field_access! {
47    RealmAvailableVideoChatProvider {
48        /// The name of the video call provider.
49        name: option_cow_deref { str, String },
50    }
51}
52
53field_access! {
54    RealmAvailableVideoChatProvider {
55        /// The ID of the video call provider.
56        id: option { u64 },
57    }
58}
59
60impl_default!(RealmAvailableVideoChatProvider);
61impl_display!(RealmAvailableVideoChatProvider);