/*
* 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 CreateAdAccountRequest {
/// Zernio metaads SocialAccount ID.
#[serde(rename = "accountId")]
pub account_id: String,
/// Business portfolio that will own the account.
#[serde(rename = "businessId")]
pub business_id: String,
/// Ad account name. Whitespace is trimmed.
#[serde(rename = "name")]
pub name: String,
/// Uppercase ISO 4217 currency supported by Meta.
#[serde(rename = "currency")]
pub currency: String,
/// Numeric Meta timezone ID from the linked timezone list. For example 1 is America/Los_Angeles.
#[serde(rename = "timezoneId")]
pub timezone_id: i32,
/// End advertiser business or page ID. NONE uses the owning business.
#[serde(rename = "endAdvertiser", skip_serializing_if = "Option::is_none")]
pub end_advertiser: Option<String>,
/// Media agency business or page ID. NONE for self-serve customers.
#[serde(rename = "mediaAgency", skip_serializing_if = "Option::is_none")]
pub media_agency: Option<String>,
/// Partner business or page ID. NONE for self-serve customers.
#[serde(rename = "partner", skip_serializing_if = "Option::is_none")]
pub partner: Option<String>,
/// Request Meta invoicing. Eligibility is determined by Meta.
#[serde(rename = "invoice", skip_serializing_if = "Option::is_none")]
pub invoice: Option<bool>,
/// Existing Meta invoice group ID.
#[serde(rename = "invoiceGroupId", skip_serializing_if = "Option::is_none")]
pub invoice_group_id: Option<String>,
/// Addresses for Meta invoices.
#[serde(rename = "invoicingEmails", skip_serializing_if = "Option::is_none")]
pub invoicing_emails: Option<Vec<String>>,
/// Meta insertion-order invoicing option.
#[serde(rename = "io", skip_serializing_if = "Option::is_none")]
pub io: Option<bool>,
/// Purchase order number.
#[serde(rename = "poNumber", skip_serializing_if = "Option::is_none")]
pub po_number: Option<String>,
/// Existing Meta funding reference. Does not add a payment method.
#[serde(rename = "fundingId", skip_serializing_if = "Option::is_none")]
pub funding_id: Option<String>,
/// Meta Business Manager creation flag.
#[serde(
rename = "adAccountCreatedFromBmFlag",
skip_serializing_if = "Option::is_none"
)]
pub ad_account_created_from_bm_flag: Option<bool>,
}
impl CreateAdAccountRequest {
pub fn new(
account_id: String,
business_id: String,
name: String,
currency: String,
timezone_id: i32,
) -> CreateAdAccountRequest {
CreateAdAccountRequest {
account_id,
business_id,
name,
currency,
timezone_id,
end_advertiser: None,
media_agency: None,
partner: None,
invoice: None,
invoice_group_id: None,
invoicing_emails: None,
io: None,
po_number: None,
funding_id: None,
ad_account_created_from_bm_flag: None,
}
}
}