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
/*
* 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};
/// AsyncQueryResponse : Response returned when a query is submitted asynchronously (202 Accepted). Poll GET /query-runs/{id} to track progress. Once status is \"succeeded\", retrieve results via GET /results/{result_id}.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AsyncQueryResponse {
/// Unique identifier for the query run.
#[serde(rename = "query_run_id")]
pub query_run_id: String,
/// Human-readable reason why the query went async (e.g., caching tables for the first time).
#[serde(
rename = "reason",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub reason: Option<Option<String>>,
/// Current status of the query run.
#[serde(rename = "status")]
pub status: String,
/// URL to poll for query run status.
#[serde(rename = "status_url")]
pub status_url: String,
}
impl AsyncQueryResponse {
/// Response returned when a query is submitted asynchronously (202 Accepted). Poll GET /query-runs/{id} to track progress. Once status is \"succeeded\", retrieve results via GET /results/{result_id}.
pub fn new(query_run_id: String, status: String, status_url: String) -> AsyncQueryResponse {
AsyncQueryResponse {
query_run_id,
reason: None,
status,
status_url,
}
}
}