/*
* 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.597.0
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// AutomationPreview : What an ad rule would do if it ran now. Nothing is changed. Cooldowns and daily caps are left out, so a run right after can act on fewer objects.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AutomationPreview {
#[serde(rename = "evaluatedAt")]
pub evaluated_at: String,
/// Today in the ad account timezone.
#[serde(rename = "today")]
pub today: String,
#[serde(rename = "timezone")]
pub timezone: String,
/// True when the ad account timezone is unknown and UTC was used.
#[serde(rename = "timezoneAssumed")]
pub timezone_assumed: bool,
#[serde(rename = "currency", deserialize_with = "Option::deserialize")]
pub currency: Option<String>,
/// Where the hourly windows (`last_complete_hour`, `last_3h`, `today_so_far`) ended: the end of the latest hour a sync has settled. Null when the rule has none or they could not be read.
#[serde(
rename = "hourlyThrough",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub hourly_through: Option<Option<String>>,
#[serde(rename = "evaluated")]
pub evaluated: i32,
#[serde(rename = "matched")]
pub matched: i32,
/// True when more subjects were judged than `limit` lists.
#[serde(rename = "truncated")]
pub truncated: bool,
/// Matches first, up to `limit`.
#[serde(rename = "subjects")]
pub subjects: Vec<models::AutomationPreviewSubjectsInner>,
/// Each group's totals against the conditions, when the rule has `subjects.groups`.
#[serde(rename = "groups", skip_serializing_if = "Option::is_none")]
pub groups: Option<Vec<models::AutomationPreviewGroupsInner>>,
}
impl AutomationPreview {
/// What an ad rule would do if it ran now. Nothing is changed. Cooldowns and daily caps are left out, so a run right after can act on fewer objects.
pub fn new(
evaluated_at: String,
today: String,
timezone: String,
timezone_assumed: bool,
currency: Option<String>,
evaluated: i32,
matched: i32,
truncated: bool,
subjects: Vec<models::AutomationPreviewSubjectsInner>,
) -> AutomationPreview {
AutomationPreview {
evaluated_at,
today,
timezone,
timezone_assumed,
currency,
hourly_through: None,
evaluated,
matched,
truncated,
subjects,
groups: None,
}
}
}