1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
* Hotdata API
*
* Powerful data platform API for datasets, queries, and analytics.
*
* The version of the OpenAPI document: 1.0.0
* Contact: developers@hotdata.dev
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// IndexEntryResponse : One index in a cross-table listing: the per-table [`IndexInfoResponse`] plus the identity needed to know which table it belongs to.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct IndexEntryResponse {
#[serde(rename = "columns")]
pub columns: Vec<String>,
#[serde(rename = "created_at")]
pub created_at: String,
#[serde(rename = "index_name")]
pub index_name: String,
#[serde(rename = "index_type")]
pub index_type: String,
/// Distance metric this index was built with. Only present for vector indexes.
#[serde(rename = "metric", skip_serializing_if = "Option::is_none")]
pub metric: Option<String>,
/// Source text column for an embedding-backed vector index. A query searches it via `vector_distance(<source_column>, …)`; the indexed `columns` hold the generated embedding column instead. Absent for BM25, sorted, and direct (existing-column) vector indexes.
#[serde(rename = "source_column", skip_serializing_if = "Option::is_none")]
pub source_column: Option<String>,
#[serde(rename = "status")]
pub status: models::IndexStatus,
#[serde(rename = "updated_at")]
pub updated_at: String,
#[serde(
rename = "connection_id",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub connection_id: Option<Option<String>>,
#[serde(rename = "schema_name")]
pub schema_name: String,
#[serde(rename = "table_name")]
pub table_name: String,
}
impl IndexEntryResponse {
/// One index in a cross-table listing: the per-table [`IndexInfoResponse`] plus the identity needed to know which table it belongs to.
pub fn new(
columns: Vec<String>,
created_at: String,
index_name: String,
index_type: String,
status: models::IndexStatus,
updated_at: String,
schema_name: String,
table_name: String,
) -> IndexEntryResponse {
IndexEntryResponse {
columns,
created_at,
index_name,
index_type,
metric: None,
source_column: None,
status,
updated_at,
connection_id: None,
schema_name,
table_name,
}
}
}