late 0.0.1256

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.358.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 HubSpotSettings {
    /// Zernio account ID of the HubSpot connection.
    #[serde(rename = "_id")]
    pub _id: String,
    #[serde(rename = "platform")]
    pub platform: Platform,
    /// HubSpot portal (hub) ID.
    #[serde(rename = "hubId")]
    pub hub_id: String,
    /// HubSpot portal domain, when HubSpot reports one.
    #[serde(rename = "hubDomain", deserialize_with = "Option::deserialize")]
    pub hub_domain: Option<String>,
    /// OAuth scopes the portal granted.
    #[serde(rename = "scopes")]
    pub scopes: Vec<String>,
    /// Whether Zernio creates HubSpot contacts for inbox contacts that match none.
    #[serde(rename = "syncContacts")]
    pub sync_contacts: bool,
    /// Whether Zernio logs inbox messages on HubSpot contact timelines.
    #[serde(rename = "logMessages")]
    pub log_messages: bool,
}

impl HubSpotSettings {
    pub fn new(
        _id: String,
        platform: Platform,
        hub_id: String,
        hub_domain: Option<String>,
        scopes: Vec<String>,
        sync_contacts: bool,
        log_messages: bool,
    ) -> HubSpotSettings {
        HubSpotSettings {
            _id,
            platform,
            hub_id,
            hub_domain,
            scopes,
            sync_contacts,
            log_messages,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Platform {
    #[serde(rename = "hubspot")]
    Hubspot,
}

impl Default for Platform {
    fn default() -> Platform {
        Self::Hubspot
    }
}