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 SortByField {
    #[serde(rename = "direction", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub direction: Option<Option<models::SortOrder>>,
    /// Field to sort by. This has to be a numeric field with a Qdrant `Range` index on it. i.e. num_value and timestamp
    #[serde(rename = "field")]
    pub field: String,
    /// How many results to pull in before the sort
    #[serde(rename = "prefetch_amount", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub prefetch_amount: Option<Option<i64>>,
}

impl SortByField {
    pub fn new(field: String) -> SortByField {
        SortByField {
            direction: None,
            field,
            prefetch_amount: None,
        }
    }
}