Skip to main content

hanzo_client/models/
channel_view.rs

1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ChannelView {
16    /// Account is the id-shaped fact about that connection: the lowercased external id integrations custodies for it — a Discord guild id, a Slack team (workspace) id, a Teams AAD tenant id, or the Telegram chat the org bound. Empty when not connected. Informational: the access policy keys on (org, channel), so exactly one account is representable per pair.
17    #[serde(rename = "account", skip_serializing_if = "Option::is_none")]
18    pub account: Option<String>,
19    /// AccountLabel is the human label of that same account — the Discord guild name, the Slack team name, the Teams tenant name (falling back to the tenant id), the Telegram chat title. DISPLAY ONLY: never a key, and never swapped with Account, on any surface.
20    #[serde(rename = "accountLabel", skip_serializing_if = "Option::is_none")]
21    pub account_label: Option<String>,
22    /// Capabilities is what this transport renders natively — read it before composing a message that needs threading, media or interactive actions.
23    #[serde(rename = "capabilities", skip_serializing_if = "Option::is_none")]
24    pub capabilities: Option<Box<models::Capabilities>>,
25    /// Connected is whether integrations holds a connection for (this org, this transport) — whether someone finished its connect flow. False leaves Account and AccountLabel empty, and a send is then refused downstream rather than here: by the transport's own binding check (403 for a Telegram chat this org has not bound, 409 for a Discord or Teams room with no inbound-learned route), or on Slack by the absent per-org bot token, which surfaces as 502.
26    #[serde(rename = "connected", skip_serializing_if = "Option::is_none")]
27    pub connected: Option<bool>,
28    /// DMPolicy is how this org admits direct messages here: \"pairing\", \"allowlist\" or \"open\", defaulting to \"pairing\" when the org has never set one.
29    #[serde(rename = "dmPolicy", skip_serializing_if = "Option::is_none")]
30    pub dm_policy: Option<String>,
31    /// GroupPolicy is how this org admits group and thread rooms here: \"open\", \"allowlist\" or \"disabled\", defaulting to \"open\". Both policy fields come back EMPTY — rather than the listing failing — when the policy cannot be read; GET /v1/channels/allowlist carries the same two with the entries they consult.
32    #[serde(rename = "groupPolicy", skip_serializing_if = "Option::is_none")]
33    pub group_policy: Option<String>,
34    /// ID is the fixed transport identifier — discord, slack, teams, telegram or whatsapp — and the value every route on this surface names a channel by, including the `:channel` segment of the send path. The listing is always in that order.
35    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
36    pub id: Option<String>,
37    /// PendingPairing counts the org's UNEXPIRED pairing requests on this channel: exactly the rows GET /v1/channels/pairing returns for it, one per person waiting on an admin. It never exceeds three — the pending cap per (org, channel) — and expired requests are not counted.
38    #[serde(rename = "pendingPairing", skip_serializing_if = "Option::is_none")]
39    pub pending_pairing: Option<i32>,
40}
41
42impl ChannelView {
43    pub fn new() -> ChannelView {
44        ChannelView {
45            account: None,
46            account_label: None,
47            capabilities: None,
48            connected: None,
49            dm_policy: None,
50            group_policy: None,
51            id: None,
52            pending_pairing: None,
53        }
54    }
55}
56