/*
* 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.565.5
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// AutomationTemplateInput : Something an install asks for. Each automation in the template holds `{ \"$input\": \"<key>\" }` where the value goes, and installing puts the value sent in `inputs.<key>` there.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AutomationTemplateInput {
/// The name to send the value under in `inputs`, for example `adAccount`.
#[serde(rename = "key")]
pub key: String,
/// What the value is. `ad_account`: `{ accountId, adAccountId }`. `profile`: a profile id. `social_accounts`: an array of social account ids. `notify_destination`: an array of `{ accountId, to?, channelId? }`. `number`, `money` (in the ad account's currency) and `percent`: a number within the bounds below. `choice`: one of `options[].value`.
#[serde(rename = "type")]
pub r#type: Type,
#[serde(rename = "label")]
pub label: String,
/// True when an install may leave it out. A field that points at a left-out input is dropped.
#[serde(rename = "optional", skip_serializing_if = "Option::is_none")]
pub optional: Option<bool>,
#[serde(rename = "default", skip_serializing_if = "Option::is_none")]
pub default: Option<Box<models::AutomationTemplateInputDefault>>,
#[serde(rename = "min", skip_serializing_if = "Option::is_none")]
pub min: Option<f64>,
/// The value must be above it, for example an amount above 0.
#[serde(rename = "exclusiveMin", skip_serializing_if = "Option::is_none")]
pub exclusive_min: Option<f64>,
#[serde(rename = "max", skip_serializing_if = "Option::is_none")]
pub max: Option<f64>,
/// True when only whole numbers are accepted.
#[serde(rename = "integer", skip_serializing_if = "Option::is_none")]
pub integer: Option<bool>,
/// What a `choice` input offers.
#[serde(rename = "options", skip_serializing_if = "Option::is_none")]
pub options: Option<Vec<models::AutomationTemplateInputOptionsInner>>,
}
impl AutomationTemplateInput {
/// Something an install asks for. Each automation in the template holds `{ \"$input\": \"<key>\" }` where the value goes, and installing puts the value sent in `inputs.<key>` there.
pub fn new(key: String, r#type: Type, label: String) -> AutomationTemplateInput {
AutomationTemplateInput {
key,
r#type,
label,
optional: None,
default: None,
min: None,
exclusive_min: None,
max: None,
integer: None,
options: None,
}
}
}
/// What the value is. `ad_account`: `{ accountId, adAccountId }`. `profile`: a profile id. `social_accounts`: an array of social account ids. `notify_destination`: an array of `{ accountId, to?, channelId? }`. `number`, `money` (in the ad account's currency) and `percent`: a number within the bounds below. `choice`: one of `options[].value`.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "ad_account")]
AdAccount,
#[serde(rename = "profile")]
Profile,
#[serde(rename = "social_accounts")]
SocialAccounts,
#[serde(rename = "notify_destination")]
NotifyDestination,
#[serde(rename = "number")]
Number,
#[serde(rename = "money")]
Money,
#[serde(rename = "percent")]
Percent,
#[serde(rename = "choice")]
Choice,
}
impl Default for Type {
fn default() -> Type {
Self::AdAccount
}
}