Skip to content

Commit 193947c

Browse files
committed
fixup
1 parent af6627e commit 193947c

2 files changed

Lines changed: 16 additions & 27 deletions

File tree

src/commands/restore.rs

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ use crate::output::{
88
};
99

1010
#[derive(Debug, Serialize)]
11-
struct ListRestoresQuery {
11+
pub struct ListRestoresQuery {
1212
#[serde(skip_serializing_if = "Option::is_none")]
13-
r#type: Option<String>,
13+
pub r#type: Option<String>,
1414
#[serde(skip_serializing_if = "Option::is_none")]
15-
site_id: Option<String>,
15+
pub site_id: Option<String>,
1616
#[serde(skip_serializing_if = "Option::is_none")]
17-
environment_id: Option<String>,
17+
pub environment_id: Option<String>,
1818
#[serde(skip_serializing_if = "Option::is_none")]
19-
backup_id: Option<String>,
20-
page: u32,
21-
per_page: u32,
19+
pub backup_id: Option<String>,
20+
pub page: u32,
21+
pub per_page: u32,
2222
}
2323

2424
#[derive(Debug, Serialize)]
@@ -29,22 +29,9 @@ struct CreateRestoreRequest {
2929

3030
pub fn list(
3131
client: &ApiClient,
32-
site_id: Option<String>,
33-
environment_id: Option<String>,
34-
restore_type: Option<String>,
35-
backup_id: Option<String>,
36-
page: u32,
37-
per_page: u32,
32+
query: ListRestoresQuery,
3833
format: OutputFormat,
3934
) -> Result<(), ApiError> {
40-
let query = ListRestoresQuery {
41-
r#type: restore_type,
42-
site_id,
43-
environment_id,
44-
backup_id,
45-
page,
46-
per_page,
47-
};
4835
let response: Value = client.get_with_query("/api/v1/vector/restores", &query)?;
4936

5037
if format == OutputFormat::Json {

src/main.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -683,12 +683,14 @@ fn run_restore(command: RestoreCommands, format: OutputFormat) -> Result<(), Api
683683
per_page,
684684
} => restore::list(
685685
&client,
686-
site_id,
687-
environment_id,
688-
restore_type,
689-
backup_id,
690-
page,
691-
per_page,
686+
restore::ListRestoresQuery {
687+
r#type: restore_type,
688+
site_id,
689+
environment_id,
690+
backup_id,
691+
page,
692+
per_page,
693+
},
692694
format,
693695
),
694696
RestoreCommands::Show { restore_id } => restore::show(&client, &restore_id, format),

0 commit comments

Comments
 (0)