zulip_api/message/realm_billing.rs
1use serde::{Deserialize, Serialize};
2
3use crate::{field_access, impl_default, impl_display};
4
5/// Represents billing information of the organization.
6///
7/// **Changes**: New in Zulip 10.0 (feature level 363).
8///
9/// Modified from `openapi-generator-cli` output:
10///
11/// ```shell,no_build,no_run
12/// $ openapi-generator-cli generate -g rust -i ./zerver/openapi/zulip.yaml -o zulip-openapi --skip-validate-spec
13/// ```
14///
15/// ```text
16/// /*
17/// * Zulip REST API
18/// *
19/// * Powerful open source group chat
20/// *
21/// * The version of the OpenAPI document: 1.0.0
22/// *
23/// * Generated by: https://openapi-generator.tech
24/// */
25/// ```
26///
27/// See [zerver/openapi/zulip.yaml](https://github.com/zulip/zulip/blob/main/zerver/openapi/zulip.yaml) for the original OpenAPI configuration.
28///
29/// Configuration slightly modified to work with the Rust generator of [`openapi-generator-cli`](https://openapi-generator.tech).
30#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
31pub struct RealmBilling {
32 #[serde(skip_serializing_if = "Option::is_none")]
33 has_pending_sponsorship_request: Option<bool>,
34}
35
36impl RealmBilling {
37 /// Creates a new [RealmBilling].
38 pub const fn new() -> Self {
39 Self {
40 has_pending_sponsorship_request: None,
41 }
42 }
43}
44
45field_access! {
46 RealmBilling {
47 /// Whether there is a pending sponsorship request for the organization.
48 ///
49 /// Note that this field will always be `false` if the user is not in `can_manage_billing_group`.
50 ///
51 /// **Changes**: New in Zulip 10.0 (feature level 363).
52 has_pending_sponsorship_request: option { bool },
53 }
54}
55
56impl_default!(RealmBilling);
57impl_display!(RealmBilling);