late 0.0.1055

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.104.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 CreateHighDemandPeriodRequest {
    /// Zernio SocialAccount id used to resolve the Meta token.
    #[serde(rename = "accountId")]
    pub account_id: String,
    /// Platform campaign id. Exactly one of campaignId / adSetId.
    #[serde(rename = "campaignId", skip_serializing_if = "Option::is_none")]
    pub campaign_id: Option<String>,
    /// Platform ad set id. Exactly one of campaignId / adSetId.
    #[serde(rename = "adSetId", skip_serializing_if = "Option::is_none")]
    pub ad_set_id: Option<String>,
    /// With ABSOLUTE, a budget in the ad account's currency in WHOLE units (50 = $50.00). With MULTIPLIER, a factor of the existing budget (2 = double it) and NOT a currency amount.
    #[serde(rename = "budgetValue")]
    pub budget_value: f64,
    #[serde(rename = "budgetValueType")]
    pub budget_value_type: BudgetValueType,
    /// Unix seconds, on a 15-minute boundary (:00, :15, :30, :45).
    #[serde(rename = "timeStart")]
    pub time_start: i32,
    /// Unix seconds, on a 15-minute boundary and after timeStart.
    #[serde(rename = "timeEnd")]
    pub time_end: i32,
    #[serde(rename = "recurrenceType", skip_serializing_if = "Option::is_none")]
    pub recurrence_type: Option<RecurrenceType>,
    /// Ad account currency, for the ABSOLUTE minor-unit conversion. Ignored for MULTIPLIER.
    #[serde(rename = "currency", skip_serializing_if = "Option::is_none")]
    pub currency: Option<String>,
}

impl CreateHighDemandPeriodRequest {
    pub fn new(
        account_id: String,
        budget_value: f64,
        budget_value_type: BudgetValueType,
        time_start: i32,
        time_end: i32,
    ) -> CreateHighDemandPeriodRequest {
        CreateHighDemandPeriodRequest {
            account_id,
            campaign_id: None,
            ad_set_id: None,
            budget_value,
            budget_value_type,
            time_start,
            time_end,
            recurrence_type: None,
            currency: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum BudgetValueType {
    #[serde(rename = "ABSOLUTE")]
    Absolute,
    #[serde(rename = "MULTIPLIER")]
    Multiplier,
}

impl Default for BudgetValueType {
    fn default() -> BudgetValueType {
        Self::Absolute
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum RecurrenceType {
    #[serde(rename = "ONE_TIME")]
    OneTime,
    #[serde(rename = "WEEKLY")]
    Weekly,
    #[serde(rename = "MONTHLY")]
    Monthly,
}

impl Default for RecurrenceType {
    fn default() -> RecurrenceType {
        Self::OneTime
    }
}