late 0.0.1097

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.
Documentation
/*
 * 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.168.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 CreateInboxConversationRequestTemplateButtonParamsInner {
    /// Zero-based position of the button in the approved template's buttons.
    #[serde(rename = "index")]
    pub index: i32,
    /// The button kind, which decides how the value is sent: copy_code sends it as the coupon_code payload, flow as the flow token, url as the dynamic suffix appended to the button's base URL.
    #[serde(rename = "subType")]
    pub sub_type: SubType,
    /// The value to send (e.g. the Pix copy-and-paste code for a copy_code button).
    #[serde(rename = "value")]
    pub value: String,
}

impl CreateInboxConversationRequestTemplateButtonParamsInner {
    pub fn new(
        index: i32,
        sub_type: SubType,
        value: String,
    ) -> CreateInboxConversationRequestTemplateButtonParamsInner {
        CreateInboxConversationRequestTemplateButtonParamsInner {
            index,
            sub_type,
            value,
        }
    }
}
/// The button kind, which decides how the value is sent: copy_code sends it as the coupon_code payload, flow as the flow token, url as the dynamic suffix appended to the button's base URL.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum SubType {
    #[serde(rename = "url")]
    Url,
    #[serde(rename = "copy_code")]
    CopyCode,
    #[serde(rename = "flow")]
    Flow,
}

impl Default for SubType {
    fn default() -> SubType {
        Self::Url
    }
}