/*
* 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 IamPeriodRegistration {
#[serde(rename = "cert", skip_serializing_if = "Option::is_none")]
pub cert: Option<String>,
#[serde(rename = "clientId", skip_serializing_if = "Option::is_none")]
pub client_id: Option<String>,
#[serde(rename = "clientSecret", skip_serializing_if = "Option::is_none")]
pub client_secret: Option<String>,
#[serde(rename = "displayName", skip_serializing_if = "Option::is_none")]
pub display_name: Option<String>,
/// EnableCodeSignin offers sign-in by an emailed or texted one-time code beside the password. A POINTER for the same reason as IsShared: a plain bool reads as false on every reconcile that says nothing and would switch the method off for every app whose caller never mentioned it.
#[serde(rename = "enableCodeSignin", skip_serializing_if = "Option::is_none")]
pub enable_code_signin: Option<bool>,
/// ExpireInHours and RefreshExpireInHours are the application's token lifetimes. They are the ONLY declarative way to say that a refresh token must OUTLIVE its access token: with neither stated, oidc.refreshTTL clamps the refresh lifetime to the access lifetime, so the refresh_token grant the registration advertises expires at the same instant as the token it was meant to renew and can never be exercised. `hanzo-cli` sat in exactly that state — a browser re-login every hour, and a live refresh returning 401. POINTERS, for the same reason as IsShared: a plain float would read as 0 on every reconcile that says nothing and reset a deliberate lifetime back to the default. Nil means \"not stated, leave it\".
#[serde(rename = "expireInHours", skip_serializing_if = "Option::is_none")]
pub expire_in_hours: Option<f64>,
#[serde(rename = "grantTypes", skip_serializing_if = "Option::is_none")]
pub grant_types: Option<Vec<String>>,
/// IsShared declares that this application serves EVERY organization, not only the one named in Organization. It is the honest description of a brand app — hanzo-id, hanzo-chat, a brand console — whose customers each live in their own tenant: self-service onboarding moves a founder OUT of the brand org, so `user.Owner != app.Organization` is the steady state and the app really does serve every org. Application.ServesOrg reads it as one of the three ways to say yes. A POINTER because omission must PRESERVE. This upsert is the operator's steady-state reconcile and most callers say nothing about sharing; a plain bool would read as false on every one of them and silently un-share an app — the same shape of accident that de-secreted apps through update-application. Nil means \"not stated, leave it\"; only an explicit true or false moves it.
#[serde(rename = "isShared", skip_serializing_if = "Option::is_none")]
pub is_shared: Option<bool>,
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "organization", skip_serializing_if = "Option::is_none")]
pub organization: Option<String>,
/// Public declares a client that CANNOT hold a credential — a browser SPA, a CLI, a desktop app. It proves itself with PKCE instead, and the token endpoint treats \"no stored secret\" as exactly that (token.go: a secret is verified only when one is stored). Without this flag every upsert minted a secret, so a public client could never be registered at all and its browser code->token exchange 401'd `invalid_client` forever.
#[serde(rename = "public", skip_serializing_if = "Option::is_none")]
pub public: Option<bool>,
#[serde(rename = "redirectUris", skip_serializing_if = "Option::is_none")]
pub redirect_uris: Option<Vec<String>>,
#[serde(rename = "refreshExpireInHours", skip_serializing_if = "Option::is_none")]
pub refresh_expire_in_hours: Option<f64>,
}
impl IamPeriodRegistration {
pub fn new() -> IamPeriodRegistration {
IamPeriodRegistration {
cert: None,
client_id: None,
client_secret: None,
display_name: None,
enable_code_signin: None,
expire_in_hours: None,
grant_types: None,
is_shared: None,
name: None,
organization: None,
public: None,
redirect_uris: None,
refresh_expire_in_hours: None,
}
}
}