// !!!
// WARNING: This file is autogenerated
// Only modify code within MANUAL() sections
// or your changes may be overwritten later!
// !!!

use crate::consumer::connected_apps_clients::Clients;
use serde::{Deserialize, Serialize};

/// ConnectedAppClient:
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct ConnectedAppClient {
    /// client_id: The ID of the Connected App client.
    pub client_id: String,
    /// client_name: A human-readable name for the client.
    pub client_name: String,
    /// client_description: A human-readable description for the client.
    pub client_description: String,
    pub status: String,
    /// full_access_allowed: Valid for first party clients only. If `true`, an authorization token granted to
    /// this Client can be exchanged for a full Stytch session.
    pub full_access_allowed: bool,
    /// client_type: The type of Connected App. Supported values are `first_party`, `first_party_public`,
    /// `third_party`, and `third_party_public`.
    pub client_type: String,
    /// redirect_urls: Array of redirect URI values for use in OAuth Authorization flows.
    pub redirect_urls: std::vec::Vec<String>,
    pub access_token_expiry_minutes: i32,
    pub access_token_template_content: String,
    /// post_logout_redirect_urls: Array of redirect URI values for use in OIDC Logout flows.
    pub post_logout_redirect_urls: std::vec::Vec<String>,
    /// bypass_consent_for_offline_access: Valid for first party clients only. If true, the client does not need
    /// to request explicit user consent for the `offline_access` scope.
    pub bypass_consent_for_offline_access: bool,
    /// client_secret_last_four: The last four characters of the client secret.
    pub client_secret_last_four: std::option::Option<String>,
    /// next_client_secret_last_four: The last four characters of the `next_client_secret`. Null if no
    /// `next_client_secret` exists.
    pub next_client_secret_last_four: std::option::Option<String>,
    pub access_token_custom_audience: std::option::Option<String>,
    /// logo_url: The logo URL of the Connected App, if any.
    pub logo_url: std::option::Option<String>,
    pub client_id_metadata_url: std::option::Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct ConnectedAppPublic {
    pub client_id: String,
    pub client_name: String,
    pub client_description: String,
    pub client_type: String,
    pub logo_url: std::option::Option<String>,
}
/// ConnectedAppWithClientSecret:
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct ConnectedAppWithClientSecret {
    /// client_id: The ID of the Connected App client.
    pub client_id: String,
    /// client_name: A human-readable name for the client.
    pub client_name: String,
    /// client_description: A human-readable description for the client.
    pub client_description: String,
    pub status: String,
    /// full_access_allowed: Valid for first party clients only. If `true`, an authorization token granted to
    /// this Client can be exchanged for a full Stytch session.
    pub full_access_allowed: bool,
    /// client_type: The type of Connected App. Supported values are `first_party`, `first_party_public`,
    /// `third_party`, and `third_party_public`.
    pub client_type: String,
    /// redirect_urls: Array of redirect URI values for use in OAuth Authorization flows.
    pub redirect_urls: std::vec::Vec<String>,
    pub access_token_expiry_minutes: i32,
    pub access_token_template_content: String,
    /// post_logout_redirect_urls: Array of redirect URI values for use in OIDC Logout flows.
    pub post_logout_redirect_urls: std::vec::Vec<String>,
    /// bypass_consent_for_offline_access: Valid for first party clients only. If true, the client does not need
    /// to request explicit user consent for the `offline_access` scope.
    pub bypass_consent_for_offline_access: bool,
    /// client_secret_last_four: The last four characters of the client secret.
    pub client_secret_last_four: std::option::Option<String>,
    /// next_client_secret_last_four: The last four characters of the `next_client_secret`. Null if no
    /// `next_client_secret` exists.
    pub next_client_secret_last_four: std::option::Option<String>,
    /// client_secret: The secret of the Connected App client. **Required for confidential clients**
    pub client_secret: std::option::Option<String>,
    pub access_token_custom_audience: std::option::Option<String>,
    /// logo_url: The logo URL of the Connected App, if any.
    pub logo_url: std::option::Option<String>,
    pub client_id_metadata_url: std::option::Option<String>,
}
/// ConnectedAppWithNextClientSecret:
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct ConnectedAppWithNextClientSecret {
    /// client_id: The ID of the Connected App client.
    pub client_id: String,
    /// client_name: A human-readable name for the client.
    pub client_name: String,
    /// client_description: A human-readable description for the client.
    pub client_description: String,
    pub status: String,
    /// client_secret_last_four: The last four characters of the client secret.
    pub client_secret_last_four: String,
    /// full_access_allowed: Valid for first party clients only. If `true`, an authorization token granted to
    /// this Client can be exchanged for a full Stytch session.
    pub full_access_allowed: bool,
    /// client_type: The type of Connected App. Supported values are `first_party`, `first_party_public`,
    /// `third_party`, and `third_party_public`.
    pub client_type: String,
    /// redirect_urls: Array of redirect URI values for use in OAuth Authorization flows.
    pub redirect_urls: std::vec::Vec<String>,
    pub next_client_secret: String,
    pub access_token_expiry_minutes: i32,
    pub access_token_template_content: String,
    /// post_logout_redirect_urls: Array of redirect URI values for use in OIDC Logout flows.
    pub post_logout_redirect_urls: std::vec::Vec<String>,
    /// bypass_consent_for_offline_access: Valid for first party clients only. If true, the client does not need
    /// to request explicit user consent for the `offline_access` scope.
    pub bypass_consent_for_offline_access: bool,
    /// next_client_secret_last_four: The last four characters of the `next_client_secret`. Null if no
    /// `next_client_secret` exists.
    pub next_client_secret_last_four: std::option::Option<String>,
    pub access_token_custom_audience: std::option::Option<String>,
    /// logo_url: The logo URL of the Connected App, if any.
    pub logo_url: std::option::Option<String>,
    pub client_id_metadata_url: std::option::Option<String>,
}
/// ResultsMetadata:
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct ResultsMetadata {
    /// total: The total number of results returned by your search query. If totals have been disabled for your
    /// Stytch Workspace to improve search performance, the value will always be -1.
    pub total: i32,
    /// next_cursor: The `next_cursor` string is returned when your search result contains more than one page of
    /// results. This value is passed into your next search call in the `cursor` field.
    pub next_cursor: std::option::Option<String>,
}

pub struct ConnectedApp {
    pub clients: Clients,
}

impl ConnectedApp {
    pub fn new(http_client: crate::client::Client) -> Self {
        Self {
            clients: Clients::new(http_client.clone()),
        }
    }
}
