/*
 * Zernio API
 *
 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
 *
 * The version of the OpenAPI document: 1.0.4
 * 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 ListAdAudiences200ResponseAudiencesInner {
    #[serde(
        rename = "id",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub id: Option<Option<String>>,
    /// Social account the audience was created against. Returned for saved_targeting items.
    #[serde(rename = "accountId", skip_serializing_if = "Option::is_none")]
    pub account_id: Option<String>,
    #[serde(rename = "platformAudienceId", skip_serializing_if = "Option::is_none")]
    pub platform_audience_id: Option<String>,
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<Type>,
    #[serde(
        rename = "spec",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub spec: Option<Option<Box<models::TargetingSpec>>>,
    #[serde(rename = "platform", skip_serializing_if = "Option::is_none")]
    pub platform: Option<String>,
    #[serde(rename = "size", skip_serializing_if = "Option::is_none")]
    pub size: Option<i32>,
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
}

impl ListAdAudiences200ResponseAudiencesInner {
    pub fn new() -> ListAdAudiences200ResponseAudiencesInner {
        ListAdAudiences200ResponseAudiencesInner {
            id: None,
            account_id: None,
            platform_audience_id: None,
            name: None,
            description: None,
            r#type: None,
            spec: None,
            platform: None,
            size: None,
            status: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "customer_list")]
    CustomerList,
    #[serde(rename = "website")]
    Website,
    #[serde(rename = "lookalike")]
    Lookalike,
    #[serde(rename = "saved_targeting")]
    SavedTargeting,
}

impl Default for Type {
    fn default() -> Type {
        Self::CustomerList
    }
}
