//! The type that represents a request of `oauth.v2.access`.
//!
//! <https://api.slack.com/methods/oauth.v2.access>

use serde::Serialize;

/// The type that represents a request of `oauth.v2.access`.
///
/// <https://api.slack.com/methods/oauth.v2.access>
///
/// TODO: add `refresh_token`.
#[derive(Debug, Serialize)]
#[serde(rename_all = "snake_case")]
pub struct OauthV2AccessRequest<'a> {
    /// The Client ID.
    ///
    /// <https://api.slack.com/methods/oauth.v2.access#arg_client_id>
    ///
    /// TODO: to `Option`.
    pub client_id: &'a str,

    /// The Client Secret.
    ///
    /// <https://api.slack.com/methods/oauth.v2.access#arg_client_secret>
    ///
    /// TODO: to `Option`.
    pub client_secret: &'a str,

    /// The `grant_type` param as described in the OAuth spec.
    ///
    /// <https://api.slack.com/methods/oauth.v2.access#arg_grant_type>
    pub grant_type: &'a str,

    /// This must match the originally submitted URI (if one was sent).
    ///
    /// <https://api.slack.com/methods/oauth.v2.access#arg_redirect_uri>
    pub redirect_uri: &'a str,

    /// The `code` param returned via the OAuth callback.
    ///
    /// <https://api.slack.com/methods/oauth.v2.access#arg_code>
    pub code: &'a str,
}
