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
/*
* Hotdata API
*
* Powerful data platform API for managed databases, 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};
/// DatabaseBatchResponse : A bulk-creation batch: the handle for progress, listing, and cancellation. The databases themselves are listed with `GET /databases?batch=<batch_id>`; this carries the batch's own state rather than its members.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DatabaseBatchResponse {
#[serde(rename = "batch_id")]
pub batch_id: String,
/// True once stopping has been requested. Databases already created are kept; only further creation stops.
#[serde(rename = "cancel_requested")]
pub cancel_requested: bool,
/// How many databases the batch was asked to create.
#[serde(rename = "count")]
pub count: i64,
/// How many exist so far. Advances as the batch fills.
#[serde(rename = "created_count")]
pub created_count: i64,
#[serde(
rename = "expires_at",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub expires_at: Option<Option<String>>,
/// Job filling this batch. Poll it for status.
#[serde(
rename = "job_id",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub job_id: Option<Option<String>>,
#[serde(
rename = "status_url",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub status_url: Option<Option<String>>,
}
impl DatabaseBatchResponse {
/// A bulk-creation batch: the handle for progress, listing, and cancellation. The databases themselves are listed with `GET /databases?batch=<batch_id>`; this carries the batch's own state rather than its members.
pub fn new(
batch_id: String,
cancel_requested: bool,
count: i64,
created_count: i64,
) -> DatabaseBatchResponse {
DatabaseBatchResponse {
batch_id,
cancel_requested,
count,
created_count,
expires_at: None,
job_id: None,
status_url: None,
}
}
}