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 SearchQueryEvent {
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "dataset_id")]
    pub dataset_id: uuid::Uuid,
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    #[serde(rename = "latency")]
    pub latency: f32,
    #[serde(rename = "query")]
    pub query: String,
    #[serde(rename = "query_rating")]
    pub query_rating: String,
    #[serde(rename = "request_params", deserialize_with = "Option::deserialize")]
    pub request_params: Option<serde_json::Value>,
    #[serde(rename = "results")]
    pub results: Vec<serde_json::Value>,
    #[serde(rename = "search_type")]
    pub search_type: String,
    #[serde(rename = "top_score")]
    pub top_score: f32,
    #[serde(rename = "user_id")]
    pub user_id: String,
}

impl SearchQueryEvent {
    pub fn new(created_at: String, dataset_id: uuid::Uuid, id: uuid::Uuid, latency: f32, query: String, query_rating: String, request_params: Option<serde_json::Value>, results: Vec<serde_json::Value>, search_type: String, top_score: f32, user_id: String) -> SearchQueryEvent {
        SearchQueryEvent {
            created_at,
            dataset_id,
            id,
            latency,
            query,
            query_rating,
            request_params,
            results,
            search_type,
            top_score,
            user_id,
        }
    }
}