trieve-client 0.11.7

Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
Documentation
/*
 * Trieve API
 *
 * Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
 *
 * The version of the OpenAPI document: 0.11.7
 * Contact: developers@trieve.ai
 * Generated by: https://openapi-generator.tech
 */

use crate::models;

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CtrDataRequestBody {
    /// The ID of chunk that was clicked
    #[serde(rename = "clicked_chunk_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub clicked_chunk_id: Option<Option<uuid::Uuid>>,
    /// The tracking ID of the chunk that was clicked
    #[serde(rename = "clicked_chunk_tracking_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub clicked_chunk_tracking_id: Option<Option<String>>,
    #[serde(rename = "ctr_type")]
    pub ctr_type: models::CtrType,
    /// Any metadata you want to include with the event i.e. action, user_id, etc.
    #[serde(rename = "metadata", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub metadata: Option<Option<serde_json::Value>>,
    /// The position of the clicked chunk
    #[serde(rename = "position")]
    pub position: i32,
    /// The request id for the CTR data
    #[serde(rename = "request_id")]
    pub request_id: uuid::Uuid,
}

impl CtrDataRequestBody {
    pub fn new(ctr_type: models::CtrType, position: i32, request_id: uuid::Uuid) -> CtrDataRequestBody {
        CtrDataRequestBody {
            clicked_chunk_id: None,
            clicked_chunk_tracking_id: None,
            ctr_type,
            metadata: None,
            position,
            request_id,
        }
    }
}