late 0.0.1376

API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema). Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
Documentation
/*
 * Zernio API
 *
 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api  Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal.  Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).  Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
 *
 * The version of the OpenAPI document: 1.587.0
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateOAuthAppRequest {
    /// One of the platforms listed in `platforms` of GET /v1/connect/oauth-apps.
    #[serde(rename = "platform")]
    pub platform: String,
    #[serde(rename = "label")]
    pub label: String,
    #[serde(rename = "clientId")]
    pub client_id: String,
    #[serde(rename = "clientSecret")]
    pub client_secret: String,
    /// Instagram only: the numeric ID of the Meta app your Instagram app lives in. Zernio uses it with `metaAppSecret` to register the webhook. Send both or neither.
    #[serde(rename = "metaAppId", skip_serializing_if = "Option::is_none")]
    pub meta_app_id: Option<String>,
    /// Instagram only: the secret of that Meta app. Never returned.
    #[serde(rename = "metaAppSecret", skip_serializing_if = "Option::is_none")]
    pub meta_app_secret: Option<String>,
    /// Slack only: the signing secret from the app's Basic Information page. Needed to receive events from your Slack app; any other platform is a 400.
    #[serde(rename = "slackSigningSecret", skip_serializing_if = "Option::is_none")]
    pub slack_signing_secret: Option<String>,
    /// Areas this app requests. Defaults to every area the platform supports; an area the platform cannot request separately is a 400.
    #[serde(rename = "scopeAreas", skip_serializing_if = "Option::is_none")]
    pub scope_areas: Option<Vec<ScopeAreas>>,
}

impl CreateOAuthAppRequest {
    pub fn new(
        platform: String,
        label: String,
        client_id: String,
        client_secret: String,
    ) -> CreateOAuthAppRequest {
        CreateOAuthAppRequest {
            platform,
            label,
            client_id,
            client_secret,
            meta_app_id: None,
            meta_app_secret: None,
            slack_signing_secret: None,
            scope_areas: None,
        }
    }
}
/// Areas this app requests. Defaults to every area the platform supports; an area the platform cannot request separately is a 400.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ScopeAreas {
    #[serde(rename = "posting")]
    Posting,
    #[serde(rename = "analytics")]
    Analytics,
    #[serde(rename = "comments")]
    Comments,
    #[serde(rename = "messaging")]
    Messaging,
}

impl Default for ScopeAreas {
    fn default() -> ScopeAreas {
        Self::Posting
    }
}