diff --git a/.gitignore b/.gitignore index 06be6620..1f359cd4 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,5 @@ pytest.ini /crates/tower-api/.gitignore /scripts/openapi.json /scripts/openapi-generator-cli-*.jar + +.idea diff --git a/Cargo.lock b/Cargo.lock index be165468..1c066ead 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -387,7 +387,7 @@ dependencies = [ [[package]] name = "config" -version = "0.3.29" +version = "0.3.30" dependencies = [ "chrono", "clap", @@ -474,7 +474,7 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crypto" -version = "0.3.29" +version = "0.3.30" dependencies = [ "aes-gcm", "base64", @@ -2629,7 +2629,7 @@ dependencies = [ [[package]] name = "testutils" -version = "0.3.29" +version = "0.3.30" dependencies = [ "pem", "rsa", @@ -2875,7 +2875,7 @@ checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" [[package]] name = "tower" -version = "0.3.29" +version = "0.3.30" dependencies = [ "tokio", "tower-api", @@ -2899,7 +2899,7 @@ dependencies = [ [[package]] name = "tower-api" -version = "0.3.29" +version = "0.3.30" dependencies = [ "reqwest", "serde", @@ -2911,7 +2911,7 @@ dependencies = [ [[package]] name = "tower-cmd" -version = "0.3.29" +version = "0.3.30" dependencies = [ "anyhow", "bytes", @@ -2970,7 +2970,7 @@ checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-package" -version = "0.3.29" +version = "0.3.30" dependencies = [ "async-compression", "config", @@ -2989,7 +2989,7 @@ dependencies = [ [[package]] name = "tower-runtime" -version = "0.3.29" +version = "0.3.30" dependencies = [ "chrono", "config", @@ -3010,7 +3010,7 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tower-telemetry" -version = "0.3.29" +version = "0.3.30" dependencies = [ "tracing", "tracing-appender", @@ -3019,7 +3019,7 @@ dependencies = [ [[package]] name = "tower-uv" -version = "0.3.29" +version = "0.3.30" dependencies = [ "async-compression", "async_zip", @@ -3033,7 +3033,7 @@ dependencies = [ [[package]] name = "tower-version" -version = "0.3.29" +version = "0.3.30" dependencies = [ "anyhow", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 6de53390..0f79ac8d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,8 @@ resolver = "2" [workspace.package] edition = "2021" -version = "0.3.29" +version = "0.3.30" + diff --git a/crates/tower-api/README.md b/crates/tower-api/README.md index c541b45c..cd6221d3 100644 --- a/crates/tower-api/README.md +++ b/crates/tower-api/README.md @@ -8,7 +8,7 @@ For more information, please visit [https://tower.dev](https://tower.dev) This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. -- API version: v0.7.10 +- API version: v0.7.14 - Package version: 1.0.0 - Generator version: 7.13.0 - Build package: `org.openapitools.codegen.languages.RustClientCodegen` @@ -29,6 +29,7 @@ Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *DefaultApi* | [**acknowledge_alert**](docs/DefaultApi.md#acknowledge_alert) | **POST** /alerts/{alert_seq}/acknowledge | Acknowledge alert *DefaultApi* | [**acknowledge_all_alerts**](docs/DefaultApi.md#acknowledge_all_alerts) | **POST** /alerts/acknowledge-all | Acknowledge all alerts +*DefaultApi* | [**activate_schedules**](docs/DefaultApi.md#activate_schedules) | **PATCH** /schedules/activate | Activate multiple schedules *DefaultApi* | [**cancel_run**](docs/DefaultApi.md#cancel_run) | **POST** /apps/{name}/runs/{seq} | Cancel run *DefaultApi* | [**claim_device_login_ticket**](docs/DefaultApi.md#claim_device_login_ticket) | **POST** /login/device/claim | Claim a device login ticket *DefaultApi* | [**create_account**](docs/DefaultApi.md#create_account) | **POST** /accounts | Create account @@ -43,6 +44,7 @@ Class | Method | HTTP request | Description *DefaultApi* | [**create_secret**](docs/DefaultApi.md#create_secret) | **POST** /secrets | Create secret *DefaultApi* | [**create_session**](docs/DefaultApi.md#create_session) | **POST** /session | Create session *DefaultApi* | [**create_team**](docs/DefaultApi.md#create_team) | **POST** /teams | Create team +*DefaultApi* | [**deactivate_schedules**](docs/DefaultApi.md#deactivate_schedules) | **PATCH** /schedules/deactivate | Deactivate multiple schedules *DefaultApi* | [**delete_alert**](docs/DefaultApi.md#delete_alert) | **DELETE** /alerts/{alert_id} | Delete alert *DefaultApi* | [**delete_api_key**](docs/DefaultApi.md#delete_api_key) | **DELETE** /api-keys | Delete API key *DefaultApi* | [**delete_app**](docs/DefaultApi.md#delete_app) | **DELETE** /apps/{name} | Delete app @@ -119,6 +121,8 @@ Class | Method | HTTP request | Description - [AppStatistics](docs/AppStatistics.md) - [AppSummary](docs/AppSummary.md) - [AppVersion](docs/AppVersion.md) + - [BatchScheduleParams](docs/BatchScheduleParams.md) + - [BatchScheduleResponse](docs/BatchScheduleResponse.md) - [CancelRunResponse](docs/CancelRunResponse.md) - [Catalog](docs/Catalog.md) - [CatalogProperty](docs/CatalogProperty.md) diff --git a/crates/tower-api/src/apis/configuration.rs b/crates/tower-api/src/apis/configuration.rs index 8d7f593d..f3cdad6a 100644 --- a/crates/tower-api/src/apis/configuration.rs +++ b/crates/tower-api/src/apis/configuration.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/apis/default_api.rs b/crates/tower-api/src/apis/default_api.rs index a53798ee..d037bb64 100644 --- a/crates/tower-api/src/apis/default_api.rs +++ b/crates/tower-api/src/apis/default_api.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -23,6 +23,12 @@ pub struct AcknowledgeAlertParams { pub alert_seq: i64 } +/// struct for passing parameters to the method [`activate_schedules`] +#[derive(Clone, Debug)] +pub struct ActivateSchedulesParams { + pub batch_schedule_params: models::BatchScheduleParams +} + /// struct for passing parameters to the method [`cancel_run`] #[derive(Clone, Debug)] pub struct CancelRunParams { @@ -104,6 +110,12 @@ pub struct CreateTeamParams { pub create_team_params: models::CreateTeamParams } +/// struct for passing parameters to the method [`deactivate_schedules`] +#[derive(Clone, Debug)] +pub struct DeactivateSchedulesParams { + pub batch_schedule_params: models::BatchScheduleParams +} + /// struct for passing parameters to the method [`delete_alert`] #[derive(Clone, Debug)] pub struct DeleteAlertParams { @@ -573,6 +585,14 @@ pub enum AcknowledgeAllAlertsSuccess { UnknownValue(serde_json::Value), } +/// struct for typed successes of method [`activate_schedules`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ActivateSchedulesSuccess { + Status200(models::BatchScheduleResponse), + UnknownValue(serde_json::Value), +} + /// struct for typed successes of method [`cancel_run`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -685,6 +705,14 @@ pub enum CreateTeamSuccess { UnknownValue(serde_json::Value), } +/// struct for typed successes of method [`deactivate_schedules`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeactivateSchedulesSuccess { + Status200(models::BatchScheduleResponse), + UnknownValue(serde_json::Value), +} + /// struct for typed successes of method [`delete_alert`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -1197,6 +1225,14 @@ pub enum AcknowledgeAllAlertsError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`activate_schedules`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ActivateSchedulesError { + DefaultResponse(models::ErrorModel), + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`cancel_run`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -1309,6 +1345,14 @@ pub enum CreateTeamError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`deactivate_schedules`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeactivateSchedulesError { + DefaultResponse(models::ErrorModel), + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`delete_alert`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -1879,6 +1923,42 @@ pub async fn acknowledge_all_alerts(configuration: &configuration::Configuration } } +/// Activate multiple schedules to enable their execution. +pub async fn activate_schedules(configuration: &configuration::Configuration, params: ActivateSchedulesParams) -> Result, Error> { + + let uri_str = format!("{}/schedules/activate", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(¶ms.batch_schedule_params); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + let tower_trace_id = resp + .headers() + .get("x-tower-trace-id") + .and_then(|v| v.to_str().ok()) + .map_or(String::from(DEFAULT_TOWER_TRACE_ID), String::from); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Ok(ResponseContent { tower_trace_id, status, content, entity }) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { tower_trace_id, status, content, entity })) + } +} + /// Cancel a run pub async fn cancel_run(configuration: &configuration::Configuration, params: CancelRunParams) -> Result, Error> { @@ -2368,6 +2448,42 @@ pub async fn create_team(configuration: &configuration::Configuration, params: C } } +/// Deactivate multiple schedules to disable their execution. +pub async fn deactivate_schedules(configuration: &configuration::Configuration, params: DeactivateSchedulesParams) -> Result, Error> { + + let uri_str = format!("{}/schedules/deactivate", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(¶ms.batch_schedule_params); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + let tower_trace_id = resp + .headers() + .get("x-tower-trace-id") + .and_then(|v| v.to_str().ok()) + .map_or(String::from(DEFAULT_TOWER_TRACE_ID), String::from); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Ok(ResponseContent { tower_trace_id, status, content, entity }) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { tower_trace_id, status, content, entity })) + } +} + /// Permanently delete an alert pub async fn delete_alert(configuration: &configuration::Configuration, params: DeleteAlertParams) -> Result, Error> { diff --git a/crates/tower-api/src/apis/feature_flags_api.rs b/crates/tower-api/src/apis/feature_flags_api.rs index 85bfd3d8..a2937ff0 100644 --- a/crates/tower-api/src/apis/feature_flags_api.rs +++ b/crates/tower-api/src/apis/feature_flags_api.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/account.rs b/crates/tower-api/src/models/account.rs index 29aaa97c..2c9a07a1 100644 --- a/crates/tower-api/src/models/account.rs +++ b/crates/tower-api/src/models/account.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/acknowledge_alert_response.rs b/crates/tower-api/src/models/acknowledge_alert_response.rs index 673efe22..db17f4d8 100644 --- a/crates/tower-api/src/models/acknowledge_alert_response.rs +++ b/crates/tower-api/src/models/acknowledge_alert_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/acknowledge_all_alerts_response.rs b/crates/tower-api/src/models/acknowledge_all_alerts_response.rs index 157b0247..177c853d 100644 --- a/crates/tower-api/src/models/acknowledge_all_alerts_response.rs +++ b/crates/tower-api/src/models/acknowledge_all_alerts_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/alert.rs b/crates/tower-api/src/models/alert.rs index 157d6ab4..75730c51 100644 --- a/crates/tower-api/src/models/alert.rs +++ b/crates/tower-api/src/models/alert.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/api_key.rs b/crates/tower-api/src/models/api_key.rs index e5d8ef58..0a567079 100644 --- a/crates/tower-api/src/models/api_key.rs +++ b/crates/tower-api/src/models/api_key.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/app.rs b/crates/tower-api/src/models/app.rs index 2a8d2902..acb0cc53 100644 --- a/crates/tower-api/src/models/app.rs +++ b/crates/tower-api/src/models/app.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/app_statistics.rs b/crates/tower-api/src/models/app_statistics.rs index 728d757d..bbff9fac 100644 --- a/crates/tower-api/src/models/app_statistics.rs +++ b/crates/tower-api/src/models/app_statistics.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/app_summary.rs b/crates/tower-api/src/models/app_summary.rs index ae4babb2..e131bed8 100644 --- a/crates/tower-api/src/models/app_summary.rs +++ b/crates/tower-api/src/models/app_summary.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/app_version.rs b/crates/tower-api/src/models/app_version.rs index c7a2197a..9a32f9fe 100644 --- a/crates/tower-api/src/models/app_version.rs +++ b/crates/tower-api/src/models/app_version.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/batch_schedule_params.rs b/crates/tower-api/src/models/batch_schedule_params.rs new file mode 100644 index 00000000..af7b5a2a --- /dev/null +++ b/crates/tower-api/src/models/batch_schedule_params.rs @@ -0,0 +1,32 @@ +/* + * Tower API + * + * REST API to interact with Tower Services. + * + * The version of the OpenAPI document: v0.7.14 + * Contact: hello@tower.dev + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize, Deserializer}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BatchScheduleParams { + /// A URL to the JSON Schema for this object. + #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] + pub schema: Option, + /// The IDs of the schedules to modify + #[serde(rename = "ids")] + pub ids: Vec, +} + +impl BatchScheduleParams { + pub fn new(ids: Vec) -> BatchScheduleParams { + BatchScheduleParams { + schema: None, + ids, + } + } +} + diff --git a/crates/tower-api/src/models/batch_schedule_response.rs b/crates/tower-api/src/models/batch_schedule_response.rs new file mode 100644 index 00000000..649abcf3 --- /dev/null +++ b/crates/tower-api/src/models/batch_schedule_response.rs @@ -0,0 +1,31 @@ +/* + * Tower API + * + * REST API to interact with Tower Services. + * + * The version of the OpenAPI document: v0.7.14 + * Contact: hello@tower.dev + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize, Deserializer}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BatchScheduleResponse { + /// A URL to the JSON Schema for this object. + #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] + pub schema: Option, + #[serde(rename = "schedules")] + pub schedules: Vec, +} + +impl BatchScheduleResponse { + pub fn new(schedules: Vec) -> BatchScheduleResponse { + BatchScheduleResponse { + schema: None, + schedules, + } + } +} + diff --git a/crates/tower-api/src/models/cancel_run_response.rs b/crates/tower-api/src/models/cancel_run_response.rs index 6d735d20..9112db17 100644 --- a/crates/tower-api/src/models/cancel_run_response.rs +++ b/crates/tower-api/src/models/cancel_run_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/catalog.rs b/crates/tower-api/src/models/catalog.rs index 36c13e3e..7b7356e2 100644 --- a/crates/tower-api/src/models/catalog.rs +++ b/crates/tower-api/src/models/catalog.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/catalog_property.rs b/crates/tower-api/src/models/catalog_property.rs index 060628a9..0ed1a2d6 100644 --- a/crates/tower-api/src/models/catalog_property.rs +++ b/crates/tower-api/src/models/catalog_property.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/claim_device_login_ticket_params.rs b/crates/tower-api/src/models/claim_device_login_ticket_params.rs index 9fc3ae6b..59340fed 100644 --- a/crates/tower-api/src/models/claim_device_login_ticket_params.rs +++ b/crates/tower-api/src/models/claim_device_login_ticket_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/claim_device_login_ticket_response.rs b/crates/tower-api/src/models/claim_device_login_ticket_response.rs index 6472c83a..ef728bc2 100644 --- a/crates/tower-api/src/models/claim_device_login_ticket_response.rs +++ b/crates/tower-api/src/models/claim_device_login_ticket_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_account_params.rs b/crates/tower-api/src/models/create_account_params.rs index 3c3b76e5..4d599ad5 100644 --- a/crates/tower-api/src/models/create_account_params.rs +++ b/crates/tower-api/src/models/create_account_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_account_params_flags_struct.rs b/crates/tower-api/src/models/create_account_params_flags_struct.rs index 27fa015e..66d88f78 100644 --- a/crates/tower-api/src/models/create_account_params_flags_struct.rs +++ b/crates/tower-api/src/models/create_account_params_flags_struct.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_account_response.rs b/crates/tower-api/src/models/create_account_response.rs index 74338a91..7263d9fb 100644 --- a/crates/tower-api/src/models/create_account_response.rs +++ b/crates/tower-api/src/models/create_account_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_api_key_params.rs b/crates/tower-api/src/models/create_api_key_params.rs index c90cb64b..dc1efe4f 100644 --- a/crates/tower-api/src/models/create_api_key_params.rs +++ b/crates/tower-api/src/models/create_api_key_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_api_key_response.rs b/crates/tower-api/src/models/create_api_key_response.rs index 28d901ae..6657c014 100644 --- a/crates/tower-api/src/models/create_api_key_response.rs +++ b/crates/tower-api/src/models/create_api_key_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_app_params.rs b/crates/tower-api/src/models/create_app_params.rs index 2c00d377..d8f39cb8 100644 --- a/crates/tower-api/src/models/create_app_params.rs +++ b/crates/tower-api/src/models/create_app_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_app_response.rs b/crates/tower-api/src/models/create_app_response.rs index 3197127c..8107ef5d 100644 --- a/crates/tower-api/src/models/create_app_response.rs +++ b/crates/tower-api/src/models/create_app_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_authenticator_params.rs b/crates/tower-api/src/models/create_authenticator_params.rs index 56ef643a..e797bdb6 100644 --- a/crates/tower-api/src/models/create_authenticator_params.rs +++ b/crates/tower-api/src/models/create_authenticator_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_authenticator_response.rs b/crates/tower-api/src/models/create_authenticator_response.rs index cf3d2019..767db085 100644 --- a/crates/tower-api/src/models/create_authenticator_response.rs +++ b/crates/tower-api/src/models/create_authenticator_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_catalog_params.rs b/crates/tower-api/src/models/create_catalog_params.rs index 5124a0fb..aa9f6915 100644 --- a/crates/tower-api/src/models/create_catalog_params.rs +++ b/crates/tower-api/src/models/create_catalog_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_catalog_response.rs b/crates/tower-api/src/models/create_catalog_response.rs index c4cae940..b4eec7ba 100644 --- a/crates/tower-api/src/models/create_catalog_response.rs +++ b/crates/tower-api/src/models/create_catalog_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_device_login_ticket_response.rs b/crates/tower-api/src/models/create_device_login_ticket_response.rs index 901060b8..e4ab6a9f 100644 --- a/crates/tower-api/src/models/create_device_login_ticket_response.rs +++ b/crates/tower-api/src/models/create_device_login_ticket_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_environment_params.rs b/crates/tower-api/src/models/create_environment_params.rs index d02901cd..3f192f72 100644 --- a/crates/tower-api/src/models/create_environment_params.rs +++ b/crates/tower-api/src/models/create_environment_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_environment_response.rs b/crates/tower-api/src/models/create_environment_response.rs index 07e55c34..cbdca25f 100644 --- a/crates/tower-api/src/models/create_environment_response.rs +++ b/crates/tower-api/src/models/create_environment_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_password_reset_params.rs b/crates/tower-api/src/models/create_password_reset_params.rs index 5b519ab3..3b8e948d 100644 --- a/crates/tower-api/src/models/create_password_reset_params.rs +++ b/crates/tower-api/src/models/create_password_reset_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_password_reset_response.rs b/crates/tower-api/src/models/create_password_reset_response.rs index 72742b65..866b1761 100644 --- a/crates/tower-api/src/models/create_password_reset_response.rs +++ b/crates/tower-api/src/models/create_password_reset_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_schedule_params.rs b/crates/tower-api/src/models/create_schedule_params.rs index 541f1fcb..acb77d74 100644 --- a/crates/tower-api/src/models/create_schedule_params.rs +++ b/crates/tower-api/src/models/create_schedule_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -31,6 +31,9 @@ pub struct CreateScheduleParams { /// Parameters to pass when running the app #[serde(rename = "parameters", skip_serializing_if = "Option::is_none")] pub parameters: Option>, + /// The status of the schedule (defaults to active) + #[serde(rename = "status", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub status: Option>, } impl CreateScheduleParams { @@ -42,6 +45,38 @@ impl CreateScheduleParams { cron, environment: None, parameters: None, + status: None, + } + } +} +/// The status of the schedule (defaults to active) +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize)] +pub enum Status { + #[serde(rename = "active")] + Active, + #[serde(rename = "disabled")] + Disabled, +} + +impl Default for Status { + fn default() -> Status { + Self::Active + } +} + +impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + match s.to_lowercase().as_str() { + "active" => Ok(Self::Active), + "disabled" => Ok(Self::Disabled), + _ => Err(serde::de::Error::unknown_variant( + &s, + &["active", "disabled"], + )), } } } diff --git a/crates/tower-api/src/models/create_schedule_response.rs b/crates/tower-api/src/models/create_schedule_response.rs index 2d1e230a..242c3828 100644 --- a/crates/tower-api/src/models/create_schedule_response.rs +++ b/crates/tower-api/src/models/create_schedule_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_secret_params.rs b/crates/tower-api/src/models/create_secret_params.rs index 1602a465..b6f722da 100644 --- a/crates/tower-api/src/models/create_secret_params.rs +++ b/crates/tower-api/src/models/create_secret_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_secret_response.rs b/crates/tower-api/src/models/create_secret_response.rs index b0be1822..12282957 100644 --- a/crates/tower-api/src/models/create_secret_response.rs +++ b/crates/tower-api/src/models/create_secret_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_session_params.rs b/crates/tower-api/src/models/create_session_params.rs index a860b8ff..a496fa15 100644 --- a/crates/tower-api/src/models/create_session_params.rs +++ b/crates/tower-api/src/models/create_session_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_session_response.rs b/crates/tower-api/src/models/create_session_response.rs index 3931cd71..11bda0a5 100644 --- a/crates/tower-api/src/models/create_session_response.rs +++ b/crates/tower-api/src/models/create_session_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_team_params.rs b/crates/tower-api/src/models/create_team_params.rs index 7e4d2c8d..2e7220e7 100644 --- a/crates/tower-api/src/models/create_team_params.rs +++ b/crates/tower-api/src/models/create_team_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_team_response.rs b/crates/tower-api/src/models/create_team_response.rs index 01a7c3d2..d3859514 100644 --- a/crates/tower-api/src/models/create_team_response.rs +++ b/crates/tower-api/src/models/create_team_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_api_key_params.rs b/crates/tower-api/src/models/delete_api_key_params.rs index 066edc27..86a1b8da 100644 --- a/crates/tower-api/src/models/delete_api_key_params.rs +++ b/crates/tower-api/src/models/delete_api_key_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_api_key_response.rs b/crates/tower-api/src/models/delete_api_key_response.rs index e6c743b8..788dccfb 100644 --- a/crates/tower-api/src/models/delete_api_key_response.rs +++ b/crates/tower-api/src/models/delete_api_key_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_app_response.rs b/crates/tower-api/src/models/delete_app_response.rs index 2b73e560..88411ad7 100644 --- a/crates/tower-api/src/models/delete_app_response.rs +++ b/crates/tower-api/src/models/delete_app_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_authenticator_params.rs b/crates/tower-api/src/models/delete_authenticator_params.rs index 237b9a5a..38a779fa 100644 --- a/crates/tower-api/src/models/delete_authenticator_params.rs +++ b/crates/tower-api/src/models/delete_authenticator_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_authenticator_response.rs b/crates/tower-api/src/models/delete_authenticator_response.rs index 17ce8c51..3c8889c0 100644 --- a/crates/tower-api/src/models/delete_authenticator_response.rs +++ b/crates/tower-api/src/models/delete_authenticator_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_catalog_response.rs b/crates/tower-api/src/models/delete_catalog_response.rs index 36c74033..f1c7ee36 100644 --- a/crates/tower-api/src/models/delete_catalog_response.rs +++ b/crates/tower-api/src/models/delete_catalog_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_schedule_params.rs b/crates/tower-api/src/models/delete_schedule_params.rs index 1dadc175..24fa02b3 100644 --- a/crates/tower-api/src/models/delete_schedule_params.rs +++ b/crates/tower-api/src/models/delete_schedule_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_schedule_response.rs b/crates/tower-api/src/models/delete_schedule_response.rs index 908f6bec..cfe1b4e0 100644 --- a/crates/tower-api/src/models/delete_schedule_response.rs +++ b/crates/tower-api/src/models/delete_schedule_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_secret_response.rs b/crates/tower-api/src/models/delete_secret_response.rs index 901e2f0b..99d95c5a 100644 --- a/crates/tower-api/src/models/delete_secret_response.rs +++ b/crates/tower-api/src/models/delete_secret_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_team_invitation_params.rs b/crates/tower-api/src/models/delete_team_invitation_params.rs index 575d7a19..1576241c 100644 --- a/crates/tower-api/src/models/delete_team_invitation_params.rs +++ b/crates/tower-api/src/models/delete_team_invitation_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_team_invitation_response.rs b/crates/tower-api/src/models/delete_team_invitation_response.rs index b41156fb..9030d9ad 100644 --- a/crates/tower-api/src/models/delete_team_invitation_response.rs +++ b/crates/tower-api/src/models/delete_team_invitation_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_team_params.rs b/crates/tower-api/src/models/delete_team_params.rs index 8273962e..e64f3df3 100644 --- a/crates/tower-api/src/models/delete_team_params.rs +++ b/crates/tower-api/src/models/delete_team_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_team_response.rs b/crates/tower-api/src/models/delete_team_response.rs index f18e22a5..b289bce5 100644 --- a/crates/tower-api/src/models/delete_team_response.rs +++ b/crates/tower-api/src/models/delete_team_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/deploy_app_response.rs b/crates/tower-api/src/models/deploy_app_response.rs index 626a301c..315b71c9 100644 --- a/crates/tower-api/src/models/deploy_app_response.rs +++ b/crates/tower-api/src/models/deploy_app_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_app_response.rs b/crates/tower-api/src/models/describe_app_response.rs index 3a67cb69..203146f1 100644 --- a/crates/tower-api/src/models/describe_app_response.rs +++ b/crates/tower-api/src/models/describe_app_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_app_version_response.rs b/crates/tower-api/src/models/describe_app_version_response.rs index b14a533b..0834b9cb 100644 --- a/crates/tower-api/src/models/describe_app_version_response.rs +++ b/crates/tower-api/src/models/describe_app_version_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_device_login_session_response.rs b/crates/tower-api/src/models/describe_device_login_session_response.rs index 6890401c..c0c4ba70 100644 --- a/crates/tower-api/src/models/describe_device_login_session_response.rs +++ b/crates/tower-api/src/models/describe_device_login_session_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_run_logs_response.rs b/crates/tower-api/src/models/describe_run_logs_response.rs index cf5990f0..2077b212 100644 --- a/crates/tower-api/src/models/describe_run_logs_response.rs +++ b/crates/tower-api/src/models/describe_run_logs_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_run_response.rs b/crates/tower-api/src/models/describe_run_response.rs index 4a0a2c0d..400a99d6 100644 --- a/crates/tower-api/src/models/describe_run_response.rs +++ b/crates/tower-api/src/models/describe_run_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_secrets_key_response.rs b/crates/tower-api/src/models/describe_secrets_key_response.rs index f9d11b6f..e6ee868d 100644 --- a/crates/tower-api/src/models/describe_secrets_key_response.rs +++ b/crates/tower-api/src/models/describe_secrets_key_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_session_response.rs b/crates/tower-api/src/models/describe_session_response.rs index 48d9a1ac..593a4717 100644 --- a/crates/tower-api/src/models/describe_session_response.rs +++ b/crates/tower-api/src/models/describe_session_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/encrypted_catalog_property.rs b/crates/tower-api/src/models/encrypted_catalog_property.rs index 7e7efa99..1b07ac8f 100644 --- a/crates/tower-api/src/models/encrypted_catalog_property.rs +++ b/crates/tower-api/src/models/encrypted_catalog_property.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/environment.rs b/crates/tower-api/src/models/environment.rs index 1cecfbbc..0ac603fd 100644 --- a/crates/tower-api/src/models/environment.rs +++ b/crates/tower-api/src/models/environment.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/error_detail.rs b/crates/tower-api/src/models/error_detail.rs index 6a150076..20c24364 100644 --- a/crates/tower-api/src/models/error_detail.rs +++ b/crates/tower-api/src/models/error_detail.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/error_model.rs b/crates/tower-api/src/models/error_model.rs index 92049d6b..b76939cd 100644 --- a/crates/tower-api/src/models/error_model.rs +++ b/crates/tower-api/src/models/error_model.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/event_error.rs b/crates/tower-api/src/models/event_error.rs index 82adf867..14818ef6 100644 --- a/crates/tower-api/src/models/event_error.rs +++ b/crates/tower-api/src/models/event_error.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/event_log.rs b/crates/tower-api/src/models/event_log.rs index 9910c181..840a5be2 100644 --- a/crates/tower-api/src/models/event_log.rs +++ b/crates/tower-api/src/models/event_log.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/event_run_failure_alert.rs b/crates/tower-api/src/models/event_run_failure_alert.rs index a2ce19e1..ef5b88d7 100644 --- a/crates/tower-api/src/models/event_run_failure_alert.rs +++ b/crates/tower-api/src/models/event_run_failure_alert.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/event_warning.rs b/crates/tower-api/src/models/event_warning.rs index 33a1fe0c..70a4b90d 100644 --- a/crates/tower-api/src/models/event_warning.rs +++ b/crates/tower-api/src/models/event_warning.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/export_catalogs_params.rs b/crates/tower-api/src/models/export_catalogs_params.rs index 666a6a15..9a464b9d 100644 --- a/crates/tower-api/src/models/export_catalogs_params.rs +++ b/crates/tower-api/src/models/export_catalogs_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/export_catalogs_response.rs b/crates/tower-api/src/models/export_catalogs_response.rs index c5229fc3..fa16b5c7 100644 --- a/crates/tower-api/src/models/export_catalogs_response.rs +++ b/crates/tower-api/src/models/export_catalogs_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/export_secrets_params.rs b/crates/tower-api/src/models/export_secrets_params.rs index 93344a90..3724c7f4 100644 --- a/crates/tower-api/src/models/export_secrets_params.rs +++ b/crates/tower-api/src/models/export_secrets_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/export_secrets_response.rs b/crates/tower-api/src/models/export_secrets_response.rs index bcda8474..20c93306 100644 --- a/crates/tower-api/src/models/export_secrets_response.rs +++ b/crates/tower-api/src/models/export_secrets_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/exported_catalog.rs b/crates/tower-api/src/models/exported_catalog.rs index 492d9b7c..ef859d7e 100644 --- a/crates/tower-api/src/models/exported_catalog.rs +++ b/crates/tower-api/src/models/exported_catalog.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/exported_catalog_property.rs b/crates/tower-api/src/models/exported_catalog_property.rs index 2771216a..28c0636c 100644 --- a/crates/tower-api/src/models/exported_catalog_property.rs +++ b/crates/tower-api/src/models/exported_catalog_property.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/exported_secret.rs b/crates/tower-api/src/models/exported_secret.rs index bcd6a6b9..a629ac2a 100644 --- a/crates/tower-api/src/models/exported_secret.rs +++ b/crates/tower-api/src/models/exported_secret.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/featurebase_identity.rs b/crates/tower-api/src/models/featurebase_identity.rs index c35e901b..925c27c1 100644 --- a/crates/tower-api/src/models/featurebase_identity.rs +++ b/crates/tower-api/src/models/featurebase_identity.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/features.rs b/crates/tower-api/src/models/features.rs index 88a51a29..c4d5ec7d 100644 --- a/crates/tower-api/src/models/features.rs +++ b/crates/tower-api/src/models/features.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/generate_app_statistics_response.rs b/crates/tower-api/src/models/generate_app_statistics_response.rs index d6022344..046e3a52 100644 --- a/crates/tower-api/src/models/generate_app_statistics_response.rs +++ b/crates/tower-api/src/models/generate_app_statistics_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/generate_authenticator_response.rs b/crates/tower-api/src/models/generate_authenticator_response.rs index 9b2ec9d4..3b183e0a 100644 --- a/crates/tower-api/src/models/generate_authenticator_response.rs +++ b/crates/tower-api/src/models/generate_authenticator_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/generate_run_statistics_response.rs b/crates/tower-api/src/models/generate_run_statistics_response.rs index 723c0911..e86ec218 100644 --- a/crates/tower-api/src/models/generate_run_statistics_response.rs +++ b/crates/tower-api/src/models/generate_run_statistics_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/generate_runner_credentials_response.rs b/crates/tower-api/src/models/generate_runner_credentials_response.rs index 13f13780..8bc45985 100644 --- a/crates/tower-api/src/models/generate_runner_credentials_response.rs +++ b/crates/tower-api/src/models/generate_runner_credentials_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/get_feature_flag_response_body.rs b/crates/tower-api/src/models/get_feature_flag_response_body.rs index 8dd48cfc..d73ef0c9 100644 --- a/crates/tower-api/src/models/get_feature_flag_response_body.rs +++ b/crates/tower-api/src/models/get_feature_flag_response_body.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/invite_team_member_params.rs b/crates/tower-api/src/models/invite_team_member_params.rs index b9104567..3ef4066b 100644 --- a/crates/tower-api/src/models/invite_team_member_params.rs +++ b/crates/tower-api/src/models/invite_team_member_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/invite_team_member_response.rs b/crates/tower-api/src/models/invite_team_member_response.rs index 9299a746..46fd7901 100644 --- a/crates/tower-api/src/models/invite_team_member_response.rs +++ b/crates/tower-api/src/models/invite_team_member_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/leave_team_response.rs b/crates/tower-api/src/models/leave_team_response.rs index 289873cd..2091eff1 100644 --- a/crates/tower-api/src/models/leave_team_response.rs +++ b/crates/tower-api/src/models/leave_team_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_account_plans_response.rs b/crates/tower-api/src/models/list_account_plans_response.rs index 11b7c256..cd419f84 100644 --- a/crates/tower-api/src/models/list_account_plans_response.rs +++ b/crates/tower-api/src/models/list_account_plans_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_alerts_200_response.rs b/crates/tower-api/src/models/list_alerts_200_response.rs index 4947ff23..844863cb 100644 --- a/crates/tower-api/src/models/list_alerts_200_response.rs +++ b/crates/tower-api/src/models/list_alerts_200_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_alerts_response.rs b/crates/tower-api/src/models/list_alerts_response.rs index f1318949..5d1e21b6 100644 --- a/crates/tower-api/src/models/list_alerts_response.rs +++ b/crates/tower-api/src/models/list_alerts_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_api_keys_response.rs b/crates/tower-api/src/models/list_api_keys_response.rs index d17b19b7..6ae6ff80 100644 --- a/crates/tower-api/src/models/list_api_keys_response.rs +++ b/crates/tower-api/src/models/list_api_keys_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_app_environments_response.rs b/crates/tower-api/src/models/list_app_environments_response.rs index dd7c3e5a..14ca1351 100644 --- a/crates/tower-api/src/models/list_app_environments_response.rs +++ b/crates/tower-api/src/models/list_app_environments_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_app_versions_response.rs b/crates/tower-api/src/models/list_app_versions_response.rs index 2bfd533a..bef18fd2 100644 --- a/crates/tower-api/src/models/list_app_versions_response.rs +++ b/crates/tower-api/src/models/list_app_versions_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_apps_response.rs b/crates/tower-api/src/models/list_apps_response.rs index c5984671..48ac73aa 100644 --- a/crates/tower-api/src/models/list_apps_response.rs +++ b/crates/tower-api/src/models/list_apps_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_authenticators_response.rs b/crates/tower-api/src/models/list_authenticators_response.rs index 164b0be4..61d462ff 100644 --- a/crates/tower-api/src/models/list_authenticators_response.rs +++ b/crates/tower-api/src/models/list_authenticators_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_catalogs_response.rs b/crates/tower-api/src/models/list_catalogs_response.rs index 38e61d82..5cd80a07 100644 --- a/crates/tower-api/src/models/list_catalogs_response.rs +++ b/crates/tower-api/src/models/list_catalogs_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_environments_response.rs b/crates/tower-api/src/models/list_environments_response.rs index c493c590..feb32776 100644 --- a/crates/tower-api/src/models/list_environments_response.rs +++ b/crates/tower-api/src/models/list_environments_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_my_team_invitations_response.rs b/crates/tower-api/src/models/list_my_team_invitations_response.rs index 31fc2ed8..4fd57045 100644 --- a/crates/tower-api/src/models/list_my_team_invitations_response.rs +++ b/crates/tower-api/src/models/list_my_team_invitations_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_runs_response.rs b/crates/tower-api/src/models/list_runs_response.rs index b83b2fde..4dffdaaf 100644 --- a/crates/tower-api/src/models/list_runs_response.rs +++ b/crates/tower-api/src/models/list_runs_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_schedules_response.rs b/crates/tower-api/src/models/list_schedules_response.rs index e33cb4aa..59520d2a 100644 --- a/crates/tower-api/src/models/list_schedules_response.rs +++ b/crates/tower-api/src/models/list_schedules_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_secret_environments_response.rs b/crates/tower-api/src/models/list_secret_environments_response.rs index 301ad17f..4a8ec5dd 100644 --- a/crates/tower-api/src/models/list_secret_environments_response.rs +++ b/crates/tower-api/src/models/list_secret_environments_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_secrets_response.rs b/crates/tower-api/src/models/list_secrets_response.rs index 10b68717..76d5843f 100644 --- a/crates/tower-api/src/models/list_secrets_response.rs +++ b/crates/tower-api/src/models/list_secrets_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_team_invitations_response.rs b/crates/tower-api/src/models/list_team_invitations_response.rs index a24b3597..95ad0974 100644 --- a/crates/tower-api/src/models/list_team_invitations_response.rs +++ b/crates/tower-api/src/models/list_team_invitations_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_team_members_response.rs b/crates/tower-api/src/models/list_team_members_response.rs index 1ce31d96..057d55ea 100644 --- a/crates/tower-api/src/models/list_team_members_response.rs +++ b/crates/tower-api/src/models/list_team_members_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_teams_response.rs b/crates/tower-api/src/models/list_teams_response.rs index 4e22edae..8486d06a 100644 --- a/crates/tower-api/src/models/list_teams_response.rs +++ b/crates/tower-api/src/models/list_teams_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/mod.rs b/crates/tower-api/src/models/mod.rs index 4ed36ee9..972326ca 100644 --- a/crates/tower-api/src/models/mod.rs +++ b/crates/tower-api/src/models/mod.rs @@ -16,6 +16,10 @@ pub mod app_summary; pub use self::app_summary::AppSummary; pub mod app_version; pub use self::app_version::AppVersion; +pub mod batch_schedule_params; +pub use self::batch_schedule_params::BatchScheduleParams; +pub mod batch_schedule_response; +pub use self::batch_schedule_response::BatchScheduleResponse; pub mod cancel_run_response; pub use self::cancel_run_response::CancelRunResponse; pub mod catalog; diff --git a/crates/tower-api/src/models/pagination.rs b/crates/tower-api/src/models/pagination.rs index a8ab57e2..07594ca5 100644 --- a/crates/tower-api/src/models/pagination.rs +++ b/crates/tower-api/src/models/pagination.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/parameter.rs b/crates/tower-api/src/models/parameter.rs index 85b4a85c..02fad939 100644 --- a/crates/tower-api/src/models/parameter.rs +++ b/crates/tower-api/src/models/parameter.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/plan.rs b/crates/tower-api/src/models/plan.rs index e1ac8e01..ff8ab8a5 100644 --- a/crates/tower-api/src/models/plan.rs +++ b/crates/tower-api/src/models/plan.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/refresh_session_params.rs b/crates/tower-api/src/models/refresh_session_params.rs index 95af5b6c..6cf6926d 100644 --- a/crates/tower-api/src/models/refresh_session_params.rs +++ b/crates/tower-api/src/models/refresh_session_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/refresh_session_response.rs b/crates/tower-api/src/models/refresh_session_response.rs index c01ec2c0..bcad7d1c 100644 --- a/crates/tower-api/src/models/refresh_session_response.rs +++ b/crates/tower-api/src/models/refresh_session_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/remove_team_member_params.rs b/crates/tower-api/src/models/remove_team_member_params.rs index f51d4f52..bb718d04 100644 --- a/crates/tower-api/src/models/remove_team_member_params.rs +++ b/crates/tower-api/src/models/remove_team_member_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/remove_team_member_response.rs b/crates/tower-api/src/models/remove_team_member_response.rs index d6c0dcb4..7b865956 100644 --- a/crates/tower-api/src/models/remove_team_member_response.rs +++ b/crates/tower-api/src/models/remove_team_member_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/resend_team_invitation_params.rs b/crates/tower-api/src/models/resend_team_invitation_params.rs index 278e78c2..8663b5f0 100644 --- a/crates/tower-api/src/models/resend_team_invitation_params.rs +++ b/crates/tower-api/src/models/resend_team_invitation_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/resend_team_invitation_response.rs b/crates/tower-api/src/models/resend_team_invitation_response.rs index 1185a4b7..f01b044b 100644 --- a/crates/tower-api/src/models/resend_team_invitation_response.rs +++ b/crates/tower-api/src/models/resend_team_invitation_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run.rs b/crates/tower-api/src/models/run.rs index b733bae6..ede4e856 100644 --- a/crates/tower-api/src/models/run.rs +++ b/crates/tower-api/src/models/run.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -34,6 +34,9 @@ pub struct Run { /// Exit code of the run, if the run is completed. Null if there is no exit code #[serde(rename = "exit_code", deserialize_with = "Option::deserialize")] pub exit_code: Option, + /// If app is externally accessible, then you can access this run with this hostname + #[serde(rename = "hostname", skip_serializing_if = "Option::is_none")] + pub hostname: Option, #[serde(rename = "number")] pub number: i64, /// Parameters used to invoke this run. @@ -63,6 +66,7 @@ impl Run { ended_at, environment, exit_code, + hostname: None, number, parameters, run_id, diff --git a/crates/tower-api/src/models/run_app_params.rs b/crates/tower-api/src/models/run_app_params.rs index cafe3384..c0a1eca2 100644 --- a/crates/tower-api/src/models/run_app_params.rs +++ b/crates/tower-api/src/models/run_app_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_app_response.rs b/crates/tower-api/src/models/run_app_response.rs index 486c2506..a0344761 100644 --- a/crates/tower-api/src/models/run_app_response.rs +++ b/crates/tower-api/src/models/run_app_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_failure_alert.rs b/crates/tower-api/src/models/run_failure_alert.rs index 97edeee8..306dcce7 100644 --- a/crates/tower-api/src/models/run_failure_alert.rs +++ b/crates/tower-api/src/models/run_failure_alert.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_log_line.rs b/crates/tower-api/src/models/run_log_line.rs index 9ea5666f..6c2e52fd 100644 --- a/crates/tower-api/src/models/run_log_line.rs +++ b/crates/tower-api/src/models/run_log_line.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_parameter.rs b/crates/tower-api/src/models/run_parameter.rs index 5d562d38..6f9fc1e4 100644 --- a/crates/tower-api/src/models/run_parameter.rs +++ b/crates/tower-api/src/models/run_parameter.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_results.rs b/crates/tower-api/src/models/run_results.rs index 73c14bd2..80895666 100644 --- a/crates/tower-api/src/models/run_results.rs +++ b/crates/tower-api/src/models/run_results.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_statistics.rs b/crates/tower-api/src/models/run_statistics.rs index 7de078c8..7e39682a 100644 --- a/crates/tower-api/src/models/run_statistics.rs +++ b/crates/tower-api/src/models/run_statistics.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_timeseries_point.rs b/crates/tower-api/src/models/run_timeseries_point.rs index 05da0286..814ddb33 100644 --- a/crates/tower-api/src/models/run_timeseries_point.rs +++ b/crates/tower-api/src/models/run_timeseries_point.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/runner_credentials.rs b/crates/tower-api/src/models/runner_credentials.rs index 9b37d155..f282360a 100644 --- a/crates/tower-api/src/models/runner_credentials.rs +++ b/crates/tower-api/src/models/runner_credentials.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/schedule.rs b/crates/tower-api/src/models/schedule.rs index 7b493d98..2365e80c 100644 --- a/crates/tower-api/src/models/schedule.rs +++ b/crates/tower-api/src/models/schedule.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -34,13 +34,16 @@ pub struct Schedule { /// The parameters to pass when running the app #[serde(rename = "parameters", skip_serializing_if = "Option::is_none")] pub parameters: Option>, + /// The status of the schedule + #[serde(rename = "status")] + pub status: Status, /// The timestamp when the schedule was last updated #[serde(rename = "updated_at")] pub updated_at: String, } impl Schedule { - pub fn new(app_name: String, created_at: String, cron: String, environment: String, id: String, updated_at: String) -> Schedule { + pub fn new(app_name: String, created_at: String, cron: String, environment: String, id: String, status: Status, updated_at: String) -> Schedule { Schedule { app_name, app_version: None, @@ -49,8 +52,40 @@ impl Schedule { environment, id, parameters: None, + status, updated_at, } } } +/// The status of the schedule +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize)] +pub enum Status { + #[serde(rename = "active")] + Active, + #[serde(rename = "disabled")] + Disabled, +} + +impl Default for Status { + fn default() -> Status { + Self::Active + } +} + +impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + match s.to_lowercase().as_str() { + "active" => Ok(Self::Active), + "disabled" => Ok(Self::Disabled), + _ => Err(serde::de::Error::unknown_variant( + &s, + &["active", "disabled"], + )), + } + } +} diff --git a/crates/tower-api/src/models/search_runs_response.rs b/crates/tower-api/src/models/search_runs_response.rs index d05150c5..a030a76f 100644 --- a/crates/tower-api/src/models/search_runs_response.rs +++ b/crates/tower-api/src/models/search_runs_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/secret.rs b/crates/tower-api/src/models/secret.rs index 6e3c6865..f2ea0c0f 100644 --- a/crates/tower-api/src/models/secret.rs +++ b/crates/tower-api/src/models/secret.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/session.rs b/crates/tower-api/src/models/session.rs index c8e45ef9..cc622f9e 100644 --- a/crates/tower-api/src/models/session.rs +++ b/crates/tower-api/src/models/session.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/sse_warning.rs b/crates/tower-api/src/models/sse_warning.rs index fe40b2d9..9b5f93c0 100644 --- a/crates/tower-api/src/models/sse_warning.rs +++ b/crates/tower-api/src/models/sse_warning.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/statistics_settings.rs b/crates/tower-api/src/models/statistics_settings.rs index fa7b4e72..b527b73e 100644 --- a/crates/tower-api/src/models/statistics_settings.rs +++ b/crates/tower-api/src/models/statistics_settings.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/stream_alerts_200_response_inner.rs b/crates/tower-api/src/models/stream_alerts_200_response_inner.rs index cab6d9ac..41e15d95 100644 --- a/crates/tower-api/src/models/stream_alerts_200_response_inner.rs +++ b/crates/tower-api/src/models/stream_alerts_200_response_inner.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/stream_run_logs_200_response_inner.rs b/crates/tower-api/src/models/stream_run_logs_200_response_inner.rs index db6797ae..91ea82b6 100644 --- a/crates/tower-api/src/models/stream_run_logs_200_response_inner.rs +++ b/crates/tower-api/src/models/stream_run_logs_200_response_inner.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/team.rs b/crates/tower-api/src/models/team.rs index 29d23d8f..5f128894 100644 --- a/crates/tower-api/src/models/team.rs +++ b/crates/tower-api/src/models/team.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/team_invitation.rs b/crates/tower-api/src/models/team_invitation.rs index 2fbe1e9b..0a284cc5 100644 --- a/crates/tower-api/src/models/team_invitation.rs +++ b/crates/tower-api/src/models/team_invitation.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/token.rs b/crates/tower-api/src/models/token.rs index 3d15106e..029f4b37 100644 --- a/crates/tower-api/src/models/token.rs +++ b/crates/tower-api/src/models/token.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/unverified_authenticator.rs b/crates/tower-api/src/models/unverified_authenticator.rs index 6362ffca..53cc0394 100644 --- a/crates/tower-api/src/models/unverified_authenticator.rs +++ b/crates/tower-api/src/models/unverified_authenticator.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_account_name_params.rs b/crates/tower-api/src/models/update_account_name_params.rs index 72e1b243..5b6cd762 100644 --- a/crates/tower-api/src/models/update_account_name_params.rs +++ b/crates/tower-api/src/models/update_account_name_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_account_name_response.rs b/crates/tower-api/src/models/update_account_name_response.rs index 4f49e3b9..4ead217e 100644 --- a/crates/tower-api/src/models/update_account_name_response.rs +++ b/crates/tower-api/src/models/update_account_name_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_app_params.rs b/crates/tower-api/src/models/update_app_params.rs index 78c6c3e4..45c46ee6 100644 --- a/crates/tower-api/src/models/update_app_params.rs +++ b/crates/tower-api/src/models/update_app_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_app_response.rs b/crates/tower-api/src/models/update_app_response.rs index 4fcd7db4..294dbff7 100644 --- a/crates/tower-api/src/models/update_app_response.rs +++ b/crates/tower-api/src/models/update_app_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_catalog_params.rs b/crates/tower-api/src/models/update_catalog_params.rs index 59a3d330..a7460387 100644 --- a/crates/tower-api/src/models/update_catalog_params.rs +++ b/crates/tower-api/src/models/update_catalog_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_catalog_response.rs b/crates/tower-api/src/models/update_catalog_response.rs index ae4b25f5..22b2efda 100644 --- a/crates/tower-api/src/models/update_catalog_response.rs +++ b/crates/tower-api/src/models/update_catalog_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_environment_params.rs b/crates/tower-api/src/models/update_environment_params.rs index 59170edc..3115a9d8 100644 --- a/crates/tower-api/src/models/update_environment_params.rs +++ b/crates/tower-api/src/models/update_environment_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_environment_response.rs b/crates/tower-api/src/models/update_environment_response.rs index dee175cd..0396508d 100644 --- a/crates/tower-api/src/models/update_environment_response.rs +++ b/crates/tower-api/src/models/update_environment_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_my_team_invitation_params.rs b/crates/tower-api/src/models/update_my_team_invitation_params.rs index a08b89fc..47afe852 100644 --- a/crates/tower-api/src/models/update_my_team_invitation_params.rs +++ b/crates/tower-api/src/models/update_my_team_invitation_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_my_team_invitation_response.rs b/crates/tower-api/src/models/update_my_team_invitation_response.rs index eb709b02..829d95bf 100644 --- a/crates/tower-api/src/models/update_my_team_invitation_response.rs +++ b/crates/tower-api/src/models/update_my_team_invitation_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_password_reset_params.rs b/crates/tower-api/src/models/update_password_reset_params.rs index 8a7d519c..af2bb38d 100644 --- a/crates/tower-api/src/models/update_password_reset_params.rs +++ b/crates/tower-api/src/models/update_password_reset_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_password_reset_response.rs b/crates/tower-api/src/models/update_password_reset_response.rs index 45ef7355..9fee2cb8 100644 --- a/crates/tower-api/src/models/update_password_reset_response.rs +++ b/crates/tower-api/src/models/update_password_reset_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_plan_params.rs b/crates/tower-api/src/models/update_plan_params.rs index 2a50883d..475ccec7 100644 --- a/crates/tower-api/src/models/update_plan_params.rs +++ b/crates/tower-api/src/models/update_plan_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_plan_response.rs b/crates/tower-api/src/models/update_plan_response.rs index bb16c5e1..dfb555c0 100644 --- a/crates/tower-api/src/models/update_plan_response.rs +++ b/crates/tower-api/src/models/update_plan_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_schedule_params.rs b/crates/tower-api/src/models/update_schedule_params.rs index 30072fd5..8046f2b5 100644 --- a/crates/tower-api/src/models/update_schedule_params.rs +++ b/crates/tower-api/src/models/update_schedule_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -28,6 +28,9 @@ pub struct UpdateScheduleParams { /// Parameters to pass when running the app #[serde(rename = "parameters", skip_serializing_if = "Option::is_none")] pub parameters: Option>, + /// The status of the schedule + #[serde(rename = "status", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub status: Option>, } impl UpdateScheduleParams { @@ -38,6 +41,38 @@ impl UpdateScheduleParams { cron: None, environment: None, parameters: None, + status: None, + } + } +} +/// The status of the schedule +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize)] +pub enum Status { + #[serde(rename = "active")] + Active, + #[serde(rename = "disabled")] + Disabled, +} + +impl Default for Status { + fn default() -> Status { + Self::Active + } +} + +impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + match s.to_lowercase().as_str() { + "active" => Ok(Self::Active), + "disabled" => Ok(Self::Disabled), + _ => Err(serde::de::Error::unknown_variant( + &s, + &["active", "disabled"], + )), } } } diff --git a/crates/tower-api/src/models/update_schedule_response.rs b/crates/tower-api/src/models/update_schedule_response.rs index 72cb6e41..d3959eba 100644 --- a/crates/tower-api/src/models/update_schedule_response.rs +++ b/crates/tower-api/src/models/update_schedule_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_secret_params.rs b/crates/tower-api/src/models/update_secret_params.rs index a187d9ed..1e7ae3f5 100644 --- a/crates/tower-api/src/models/update_secret_params.rs +++ b/crates/tower-api/src/models/update_secret_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_secret_response.rs b/crates/tower-api/src/models/update_secret_response.rs index 550734c6..1ea15cfe 100644 --- a/crates/tower-api/src/models/update_secret_response.rs +++ b/crates/tower-api/src/models/update_secret_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_team_params.rs b/crates/tower-api/src/models/update_team_params.rs index 4402d2c6..b1d07212 100644 --- a/crates/tower-api/src/models/update_team_params.rs +++ b/crates/tower-api/src/models/update_team_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_team_response.rs b/crates/tower-api/src/models/update_team_response.rs index 18d0899c..7c733174 100644 --- a/crates/tower-api/src/models/update_team_response.rs +++ b/crates/tower-api/src/models/update_team_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_user_params.rs b/crates/tower-api/src/models/update_user_params.rs index 10e2abc2..da63c603 100644 --- a/crates/tower-api/src/models/update_user_params.rs +++ b/crates/tower-api/src/models/update_user_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_user_response.rs b/crates/tower-api/src/models/update_user_response.rs index 54bff270..7ec1c1b1 100644 --- a/crates/tower-api/src/models/update_user_response.rs +++ b/crates/tower-api/src/models/update_user_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/user.rs b/crates/tower-api/src/models/user.rs index b596d3f3..f1e3775d 100644 --- a/crates/tower-api/src/models/user.rs +++ b/crates/tower-api/src/models/user.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/verified_authenticator.rs b/crates/tower-api/src/models/verified_authenticator.rs index 233b69fb..f31b0f5a 100644 --- a/crates/tower-api/src/models/verified_authenticator.rs +++ b/crates/tower-api/src/models/verified_authenticator.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/verify_email_params.rs b/crates/tower-api/src/models/verify_email_params.rs index 78d0949c..287092b3 100644 --- a/crates/tower-api/src/models/verify_email_params.rs +++ b/crates/tower-api/src/models/verify_email_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/verify_email_response.rs b/crates/tower-api/src/models/verify_email_response.rs index df9dfc6c..76a4bd9a 100644 --- a/crates/tower-api/src/models/verify_email_response.rs +++ b/crates/tower-api/src/models/verify_email_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.7.10 + * The version of the OpenAPI document: v0.7.14 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-cmd/src/api.rs b/crates/tower-cmd/src/api.rs index b47a63bb..479f812b 100644 --- a/crates/tower-cmd/src/api.rs +++ b/crates/tower-cmd/src/api.rs @@ -8,6 +8,7 @@ use tokio::sync::mpsc; use reqwest_eventsource::{Event, EventSource}; use tower_api::apis::configuration; use futures_util::StreamExt; +use tower_api::models::RunParameter; /// Helper trait to extract the successful response data from API responses pub trait ResponseEntity { @@ -571,3 +572,132 @@ impl ResponseEntity for tower_api::apis::default_api::DescribeRunSuccess { } } } + +pub async fn list_schedules(config: &Config, _app_name: Option<&str>, _environment: Option<&str>) -> Result> { + let api_config = &config.into(); + + let params = tower_api::apis::default_api::ListSchedulesParams { + page: None, + page_size: None, + }; + + unwrap_api_response(tower_api::apis::default_api::list_schedules(api_config, params)).await +} + +pub async fn create_schedule( + config: &Config, + app_name: &str, + environment: &str, + cron: &str, + parameters: Option>, +) -> Result> { + let api_config = &config.into(); + + let run_parameters = parameters.map(|params| { + params + .into_iter() + .map(|(key, value)| RunParameter { name: key, value }) + .collect() + }); + + let params = tower_api::apis::default_api::CreateScheduleParams { + create_schedule_params: tower_api::models::CreateScheduleParams { + schema: None, + app_name: app_name.to_string(), + cron: cron.to_string(), + environment: Some(environment.to_string()), + app_version: None, + parameters: run_parameters, + status: None, + }, + }; + + unwrap_api_response(tower_api::apis::default_api::create_schedule(api_config, params)).await +} + +pub async fn update_schedule( + config: &Config, + schedule_id: &str, + cron: Option<&String>, + parameters: Option>, +) -> Result> { + let api_config = &config.into(); + + let run_parameters = parameters.map(|params| { + params + .into_iter() + .map(|(key, value)| RunParameter { name: key, value }) + .collect() + }); + + let params = tower_api::apis::default_api::UpdateScheduleParams { + id: schedule_id.to_string(), + update_schedule_params: tower_api::models::UpdateScheduleParams { + schema: None, + cron: cron.map(|s| s.clone()), + environment: None, + app_version: None, + parameters: run_parameters, + status: None, + }, + }; + + unwrap_api_response(tower_api::apis::default_api::update_schedule(api_config, params)).await +} + +pub async fn delete_schedule(config: &Config, schedule_id: &str) -> Result> { + let api_config = &config.into(); + + let params = tower_api::apis::default_api::DeleteScheduleParams { + delete_schedule_params: tower_api::models::DeleteScheduleParams { + schema: None, + ids: vec![schedule_id.to_string()], + }, + }; + + unwrap_api_response(tower_api::apis::default_api::delete_schedule(api_config, params)).await +} + +impl ResponseEntity for tower_api::apis::default_api::ListSchedulesSuccess { + type Data = tower_api::models::ListSchedulesResponse; + + fn extract_data(self) -> Option { + match self { + Self::Status200(data) => Some(data), + Self::UnknownValue(_) => None, + } + } +} + +impl ResponseEntity for tower_api::apis::default_api::CreateScheduleSuccess { + type Data = tower_api::models::CreateScheduleResponse; + + fn extract_data(self) -> Option { + match self { + Self::Status201(data) => Some(data), + Self::UnknownValue(_) => None, + } + } +} + +impl ResponseEntity for tower_api::apis::default_api::UpdateScheduleSuccess { + type Data = tower_api::models::UpdateScheduleResponse; + + fn extract_data(self) -> Option { + match self { + Self::Status200(data) => Some(data), + Self::UnknownValue(_) => None, + } + } +} + +impl ResponseEntity for tower_api::apis::default_api::DeleteScheduleSuccess { + type Data = tower_api::models::DeleteScheduleResponse; + + fn extract_data(self) -> Option { + match self { + Self::Status200(data) => Some(data), + Self::UnknownValue(_) => None, + } + } +} diff --git a/crates/tower-cmd/src/lib.rs b/crates/tower-cmd/src/lib.rs index b34cb323..940cb630 100644 --- a/crates/tower-cmd/src/lib.rs +++ b/crates/tower-cmd/src/lib.rs @@ -7,6 +7,7 @@ pub mod output; pub mod api; pub mod error; mod run; +mod schedules; mod secrets; mod session; mod teams; @@ -118,6 +119,20 @@ impl App { } } } + Some(("schedules", sub_matches)) => { + let schedules_command = sub_matches.subcommand(); + + match schedules_command { + Some(("list", args)) => schedules::do_list(sessionized_config, args).await, + Some(("create", args)) => schedules::do_create(sessionized_config, args).await, + Some(("update", args)) => schedules::do_update(sessionized_config, args).await, + Some(("delete", args)) => schedules::do_delete(sessionized_config, args).await, + _ => { + schedules::schedules_cmd().print_help().unwrap(); + std::process::exit(2); + } + } + } Some(("deploy", args)) => deploy::do_deploy(sessionized_config, args).await, Some(("run", args)) => run::do_run(sessionized_config, args, args.subcommand()).await, Some(("teams", sub_matches)) => { @@ -162,6 +177,7 @@ fn root_cmd() -> Command { .arg_required_else_help(false) .subcommand(session::login_cmd()) .subcommand(apps::apps_cmd()) + .subcommand(schedules::schedules_cmd()) .subcommand(secrets::secrets_cmd()) .subcommand(deploy::deploy_cmd()) .subcommand(run::run_cmd()) diff --git a/crates/tower-cmd/src/schedules.rs b/crates/tower-cmd/src/schedules.rs new file mode 100644 index 00000000..90ba385a --- /dev/null +++ b/crates/tower-cmd/src/schedules.rs @@ -0,0 +1,245 @@ +use clap::{value_parser, Arg, ArgMatches, Command}; +use colored::Colorize; +use config::Config; +use std::collections::HashMap; + +use crate::{ + output, + api, +}; + +use tower_api::models::schedule::Status; + +pub fn schedules_cmd() -> Command { + Command::new("schedules") + .about("Manage schedules for your Tower apps") + .arg_required_else_help(true) + .subcommand( + Command::new("list") + .arg( + Arg::new("app") + .short('a') + .long("app") + .value_parser(value_parser!(String)) + .help("Filter schedules by app name") + .action(clap::ArgAction::Set), + ) + .arg( + Arg::new("environment") + .short('e') + .long("environment") + .value_parser(value_parser!(String)) + .help("Filter schedules by environment") + .action(clap::ArgAction::Set), + ) + .about("List all schedules"), + ) + .subcommand( + Command::new("create") + .arg( + Arg::new("app") + .short('a') + .long("app") + .value_parser(value_parser!(String)) + .required(true) + .help("The name of the app to schedule") + .action(clap::ArgAction::Set), + ) + .arg( + Arg::new("environment") + .short('e') + .long("environment") + .value_parser(value_parser!(String)) + .default_value("default") + .help("The environment to run the app in") + .action(clap::ArgAction::Set), + ) + .arg( + Arg::new("cron") + .short('c') + .long("cron") + .value_parser(value_parser!(String)) + .required(true) + .help("The cron expression defining when the app should run") + .action(clap::ArgAction::Set), + ) + .arg( + Arg::new("parameters") + .short('p') + .long("parameter") + .help("Parameters (key=value) to pass to the app") + .action(clap::ArgAction::Append), + ) + .about("Create a new schedule for an app"), + ) + .subcommand( + Command::new("delete") + .allow_external_subcommands(true) + .about("Delete a schedule"), + ) + .subcommand( + Command::new("update") + .arg( + Arg::new("cron") + .short('c') + .long("cron") + .value_parser(value_parser!(String)) + .help("The cron expression defining when the app should run") + .action(clap::ArgAction::Set), + ) + .arg( + Arg::new("parameters") + .short('p') + .long("parameter") + .help("Parameters (key=value) to pass to the app") + .action(clap::ArgAction::Append), + ) + .allow_external_subcommands(true) + .about("Update an existing schedule"), + ) +} + +pub async fn do_list(config: Config, args: &ArgMatches) { + let app = args.get_one::("app").map(|s| s.as_str()); + let environment = args.get_one::("environment").map(|s| s.as_str()); + + match api::list_schedules(&config, app, environment).await { + Ok(response) => { + if response.schedules.is_empty() { + output::write("No schedules found.\n"); + return; + } + + let headers = vec![ + "ID".yellow().to_string(), + "App".yellow().to_string(), + "Environment".yellow().to_string(), + "Cron".yellow().to_string(), + "Status".yellow().to_string(), + ]; + + let rows: Vec> = response + .schedules + .iter() + .map(|schedule| { + let status = match schedule.status { + Status::Active => "active".green(), + Status::Disabled => "disabled".red(), + }; + + vec![ + schedule.id.clone(), + schedule.app_name.clone(), + schedule.environment.clone(), + schedule.cron.clone(), + status.to_string(), + ] + }) + .collect(); + + output::table(headers, rows); + } + Err(err) => { + output::tower_error(err); + } + } +} + +pub async fn do_create(config: Config, args: &ArgMatches) { + let app_name = args.get_one::("app").unwrap(); + let environment = args.get_one::("environment").unwrap(); + let cron = args.get_one::("cron").unwrap(); + let parameters = parse_parameters(args); + + let mut spinner = output::spinner("Creating schedule"); + + match api::create_schedule(&config, app_name, environment, cron, parameters).await { + Ok(response) => { + spinner.success(); + output::success(&format!( + "Schedule created with ID: {}", + response.schedule.id + )); + } + Err(err) => { + spinner.failure(); + output::tower_error(err); + } + } +} + +pub async fn do_update(config: Config, args: &ArgMatches) { + let schedule_id = extract_schedule_id("update", args.subcommand()); + let cron = args.get_one::("cron"); + let parameters = parse_parameters(args); + let mut spinner = output::spinner("Updating schedule"); + + match api::update_schedule(&config, &schedule_id, cron, parameters).await { + Ok(_) => { + spinner.success(); + output::success(&format!("Schedule {} updated", schedule_id)); + } + Err(err) => { + spinner.failure(); + output::tower_error(err); + } + } +} + +pub async fn do_delete(config: Config, args: &ArgMatches) { + let schedule_id = extract_schedule_id("delete", args.subcommand()); + let mut spinner = output::spinner("Deleting schedule"); + + match api::delete_schedule(&config, &schedule_id).await { + Ok(_) => { + spinner.success(); + output::success(&format!("Schedule {} deleted", schedule_id)); + } + Err(err) => { + spinner.failure(); + output::tower_error(err); + } + } +} + +fn extract_schedule_id(subcmd: &str, cmd: Option<(&str, &ArgMatches)>) -> String { + if let Some((id, _)) = cmd { + return id.to_string(); + } + + let line = format!("Schedule ID is required. Example: tower schedules {} ", subcmd); + output::die(&line); +} + +/// Parses `--parameter` arguments into a HashMap of key-value pairs. +/// Handles format like "--parameter key=value" +fn parse_parameters(args: &ArgMatches) -> Option> { + let mut param_map = HashMap::new(); + + if let Some(parameters) = args.get_many::("parameters") { + for param in parameters { + match param.split_once('=') { + Some((key, value)) => { + if key.is_empty() { + output::failure(&format!( + "Invalid parameter format: '{}'. Key cannot be empty.", + param + )); + continue; + } + param_map.insert(key.to_string(), value.to_string()); + } + None => { + output::failure(&format!( + "Invalid parameter format: '{}'. Expected 'key=value'.", + param + )); + } + } + } + + Some(param_map) + } else { + None + } +} diff --git a/pyproject.toml b/pyproject.toml index b300fc2e..9fbcae7c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,8 @@ build-backend = "maturin" [project] name = "tower" -version = "0.3.29" +version = "0.3.30" + diff --git a/src/tower/_tables.py b/src/tower/_tables.py index 8c5ea8fd..30441526 100644 --- a/src/tower/_tables.py +++ b/src/tower/_tables.py @@ -1,6 +1,8 @@ from typing import Optional, Generic, TypeVar, Union, List from dataclasses import dataclass +from pyiceberg.exceptions import NoSuchTableError + TTable = TypeVar("TTable", bound="Table") import polars as pl @@ -487,6 +489,43 @@ def create_if_not_exists(self, schema: pa.Schema) -> Table: return Table(self._context, table) + def drop(self) -> bool: + """ + Drops (deletes) the Iceberg table from the catalog. + + This method will: + 1. Resolve the table's namespace (using default if not specified) + 2. Drop the table from the catalog + 3. Return True if successful, False if the table didn't exist + + Returns: + bool: True if the table was successfully dropped, False if it didn't exist. + + Raises: + CatalogError: If there are issues accessing the catalog or dropping the table. + + Example: + >>> # Drop an existing table + >>> table_ref = tables("my_table", namespace="my_namespace") + >>> success = table_ref.drop() + >>> if success: + ... print("Table dropped successfully") + ... else: + ... print("Table didn't exist") + """ + namespace = namespace_or_default(self._namespace) + table_name = make_table_name(self._name, namespace) + + try: + self._catalog.drop_table(table_name) + return True + except NoSuchTableError: + # If the table doesn't exist or there's any other issue, return False + # The underlying PyIceberg catalog will raise different exceptions + # depending on the catalog implementation, so we catch all exceptions + return False + + def tables( name: str, catalog: Union[str, Catalog] = "default", @@ -515,6 +554,7 @@ def tables( - Load an existing table using `load()` - Create a new table using `create()` - Create a table if it doesn't exist using `create_if_not_exists()` + - Drop an existing table using `drop()` Raises: CatalogError: If there are issues accessing or loading the specified catalog. @@ -537,6 +577,11 @@ def tables( >>> # Create a table if it doesn't exist >>> table = tables("my_table").create_if_not_exists(schema) + + >>> # Drop an existing table + >>> success = tables("my_table", namespace="my_namespace").drop() + >>> if success: + ... print("Table dropped successfully") """ if isinstance(catalog, str): catalog = load_catalog(catalog) diff --git a/src/tower/tower_api_client/api/default/activate_schedules.py b/src/tower/tower_api_client/api/default/activate_schedules.py new file mode 100644 index 00000000..e1cc1469 --- /dev/null +++ b/src/tower/tower_api_client/api/default/activate_schedules.py @@ -0,0 +1,168 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.batch_schedule_params import BatchScheduleParams +from ...models.batch_schedule_response import BatchScheduleResponse +from ...types import Response + + +def _get_kwargs( + *, + body: BatchScheduleParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/schedules/activate", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[BatchScheduleResponse]: + if response.status_code == 200: + response_200 = BatchScheduleResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[BatchScheduleResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: BatchScheduleParams, +) -> Response[BatchScheduleResponse]: + """Activate multiple schedules + + Activate multiple schedules to enable their execution. + + Args: + body (BatchScheduleParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[BatchScheduleResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: BatchScheduleParams, +) -> Optional[BatchScheduleResponse]: + """Activate multiple schedules + + Activate multiple schedules to enable their execution. + + Args: + body (BatchScheduleParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + BatchScheduleResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: BatchScheduleParams, +) -> Response[BatchScheduleResponse]: + """Activate multiple schedules + + Activate multiple schedules to enable their execution. + + Args: + body (BatchScheduleParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[BatchScheduleResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: BatchScheduleParams, +) -> Optional[BatchScheduleResponse]: + """Activate multiple schedules + + Activate multiple schedules to enable their execution. + + Args: + body (BatchScheduleParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + BatchScheduleResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/deactivate_schedules.py b/src/tower/tower_api_client/api/default/deactivate_schedules.py new file mode 100644 index 00000000..d44dbe76 --- /dev/null +++ b/src/tower/tower_api_client/api/default/deactivate_schedules.py @@ -0,0 +1,168 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.batch_schedule_params import BatchScheduleParams +from ...models.batch_schedule_response import BatchScheduleResponse +from ...types import Response + + +def _get_kwargs( + *, + body: BatchScheduleParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/schedules/deactivate", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[BatchScheduleResponse]: + if response.status_code == 200: + response_200 = BatchScheduleResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[BatchScheduleResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: BatchScheduleParams, +) -> Response[BatchScheduleResponse]: + """Deactivate multiple schedules + + Deactivate multiple schedules to disable their execution. + + Args: + body (BatchScheduleParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[BatchScheduleResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: BatchScheduleParams, +) -> Optional[BatchScheduleResponse]: + """Deactivate multiple schedules + + Deactivate multiple schedules to disable their execution. + + Args: + body (BatchScheduleParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + BatchScheduleResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: BatchScheduleParams, +) -> Response[BatchScheduleResponse]: + """Deactivate multiple schedules + + Deactivate multiple schedules to disable their execution. + + Args: + body (BatchScheduleParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[BatchScheduleResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: BatchScheduleParams, +) -> Optional[BatchScheduleResponse]: + """Deactivate multiple schedules + + Deactivate multiple schedules to disable their execution. + + Args: + body (BatchScheduleParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + BatchScheduleResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/models/__init__.py b/src/tower/tower_api_client/models/__init__.py index c8a34bb9..afe14abc 100644 --- a/src/tower/tower_api_client/models/__init__.py +++ b/src/tower/tower_api_client/models/__init__.py @@ -11,6 +11,8 @@ from .app_status import AppStatus from .app_summary import AppSummary from .app_version import AppVersion +from .batch_schedule_params import BatchScheduleParams +from .batch_schedule_response import BatchScheduleResponse from .cancel_run_response import CancelRunResponse from .catalog import Catalog from .catalog_property import CatalogProperty @@ -34,6 +36,7 @@ from .create_password_reset_params import CreatePasswordResetParams from .create_password_reset_response import CreatePasswordResetResponse from .create_schedule_params import CreateScheduleParams +from .create_schedule_params_status import CreateScheduleParamsStatus from .create_schedule_response import CreateScheduleResponse from .create_secret_params import CreateSecretParams from .create_secret_response import CreateSecretResponse @@ -131,6 +134,7 @@ from .run_timeseries_point import RunTimeseriesPoint from .runner_credentials import RunnerCredentials from .schedule import Schedule +from .schedule_status import ScheduleStatus from .search_runs_response import SearchRunsResponse from .search_runs_status_item import SearchRunsStatusItem from .secret import Secret @@ -161,6 +165,7 @@ from .update_plan_params import UpdatePlanParams from .update_plan_response import UpdatePlanResponse from .update_schedule_params import UpdateScheduleParams +from .update_schedule_params_status import UpdateScheduleParamsStatus from .update_schedule_response import UpdateScheduleResponse from .update_secret_params import UpdateSecretParams from .update_secret_response import UpdateSecretResponse @@ -185,6 +190,8 @@ "AppStatus", "AppSummary", "AppVersion", + "BatchScheduleParams", + "BatchScheduleResponse", "CancelRunResponse", "Catalog", "CatalogProperty", @@ -208,6 +215,7 @@ "CreatePasswordResetParams", "CreatePasswordResetResponse", "CreateScheduleParams", + "CreateScheduleParamsStatus", "CreateScheduleResponse", "CreateSecretParams", "CreateSecretResponse", @@ -303,6 +311,7 @@ "RunStatusGroup", "RunTimeseriesPoint", "Schedule", + "ScheduleStatus", "SearchRunsResponse", "SearchRunsStatusItem", "Secret", @@ -333,6 +342,7 @@ "UpdatePlanParams", "UpdatePlanResponse", "UpdateScheduleParams", + "UpdateScheduleParamsStatus", "UpdateScheduleResponse", "UpdateSecretParams", "UpdateSecretResponse", diff --git a/src/tower/tower_api_client/models/batch_schedule_params.py b/src/tower/tower_api_client/models/batch_schedule_params.py new file mode 100644 index 00000000..8de047cd --- /dev/null +++ b/src/tower/tower_api_client/models/batch_schedule_params.py @@ -0,0 +1,51 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="BatchScheduleParams") + + +@_attrs_define +class BatchScheduleParams: + """ + Attributes: + ids (list[str]): The IDs of the schedules to modify + schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/BatchScheduleParams.json. + """ + + ids: list[str] + schema: Union[Unset, str] = UNSET + + def to_dict(self) -> dict[str, Any]: + ids = self.ids + + schema = self.schema + + field_dict: dict[str, Any] = {} + field_dict.update( + { + "ids": ids, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + ids = cast(list[str], d.pop("ids")) + + schema = d.pop("$schema", UNSET) + + batch_schedule_params = cls( + ids=ids, + schema=schema, + ) + + return batch_schedule_params diff --git a/src/tower/tower_api_client/models/batch_schedule_response.py b/src/tower/tower_api_client/models/batch_schedule_response.py new file mode 100644 index 00000000..103a99f9 --- /dev/null +++ b/src/tower/tower_api_client/models/batch_schedule_response.py @@ -0,0 +1,65 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.schedule import Schedule + + +T = TypeVar("T", bound="BatchScheduleResponse") + + +@_attrs_define +class BatchScheduleResponse: + """ + Attributes: + schedules (list['Schedule']): + schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/BatchScheduleResponse.json. + """ + + schedules: list["Schedule"] + schema: Union[Unset, str] = UNSET + + def to_dict(self) -> dict[str, Any]: + schedules = [] + for schedules_item_data in self.schedules: + schedules_item = schedules_item_data.to_dict() + schedules.append(schedules_item) + + schema = self.schema + + field_dict: dict[str, Any] = {} + field_dict.update( + { + "schedules": schedules, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.schedule import Schedule + + d = dict(src_dict) + schedules = [] + _schedules = d.pop("schedules") + for schedules_item_data in _schedules: + schedules_item = Schedule.from_dict(schedules_item_data) + + schedules.append(schedules_item) + + schema = d.pop("$schema", UNSET) + + batch_schedule_response = cls( + schedules=schedules, + schema=schema, + ) + + return batch_schedule_response diff --git a/src/tower/tower_api_client/models/create_schedule_params.py b/src/tower/tower_api_client/models/create_schedule_params.py index e526bd86..64ef1438 100644 --- a/src/tower/tower_api_client/models/create_schedule_params.py +++ b/src/tower/tower_api_client/models/create_schedule_params.py @@ -3,6 +3,7 @@ from attrs import define as _attrs_define +from ..models.create_schedule_params_status import CreateScheduleParamsStatus from ..types import UNSET, Unset if TYPE_CHECKING: @@ -24,6 +25,7 @@ class CreateScheduleParams: version) environment (Union[Unset, str]): The environment to run the app in Default: 'default'. parameters (Union[Unset, list['RunParameter']]): Parameters to pass when running the app + status (Union[Unset, CreateScheduleParamsStatus]): The status of the schedule (defaults to active) """ app_name: str @@ -32,6 +34,7 @@ class CreateScheduleParams: app_version: Union[None, Unset, str] = UNSET environment: Union[Unset, str] = "default" parameters: Union[Unset, list["RunParameter"]] = UNSET + status: Union[Unset, CreateScheduleParamsStatus] = UNSET def to_dict(self) -> dict[str, Any]: app_name = self.app_name @@ -55,6 +58,10 @@ def to_dict(self) -> dict[str, Any]: parameters_item = parameters_item_data.to_dict() parameters.append(parameters_item) + status: Union[Unset, str] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + field_dict: dict[str, Any] = {} field_dict.update( { @@ -70,6 +77,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["environment"] = environment if parameters is not UNSET: field_dict["parameters"] = parameters + if status is not UNSET: + field_dict["status"] = status return field_dict @@ -102,6 +111,13 @@ def _parse_app_version(data: object) -> Union[None, Unset, str]: parameters.append(parameters_item) + _status = d.pop("status", UNSET) + status: Union[Unset, CreateScheduleParamsStatus] + if isinstance(_status, Unset): + status = UNSET + else: + status = CreateScheduleParamsStatus(_status) + create_schedule_params = cls( app_name=app_name, cron=cron, @@ -109,6 +125,7 @@ def _parse_app_version(data: object) -> Union[None, Unset, str]: app_version=app_version, environment=environment, parameters=parameters, + status=status, ) return create_schedule_params diff --git a/src/tower/tower_api_client/models/create_schedule_params_status.py b/src/tower/tower_api_client/models/create_schedule_params_status.py new file mode 100644 index 00000000..e86cf62a --- /dev/null +++ b/src/tower/tower_api_client/models/create_schedule_params_status.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class CreateScheduleParamsStatus(str, Enum): + ACTIVE = "active" + DISABLED = "disabled" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/run.py b/src/tower/tower_api_client/models/run.py index 716b8ef4..5d39d8a0 100644 --- a/src/tower/tower_api_client/models/run.py +++ b/src/tower/tower_api_client/models/run.py @@ -36,6 +36,7 @@ class Run: status (RunStatus): status_group (RunStatusGroup): app_slug (Union[Unset, str]): This property is deprecated. Please use app_name instead. + hostname (Union[Unset, str]): If app is externally accessible, then you can access this run with this hostname """ link: str @@ -54,6 +55,7 @@ class Run: status: RunStatus status_group: RunStatusGroup app_slug: Union[Unset, str] = UNSET + hostname: Union[Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: link = self.link @@ -104,6 +106,8 @@ def to_dict(self) -> dict[str, Any]: app_slug = self.app_slug + hostname = self.hostname + field_dict: dict[str, Any] = {} field_dict.update( { @@ -126,6 +130,8 @@ def to_dict(self) -> dict[str, Any]: ) if app_slug is not UNSET: field_dict["app_slug"] = app_slug + if hostname is not UNSET: + field_dict["hostname"] = hostname return field_dict @@ -215,6 +221,8 @@ def _parse_started_at(data: object) -> Union[None, datetime.datetime]: app_slug = d.pop("app_slug", UNSET) + hostname = d.pop("hostname", UNSET) + run = cls( link=link, app_name=app_name, @@ -232,6 +240,7 @@ def _parse_started_at(data: object) -> Union[None, datetime.datetime]: status=status, status_group=status_group, app_slug=app_slug, + hostname=hostname, ) return run diff --git a/src/tower/tower_api_client/models/schedule.py b/src/tower/tower_api_client/models/schedule.py index a1b0ddfe..c63d2928 100644 --- a/src/tower/tower_api_client/models/schedule.py +++ b/src/tower/tower_api_client/models/schedule.py @@ -5,6 +5,7 @@ from attrs import define as _attrs_define from dateutil.parser import isoparse +from ..models.schedule_status import ScheduleStatus from ..types import UNSET, Unset if TYPE_CHECKING: @@ -23,6 +24,7 @@ class Schedule: cron (str): The cron expression defining when the app should run environment (str): The environment to run the app in id (str): The unique identifier for the schedule + status (ScheduleStatus): The status of the schedule updated_at (datetime.datetime): The timestamp when the schedule was last updated app_version (Union[Unset, str]): The specific app version to run, or null for the default version parameters (Union[Unset, list['RunParameter']]): The parameters to pass when running the app @@ -33,6 +35,7 @@ class Schedule: cron: str environment: str id: str + status: ScheduleStatus updated_at: datetime.datetime app_version: Union[Unset, str] = UNSET parameters: Union[Unset, list["RunParameter"]] = UNSET @@ -48,6 +51,8 @@ def to_dict(self) -> dict[str, Any]: id = self.id + status = self.status.value + updated_at = self.updated_at.isoformat() app_version = self.app_version @@ -67,6 +72,7 @@ def to_dict(self) -> dict[str, Any]: "cron": cron, "environment": environment, "id": id, + "status": status, "updated_at": updated_at, } ) @@ -92,6 +98,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id") + status = ScheduleStatus(d.pop("status")) + updated_at = isoparse(d.pop("updated_at")) app_version = d.pop("app_version", UNSET) @@ -109,6 +117,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: cron=cron, environment=environment, id=id, + status=status, updated_at=updated_at, app_version=app_version, parameters=parameters, diff --git a/src/tower/tower_api_client/models/schedule_status.py b/src/tower/tower_api_client/models/schedule_status.py new file mode 100644 index 00000000..20e02959 --- /dev/null +++ b/src/tower/tower_api_client/models/schedule_status.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class ScheduleStatus(str, Enum): + ACTIVE = "active" + DISABLED = "disabled" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/update_schedule_params.py b/src/tower/tower_api_client/models/update_schedule_params.py index a3e3b9f3..49462551 100644 --- a/src/tower/tower_api_client/models/update_schedule_params.py +++ b/src/tower/tower_api_client/models/update_schedule_params.py @@ -3,6 +3,7 @@ from attrs import define as _attrs_define +from ..models.update_schedule_params_status import UpdateScheduleParamsStatus from ..types import UNSET, Unset if TYPE_CHECKING: @@ -23,6 +24,7 @@ class UpdateScheduleParams: cron (Union[Unset, str]): The cron expression defining when the app should run environment (Union[Unset, str]): The environment to run the app in parameters (Union[Unset, list['RunParameter']]): Parameters to pass when running the app + status (Union[Unset, UpdateScheduleParamsStatus]): The status of the schedule """ schema: Union[Unset, str] = UNSET @@ -30,6 +32,7 @@ class UpdateScheduleParams: cron: Union[Unset, str] = UNSET environment: Union[Unset, str] = UNSET parameters: Union[Unset, list["RunParameter"]] = UNSET + status: Union[Unset, UpdateScheduleParamsStatus] = UNSET def to_dict(self) -> dict[str, Any]: schema = self.schema @@ -51,6 +54,10 @@ def to_dict(self) -> dict[str, Any]: parameters_item = parameters_item_data.to_dict() parameters.append(parameters_item) + status: Union[Unset, str] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + field_dict: dict[str, Any] = {} field_dict.update({}) if schema is not UNSET: @@ -63,6 +70,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["environment"] = environment if parameters is not UNSET: field_dict["parameters"] = parameters + if status is not UNSET: + field_dict["status"] = status return field_dict @@ -93,12 +102,20 @@ def _parse_app_version(data: object) -> Union[None, Unset, str]: parameters.append(parameters_item) + _status = d.pop("status", UNSET) + status: Union[Unset, UpdateScheduleParamsStatus] + if isinstance(_status, Unset): + status = UNSET + else: + status = UpdateScheduleParamsStatus(_status) + update_schedule_params = cls( schema=schema, app_version=app_version, cron=cron, environment=environment, parameters=parameters, + status=status, ) return update_schedule_params diff --git a/src/tower/tower_api_client/models/update_schedule_params_status.py b/src/tower/tower_api_client/models/update_schedule_params_status.py new file mode 100644 index 00000000..2959b194 --- /dev/null +++ b/src/tower/tower_api_client/models/update_schedule_params_status.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class UpdateScheduleParamsStatus(str, Enum): + ACTIVE = "active" + DISABLED = "disabled" + + def __str__(self) -> str: + return str(self.value) diff --git a/tests/tower/test_tables.py b/tests/tower/test_tables.py index a92c0ee3..db965049 100644 --- a/tests/tower/test_tables.py +++ b/tests/tower/test_tables.py @@ -560,3 +560,172 @@ def test_map_type_simple(in_memory_catalog): # Row 4 (null map) props4_series = df_read.filter(pl.col("id") == 4).select("properties").to_series() assert props4_series[0] is None + + +def test_drop_existing_table(in_memory_catalog): + """Test dropping an existing table returns True.""" + schema = pa.schema([ + pa.field("id", pa.int64()), + pa.field("name", pa.string()), + ]) + + # Create a table first + ref = tower.tables("users_to_drop", catalog=in_memory_catalog) + table = ref.create(schema) + assert table is not None + + # Insert some data to make sure the table exists and has content + data = pa.Table.from_pylist([{"id": 1, "name": "Alice"}], schema=schema) + table.insert(data) + + # Verify the table exists by reading from it + df = table.read() + assert len(df) == 1 + + # Now drop the table - should return True + success = ref.drop() + assert success is True + + +def test_drop_nonexistent_table(in_memory_catalog): + """Test dropping a non-existent table returns False.""" + ref = tower.tables("nonexistent_table", catalog=in_memory_catalog) + + # Try to drop a table that doesn't exist - should return False + success = ref.drop() + assert success is False + + +def test_drop_table_with_namespace(in_memory_catalog): + """Test dropping a table with a specific namespace.""" + schema = pa.schema([ + pa.field("id", pa.int64()), + pa.field("data", pa.string()), + ]) + + # Create a table in a specific namespace + ref = tower.tables("test_table", catalog=in_memory_catalog, namespace="test_namespace") + table = ref.create(schema) + assert table is not None + + # Insert some data to confirm the table exists + data = pa.Table.from_pylist([{"id": 1, "data": "test"}], schema=schema) + table.insert(data) + + # Verify we can read from it + df = table.read() + assert len(df) == 1 + + # Drop the table - should succeed + success = ref.drop() + assert success is True + + # Try to drop the same table again - should return False + success_again = ref.drop() + assert success_again is False + + +def test_drop_and_recreate_table(in_memory_catalog): + """Test that we can drop a table and then recreate it.""" + schema = pa.schema([ + pa.field("id", pa.int64()), + pa.field("value", pa.string()), + ]) + + table_name = "drop_recreate_test" + ref = tower.tables(table_name, catalog=in_memory_catalog) + + # Create and populate the table + table = ref.create(schema) + data = pa.Table.from_pylist([ + {"id": 1, "value": "first"}, + {"id": 2, "value": "second"} + ], schema=schema) + table.insert(data) + + # Verify original data + df = table.read() + assert len(df) == 2 + + # Drop the table + success = ref.drop() + assert success is True + + # Recreate the table with different data + new_table = ref.create(schema) + new_data = pa.Table.from_pylist([ + {"id": 10, "value": "new_first"}, + {"id": 20, "value": "new_second"}, + {"id": 30, "value": "new_third"} + ], schema=schema) + new_table.insert(new_data) + + # Verify new data + new_df = new_table.read() + assert len(new_df) == 3 + + # Make sure the old data is gone + ids = new_df.select("id").to_series().to_list() + assert 1 not in ids + assert 2 not in ids + assert 10 in ids + assert 20 in ids + assert 30 in ids + + +def test_drop_multiple_tables(in_memory_catalog): + """Test dropping multiple tables.""" + schema = pa.schema([ + pa.field("id", pa.int64()), + pa.field("name", pa.string()), + ]) + + # Create multiple tables + table_names = ["table1", "table2", "table3"] + tables = {} + + for name in table_names: + ref = tower.tables(name, catalog=in_memory_catalog) + table = ref.create(schema) + data = pa.Table.from_pylist([{"id": 1, "name": f"data_{name}"}], schema=schema) + table.insert(data) + tables[name] = ref + + # Verify all tables exist by reading from them + for name, ref in tables.items(): + table = ref.load() + df = table.read() + assert len(df) == 1 + + # Drop all tables + for name, ref in tables.items(): + success = ref.drop() + assert success is True, f"Failed to drop table {name}" + + # Verify all tables are gone + for name, ref in tables.items(): + success = ref.drop() + assert success is False, f"Table {name} still exists after dropping" + + +def test_drop_with_catalog_errors(in_memory_catalog): + """Test that catalog errors are properly propagated, not masked as False.""" + from unittest.mock import patch + from pyiceberg.exceptions import NoSuchTableError + + ref = tower.tables("test_table", catalog=in_memory_catalog) + + # Test that NoSuchTableError returns False + with patch.object(in_memory_catalog, 'drop_table') as mock_drop: + mock_drop.side_effect = NoSuchTableError("Table not found") + success = ref.drop() + assert success is False + mock_drop.assert_called_once() + + # Test that other exceptions are propagated + with patch.object(in_memory_catalog, 'drop_table') as mock_drop: + mock_drop.side_effect = RuntimeError("Catalog connection failed") + + with pytest.raises(RuntimeError, match="Catalog connection failed"): + ref.drop() + mock_drop.assert_called_once() diff --git a/uv.lock b/uv.lock index 99402b46..338f2f22 100644 --- a/uv.lock +++ b/uv.lock @@ -1217,7 +1217,7 @@ wheels = [ [[package]] name = "tower" -version = "0.3.29" +version = "0.3.30" source = { editable = "." } dependencies = [ { name = "attrs" },