linkbreakers 1.140.0

Official Rust SDK for the Linkbreakers API
Documentation
/*
 * Linkbreakers API
 *
 * This is a documentation of all the APIs of Linkbreakers
 *
 * The version of the OpenAPI document: 1.140.0
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// AttributeWrite : One value saved to the visitor's profile.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AttributeWrite {
    /// The attribute key, such as \"looking_for\" or \"book_a_viewing_at\". Letters, digits, \"_\", \"-\" and \".\"; keys starting with \"$\" are reserved.
    #[serde(rename = "key", skip_serializing_if = "Option::is_none")]
    pub key: Option<String>,
    ///  - ATTRIBUTE_WRITE_MODE_SET: Overwrite, so the profile holds the latest value.  - ATTRIBUTE_WRITE_MODE_SET_ONCE: Keep the first value, for first-touch facts.
    #[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
    pub mode: Option<Mode>,
    /// VisitorAttributeType is what a value was captured as. It decides how the value is parsed and which analytics the key can support, which the value alone cannot tell you: \"8\" from a rating field and \"8\" typed into a text box are different facts.
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<Type>,
    /// Literal text, or a template filled in when the visitor goes through the step: {{now}}, {{link.name}}, {{link.metadata.<key>}}, and on MULTI_LINK steps {{choice.label}} and {{choice.id}} for the button tapped. A write whose value comes out empty is skipped.
    #[serde(rename = "value", skip_serializing_if = "Option::is_none")]
    pub value: Option<String>,
}

impl AttributeWrite {
    /// One value saved to the visitor's profile.
    pub fn new() -> AttributeWrite {
        AttributeWrite {
            key: None,
            mode: None,
            r#type: None,
            value: None,
        }
    }
}
///  - ATTRIBUTE_WRITE_MODE_SET: Overwrite, so the profile holds the latest value.  - ATTRIBUTE_WRITE_MODE_SET_ONCE: Keep the first value, for first-touch facts.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Mode {
    #[serde(rename = "ATTRIBUTE_WRITE_MODE_UNSPECIFIED")]
    AttributeWriteModeUnspecified,
    #[serde(rename = "ATTRIBUTE_WRITE_MODE_SET")]
    AttributeWriteModeSet,
    #[serde(rename = "ATTRIBUTE_WRITE_MODE_SET_ONCE")]
    AttributeWriteModeSetOnce,
}

impl Default for Mode {
    fn default() -> Mode {
        Self::AttributeWriteModeUnspecified
    }
}
/// VisitorAttributeType is what a value was captured as. It decides how the value is parsed and which analytics the key can support, which the value alone cannot tell you: \"8\" from a rating field and \"8\" typed into a text box are different facts.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "VISITOR_ATTRIBUTE_TYPE_UNSPECIFIED")]
    VisitorAttributeTypeUnspecified,
    #[serde(rename = "VISITOR_ATTRIBUTE_TYPE_STRING")]
    VisitorAttributeTypeString,
    #[serde(rename = "VISITOR_ATTRIBUTE_TYPE_NUMBER")]
    VisitorAttributeTypeNumber,
    #[serde(rename = "VISITOR_ATTRIBUTE_TYPE_BOOLEAN")]
    VisitorAttributeTypeBoolean,
    #[serde(rename = "VISITOR_ATTRIBUTE_TYPE_DATE")]
    VisitorAttributeTypeDate,
    #[serde(rename = "VISITOR_ATTRIBUTE_TYPE_ENUM")]
    VisitorAttributeTypeEnum,
}

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