|
3 | 3 | * |
4 | 4 | * REST API to interact with Tower Services. |
5 | 5 | * |
6 | | - * The version of the OpenAPI document: v0.5.9 |
| 6 | + * The version of the OpenAPI document: v0.5.12 |
7 | 7 | * Contact: hello@tower.dev |
8 | 8 | * Generated by: https://openapi-generator.tech |
9 | 9 | */ |
@@ -195,18 +195,16 @@ pub struct DescribeSecretsKeyParams { |
195 | 195 | pub format: Option<String> |
196 | 196 | } |
197 | 197 |
|
| 198 | +/// struct for passing parameters to the method [`export_catalogs`] |
| 199 | +#[derive(Clone, Debug)] |
| 200 | +pub struct ExportCatalogsParams { |
| 201 | + pub export_catalogs_params: models::ExportCatalogsParams |
| 202 | +} |
| 203 | + |
198 | 204 | /// struct for passing parameters to the method [`export_secrets`] |
199 | 205 | #[derive(Clone, Debug)] |
200 | 206 | pub struct ExportSecretsParams { |
201 | | - pub export_user_secrets_params: models::ExportUserSecretsParams, |
202 | | - /// The environment to filter by. |
203 | | - pub environment: Option<String>, |
204 | | - /// Whether to fetch all secrets or only the ones that are not marked as deleted. |
205 | | - pub all: Option<bool>, |
206 | | - /// The page number to fetch. |
207 | | - pub page: Option<i64>, |
208 | | - /// The number of records to fetch on each page. |
209 | | - pub page_size: Option<i64> |
| 207 | + pub export_secrets_params: models::ExportSecretsParams |
210 | 208 | } |
211 | 209 |
|
212 | 210 | /// struct for passing parameters to the method [`generate_run_statistics`] |
@@ -559,7 +557,7 @@ pub enum DeleteCatalogSuccess { |
559 | 557 | #[derive(Debug, Clone, Serialize, Deserialize)] |
560 | 558 | #[serde(untagged)] |
561 | 559 | pub enum DeleteSecretSuccess { |
562 | | - Status204(), |
| 560 | + Status200(models::DeleteSecretResponse), |
563 | 561 | UnknownValue(serde_json::Value), |
564 | 562 | } |
565 | 563 |
|
@@ -643,6 +641,14 @@ pub enum DescribeSessionSuccess { |
643 | 641 | UnknownValue(serde_json::Value), |
644 | 642 | } |
645 | 643 |
|
| 644 | +/// struct for typed successes of method [`export_catalogs`] |
| 645 | +#[derive(Debug, Clone, Serialize, Deserialize)] |
| 646 | +#[serde(untagged)] |
| 647 | +pub enum ExportCatalogsSuccess { |
| 648 | + Status200(models::ExportCatalogsResponse), |
| 649 | + UnknownValue(serde_json::Value), |
| 650 | +} |
| 651 | + |
646 | 652 | /// struct for typed successes of method [`export_secrets`] |
647 | 653 | #[derive(Debug, Clone, Serialize, Deserialize)] |
648 | 654 | #[serde(untagged)] |
@@ -1103,6 +1109,14 @@ pub enum DescribeSessionError { |
1103 | 1109 | UnknownValue(serde_json::Value), |
1104 | 1110 | } |
1105 | 1111 |
|
| 1112 | +/// struct for typed errors of method [`export_catalogs`] |
| 1113 | +#[derive(Debug, Clone, Serialize, Deserialize)] |
| 1114 | +#[serde(untagged)] |
| 1115 | +pub enum ExportCatalogsError { |
| 1116 | + DefaultResponse(models::ErrorModel), |
| 1117 | + UnknownValue(serde_json::Value), |
| 1118 | +} |
| 1119 | + |
1106 | 1120 | /// struct for typed errors of method [`export_secrets`] |
1107 | 1121 | #[derive(Debug, Clone, Serialize, Deserialize)] |
1108 | 1122 | #[serde(untagged)] |
@@ -2307,31 +2321,55 @@ pub async fn describe_session(configuration: &configuration::Configuration) -> R |
2307 | 2321 | } |
2308 | 2322 | } |
2309 | 2323 |
|
| 2324 | +/// Lists all the catalogs in your current account and re-encrypt them with the public key you supplied. |
| 2325 | +pub async fn export_catalogs(configuration: &configuration::Configuration, params: ExportCatalogsParams) -> Result<ResponseContent<ExportCatalogsSuccess>, Error<ExportCatalogsError>> { |
| 2326 | + |
| 2327 | + let uri_str = format!("{}/catalogs/export", configuration.base_path); |
| 2328 | + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); |
| 2329 | + |
| 2330 | + if let Some(ref user_agent) = configuration.user_agent { |
| 2331 | + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); |
| 2332 | + } |
| 2333 | + if let Some(ref token) = configuration.bearer_access_token { |
| 2334 | + req_builder = req_builder.bearer_auth(token.to_owned()); |
| 2335 | + }; |
| 2336 | + req_builder = req_builder.json(¶ms.export_catalogs_params); |
| 2337 | + |
| 2338 | + let req = req_builder.build()?; |
| 2339 | + let resp = configuration.client.execute(req).await?; |
| 2340 | + |
| 2341 | + let status = resp.status(); |
| 2342 | + |
| 2343 | + let tower_trace_id = resp |
| 2344 | + .headers() |
| 2345 | + .get("x-tower-trace-id") |
| 2346 | + .and_then(|v| v.to_str().ok()) |
| 2347 | + .map_or(String::from(DEFAULT_TOWER_TRACE_ID), String::from); |
| 2348 | + |
| 2349 | + if !status.is_client_error() && !status.is_server_error() { |
| 2350 | + let content = resp.text().await?; |
| 2351 | + let entity: Option<ExportCatalogsSuccess> = serde_json::from_str(&content).ok(); |
| 2352 | + Ok(ResponseContent { tower_trace_id, status, content, entity }) |
| 2353 | + } else { |
| 2354 | + let content = resp.text().await?; |
| 2355 | + let entity: Option<ExportCatalogsError> = serde_json::from_str(&content).ok(); |
| 2356 | + Err(Error::ResponseError(ResponseContent { tower_trace_id, status, content, entity })) |
| 2357 | + } |
| 2358 | +} |
| 2359 | + |
2310 | 2360 | /// Lists all the secrets in your current account and re-encrypt them with the public key you supplied. |
2311 | 2361 | pub async fn export_secrets(configuration: &configuration::Configuration, params: ExportSecretsParams) -> Result<ResponseContent<ExportSecretsSuccess>, Error<ExportSecretsError>> { |
2312 | 2362 |
|
2313 | 2363 | let uri_str = format!("{}/secrets/export", configuration.base_path); |
2314 | | - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); |
| 2364 | + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); |
2315 | 2365 |
|
2316 | | - if let Some(ref param_value) = params.environment { |
2317 | | - req_builder = req_builder.query(&[("environment", ¶m_value.to_string())]); |
2318 | | - } |
2319 | | - if let Some(ref param_value) = params.all { |
2320 | | - req_builder = req_builder.query(&[("all", ¶m_value.to_string())]); |
2321 | | - } |
2322 | | - if let Some(ref param_value) = params.page { |
2323 | | - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); |
2324 | | - } |
2325 | | - if let Some(ref param_value) = params.page_size { |
2326 | | - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); |
2327 | | - } |
2328 | 2366 | if let Some(ref user_agent) = configuration.user_agent { |
2329 | 2367 | req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); |
2330 | 2368 | } |
2331 | 2369 | if let Some(ref token) = configuration.bearer_access_token { |
2332 | 2370 | req_builder = req_builder.bearer_auth(token.to_owned()); |
2333 | 2371 | }; |
2334 | | - req_builder = req_builder.json(¶ms.export_user_secrets_params); |
| 2372 | + req_builder = req_builder.json(¶ms.export_secrets_params); |
2335 | 2373 |
|
2336 | 2374 | let req = req_builder.build()?; |
2337 | 2375 | let resp = configuration.client.execute(req).await?; |
|
0 commit comments