/*
* Hanzo Cloud API
*
* 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/.
*
* The version of the OpenAPI document: v1
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PairingView {
/// Channel is the transport the request arrived on — discord, slack, teams or telegram — and half of what approval names. The cap of three unapproved requests applies per (org, channel); while it is full no further code is minted until one is approved or expires.
#[serde(rename = "channel", skip_serializing_if = "Option::is_none")]
pub channel: Option<String>,
/// Code is the CAPABILITY that authorises the approval: eight characters from a 32-symbol uppercase alphabet (A-Z0-9 minus the confusables 0, O, 1 and I), minted with crypto/rand and also sent to the requester in chat. An org admin passes it with the channel to POST /v1/channels/pairing/approve, which CONSUMES it — the request row is deleted, so a code approves once — and which takes org admin as well as the code. It lives ONE HOUR from CreatedAt; expired requests are not listed here, and approving one is a 404. It is shown on this admin surface and NEVER logged.
#[serde(rename = "code", skip_serializing_if = "Option::is_none")]
pub code: Option<String>,
/// CreatedAt is Unix SECONDS of FIRST contact: when the request was minted and the code sent. Expiry is measured from here and from nowhere else.
#[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
pub created_at: Option<i32>,
/// LastSeen is Unix SECONDS of the MOST RECENT message from this sender while the request has been pending. It moves as they keep writing, which is how an admin tells a live request from an abandoned one — but it does not extend the hour and does not re-send the code, since one request sends exactly one chat reply.
#[serde(rename = "lastSeen", skip_serializing_if = "Option::is_none")]
pub last_seen: Option<i32>,
/// Sender is the transport-native user id waiting for access — the same identity inbox messages carry. Approving mints a DM allow entry for exactly this value and nothing wider: pairing never grants group access.
#[serde(rename = "sender", skip_serializing_if = "Option::is_none")]
pub sender: Option<String>,
}
impl PairingView {
pub fn new() -> PairingView {
PairingView {
channel: None,
code: None,
created_at: None,
last_seen: None,
sender: None,
}
}
}