linkbreakers 1.107.2

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.107.2
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// CreateLinkRequest : Request to create a new link.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateLinkRequest {
    /// Enable conversion tracking by preserving lbid in redirect URL.
    #[serde(rename = "conversionTracking", skip_serializing_if = "Option::is_none")]
    pub conversion_tracking: Option<bool>,
    /// Optional custom domain ID (UUID). Leave empty to use the default domain.
    #[serde(rename = "customDomainId", skip_serializing_if = "Option::is_none")]
    pub custom_domain_id: Option<String>,
    /// The destination URL to shorten. This field is required.
    #[serde(rename = "destination")]
    pub destination: String,
    #[serde(rename = "directoryId", skip_serializing_if = "Option::is_none")]
    pub directory_id: Option<String>,
    #[serde(rename = "fallbackDestination", skip_serializing_if = "Option::is_none")]
    pub fallback_destination: Option<String>,
    /// Optional pre-generated link ID (UUID). Skipped from the AI tool schema: on a create there is no existing link to alias, so exposing it only invites the LLM to invent a raw UUID. The system generates the id and returns it as an alias in the response.
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// The lead goal definition for the link. This is a text field that can be used to describe the lead goal or purpose of the link.
    #[serde(rename = "leadGoalDefinition", skip_serializing_if = "Option::is_none")]
    pub lead_goal_definition: Option<String>,
    /// The lead target definition for the link. This is a text field that can be used to describe the target lead criteria for the link.
    #[serde(rename = "leadTargetDefinition", skip_serializing_if = "Option::is_none")]
    pub lead_target_definition: Option<String>,
    /// A map of string key-value pairs. All values must be strings. Nested objects or arrays are not supported. Maximum of 50 keys.
    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
    pub metadata: Option<std::collections::HashMap<String, String>>,
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// The QR Code design ID (UUID).
    #[serde(rename = "qrcodeDesignId", skip_serializing_if = "Option::is_none")]
    pub qrcode_design_id: Option<String>,
    #[serde(rename = "qrcodeTemplateId", skip_serializing_if = "Option::is_none")]
    pub qrcode_template_id: Option<String>,
    /// The shortlink (URL slug) for the link. If not given, a unique one is generated by the system.
    #[serde(rename = "shortlink", skip_serializing_if = "Option::is_none")]
    pub shortlink: Option<String>,
    /// List of tags to associate with the link. If a tag doesn't exist, it will be created.
    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
    pub tags: Option<Vec<String>>,
    /// Wait for QR code generation to complete before returning response.
    #[serde(rename = "waitForQrcode", skip_serializing_if = "Option::is_none")]
    pub wait_for_qrcode: Option<bool>,
}

impl CreateLinkRequest {
    /// Request to create a new link.
    pub fn new(destination: String) -> CreateLinkRequest {
        CreateLinkRequest {
            conversion_tracking: None,
            custom_domain_id: None,
            destination,
            directory_id: None,
            fallback_destination: None,
            id: None,
            lead_goal_definition: None,
            lead_target_definition: None,
            metadata: None,
            name: None,
            qrcode_design_id: None,
            qrcode_template_id: None,
            shortlink: None,
            tags: None,
            wait_for_qrcode: None,
        }
    }
}