/*
 * Orvanta API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.2
 * Contact: contact@orvanta.cloud
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateAccountRequest {
    /// OAuth refresh token. For authorization_code flow, this contains the actual refresh token. For client_credentials flow, this must be set to an empty string.
    #[serde(rename = "refresh_token")]
    pub refresh_token: String,
    #[serde(rename = "expires_in")]
    pub expires_in: i32,
    #[serde(rename = "client")]
    pub client: String,
    #[serde(rename = "grant_type", skip_serializing_if = "Option::is_none")]
    pub grant_type: Option<String>,
    /// OAuth client ID for resource-level credentials (client_credentials flow only)
    #[serde(rename = "cc_client_id", skip_serializing_if = "Option::is_none")]
    pub cc_client_id: Option<String>,
    /// OAuth client secret for resource-level credentials (client_credentials flow only)
    #[serde(rename = "cc_client_secret", skip_serializing_if = "Option::is_none")]
    pub cc_client_secret: Option<String>,
    /// OAuth token URL override for resource-level authentication (client_credentials flow only)
    #[serde(rename = "cc_token_url", skip_serializing_if = "Option::is_none")]
    pub cc_token_url: Option<String>,
    /// MCP server URL for MCP OAuth token refresh
    #[serde(rename = "mcp_server_url", skip_serializing_if = "Option::is_none")]
    pub mcp_server_url: Option<String>,
    /// OAuth scopes to use for token refresh. Overrides instance-level scopes.
    #[serde(rename = "scopes", skip_serializing_if = "Option::is_none")]
    pub scopes: Option<Vec<String>>,
}

impl CreateAccountRequest {
    pub fn new(refresh_token: String, expires_in: i32, client: String) -> CreateAccountRequest {
        CreateAccountRequest {
            refresh_token,
            expires_in,
            client,
            grant_type: None,
            cc_client_id: None,
            cc_client_secret: None,
            cc_token_url: None,
            mcp_server_url: None,
            scopes: None,
        }
    }
}

