//! !!! DO NOT EDIT THIS FILE !!!
//!
//! This file is auto-generated by './generate-schema.sh' in the repository.
//! Please refer to the script code to learn how to update the source data.

#![allow(clippy::enum_variant_names)]
#![allow(clippy::missing_docs_in_private_items)]
#![allow(missing_docs)]
#![allow(non_snake_case)]

// Example code that deserializes and serializes the model.
// extern crate serde;
// #[macro_use]
// extern crate serde_derive;
// extern crate serde_json;
//
// use generated_module::OauthV2AccessResponse;
//
// fn main() {
//     let json = r#"{"answer": 42}"#;
//     let model: OauthV2AccessResponse = serde_json::from_str(&json).unwrap();
// }

use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct OauthV2AccessResponse {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub access_token: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub app_id: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub authed_user: Option<AuthedUser>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub bot_user_id: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub enterprise: Option<Enterprise>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub error: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub expires_in: Option<i64>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub incoming_webhook: Option<IncomingWebhook>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub is_enterprise_install: Option<bool>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub needed: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub ok: Option<bool>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub provided: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub refresh_token: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub scope: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub team: Option<Enterprise>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub token_type: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub warning: Option<String>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AuthedUser {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub access_token: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub expires_in: Option<i64>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub refresh_token: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub scope: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub token_type: Option<String>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Enterprise {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct IncomingWebhook {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub channel: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub channel_id: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub configuration_url: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
}
