diff --git a/crates/tower-api/README.md b/crates/tower-api/README.md index d7bd0fa2..64baa27c 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.6.27 +- API version: v0.7.6 - Package version: 1.0.0 - Generator version: 7.13.0 - Build package: `org.openapitools.codegen.languages.RustClientCodegen` @@ -27,7 +27,6 @@ All URIs are relative to *https://api.tower.dev/v1* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*DefaultApi* | [**accept_invitation**](docs/DefaultApi.md#accept_invitation) | **POST** /accounts/invite | Accept an invitation code *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* | [**cancel_run**](docs/DefaultApi.md#cancel_run) | **POST** /apps/{name}/runs/{seq} | Cancel run @@ -49,7 +48,7 @@ Class | Method | HTTP request | Description *DefaultApi* | [**delete_app**](docs/DefaultApi.md#delete_app) | **DELETE** /apps/{name} | Delete app *DefaultApi* | [**delete_authenticator**](docs/DefaultApi.md#delete_authenticator) | **DELETE** /accounts/authenticator | Delete authenticator *DefaultApi* | [**delete_catalog**](docs/DefaultApi.md#delete_catalog) | **DELETE** /catalogs/{name} | Delete catalog -*DefaultApi* | [**delete_schedule**](docs/DefaultApi.md#delete_schedule) | **DELETE** /schedules/{id} | Delete schedule +*DefaultApi* | [**delete_schedule**](docs/DefaultApi.md#delete_schedule) | **DELETE** /schedules | Delete schedule *DefaultApi* | [**delete_secret**](docs/DefaultApi.md#delete_secret) | **DELETE** /secrets/{name} | Delete secret *DefaultApi* | [**delete_team**](docs/DefaultApi.md#delete_team) | **DELETE** /teams | Delete team *DefaultApi* | [**delete_team_invitation**](docs/DefaultApi.md#delete_team_invitation) | **DELETE** /teams/{name}/invites | Delete team invitation @@ -88,6 +87,7 @@ Class | Method | HTTP request | Description *DefaultApi* | [**list_teams**](docs/DefaultApi.md#list_teams) | **GET** /teams | List teams *DefaultApi* | [**refresh_session**](docs/DefaultApi.md#refresh_session) | **POST** /session/refresh | Refresh session *DefaultApi* | [**remove_team_member**](docs/DefaultApi.md#remove_team_member) | **DELETE** /teams/{name}/members | Remove team member +*DefaultApi* | [**resend_email_verification**](docs/DefaultApi.md#resend_email_verification) | **POST** /user/resend-verification | Resent email verification *DefaultApi* | [**resend_team_invitation**](docs/DefaultApi.md#resend_team_invitation) | **POST** /teams/{name}/invites/resend | Resend team invitation *DefaultApi* | [**run_app**](docs/DefaultApi.md#run_app) | **POST** /apps/{name}/runs | Run app *DefaultApi* | [**search_runs**](docs/DefaultApi.md#search_runs) | **GET** /runs | Search runs @@ -104,12 +104,12 @@ Class | Method | HTTP request | Description *DefaultApi* | [**update_secret**](docs/DefaultApi.md#update_secret) | **PUT** /secrets/{name} | Update secret *DefaultApi* | [**update_team**](docs/DefaultApi.md#update_team) | **PUT** /teams/{name} | Update team *DefaultApi* | [**update_user**](docs/DefaultApi.md#update_user) | **PUT** /user | Update user profile +*DefaultApi* | [**verify_email**](docs/DefaultApi.md#verify_email) | **POST** /user/verify | Verify email +*FeatureFlagsApi* | [**get_feature_flag_value**](docs/FeatureFlagsApi.md#get_feature_flag_value) | **GET** /feature-flags/{key} | Get feature flag value ## Documentation For Models - - [AcceptInvitationParams](docs/AcceptInvitationParams.md) - - [AcceptInvitationResponse](docs/AcceptInvitationResponse.md) - [Account](docs/Account.md) - [AcknowledgeAlertResponse](docs/AcknowledgeAlertResponse.md) - [AcknowledgeAllAlertsResponse](docs/AcknowledgeAllAlertsResponse.md) @@ -154,6 +154,7 @@ Class | Method | HTTP request | Description - [DeleteAuthenticatorParams](docs/DeleteAuthenticatorParams.md) - [DeleteAuthenticatorResponse](docs/DeleteAuthenticatorResponse.md) - [DeleteCatalogResponse](docs/DeleteCatalogResponse.md) + - [DeleteScheduleParams](docs/DeleteScheduleParams.md) - [DeleteScheduleResponse](docs/DeleteScheduleResponse.md) - [DeleteSecretResponse](docs/DeleteSecretResponse.md) - [DeleteTeamInvitationParams](docs/DeleteTeamInvitationParams.md) @@ -189,6 +190,7 @@ Class | Method | HTTP request | Description - [GenerateAuthenticatorResponse](docs/GenerateAuthenticatorResponse.md) - [GenerateRunStatisticsResponse](docs/GenerateRunStatisticsResponse.md) - [GenerateRunnerCredentialsResponse](docs/GenerateRunnerCredentialsResponse.md) + - [GetFeatureFlagResponseBody](docs/GetFeatureFlagResponseBody.md) - [InviteTeamMemberParams](docs/InviteTeamMemberParams.md) - [InviteTeamMemberResponse](docs/InviteTeamMemberResponse.md) - [LeaveTeamResponse](docs/LeaveTeamResponse.md) @@ -210,7 +212,6 @@ Class | Method | HTTP request | Description - [ListTeamInvitationsResponse](docs/ListTeamInvitationsResponse.md) - [ListTeamMembersResponse](docs/ListTeamMembersResponse.md) - [ListTeamsResponse](docs/ListTeamsResponse.md) - - [LogLine](docs/LogLine.md) - [Pagination](docs/Pagination.md) - [Parameter](docs/Parameter.md) - [Plan](docs/Plan.md) @@ -266,6 +267,8 @@ Class | Method | HTTP request | Description - [UpdateUserResponse](docs/UpdateUserResponse.md) - [User](docs/User.md) - [VerifiedAuthenticator](docs/VerifiedAuthenticator.md) + - [VerifyEmailParams](docs/VerifyEmailParams.md) + - [VerifyEmailResponse](docs/VerifyEmailResponse.md) To get access to the crate's generated documentation, use: diff --git a/crates/tower-api/src/apis/configuration.rs b/crates/tower-api/src/apis/configuration.rs index e9675e44..9e31f7e7 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 8c36ed3b..913a7f9a 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.6.27 + * The version of the OpenAPI document: v0.7.6 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -16,12 +16,6 @@ use super::{Error, configuration, ContentType}; const DEFAULT_TOWER_TRACE_ID: &str = "(none)"; -/// struct for passing parameters to the method [`accept_invitation`] -#[derive(Clone, Debug)] -pub struct AcceptInvitationParams { - pub accept_invitation_params: models::AcceptInvitationParams -} - /// struct for passing parameters to the method [`acknowledge_alert`] #[derive(Clone, Debug)] pub struct AcknowledgeAlertParams { @@ -148,8 +142,7 @@ pub struct DeleteCatalogParams { /// struct for passing parameters to the method [`delete_schedule`] #[derive(Clone, Debug)] pub struct DeleteScheduleParams { - /// The ID of the schedule to delete. - pub id: String + pub delete_schedule_params: models::DeleteScheduleParams } /// struct for passing parameters to the method [`delete_secret`] @@ -254,6 +247,13 @@ pub struct ExportSecretsParams { pub export_secrets_params: models::ExportSecretsParams } +/// struct for passing parameters to the method [`generate_app_statistics`] +#[derive(Clone, Debug)] +pub struct GenerateAppStatisticsParams { + /// The environment to filter the statistics by. If not provided, statistics for all environments will be returned. + pub environment: Option +} + /// struct for passing parameters to the method [`generate_run_statistics`] #[derive(Clone, Debug)] pub struct GenerateRunStatisticsParams { @@ -264,7 +264,9 @@ pub struct GenerateRunStatisticsParams { /// Filter runs by status(es). Define multiple with a comma-separated list. Supplying none will return all statuses. pub status: Option>, /// Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to UTC. - pub timezone: Option + pub timezone: Option, + /// Filter runs by environment. If not provided, all environments will be included. + pub environment: Option } /// struct for passing parameters to the method [`invite_team_member`] @@ -296,7 +298,9 @@ pub struct ListAlertsParams { /// The number of records to fetch on each page. pub page_size: Option, /// Filter alerts by acknowledged status. - pub acked: Option + pub acked: Option, + /// Filter alerts by environment (e.g., production, staging) + pub environment: Option } /// struct for passing parameters to the method [`list_app_environments`] @@ -327,7 +331,9 @@ pub struct ListAppsParams { /// Sort order for the results. pub sort: Option, /// Filter to see apps with certain statuses. - pub filter: Option + pub filter: Option, + /// The environment to filter the apps by. If not provided, apps for all environments will be returned. + pub environment: Option } /// struct for passing parameters to the method [`list_catalogs`] @@ -366,7 +372,9 @@ pub struct ListRunsParams { /// Filter runs scheduled after or at this datetime (inclusive) pub start_at: Option, /// Filter runs scheduled before or at this datetime (inclusive) - pub end_at: Option + pub end_at: Option, + /// Filter runs by environment. If not provided, all environments will be included. + pub environment: Option } /// struct for passing parameters to the method [`list_schedules`] @@ -447,7 +455,9 @@ pub struct SearchRunsParams { /// Filter runs scheduled after this datetime (inclusive). Provide timestamps in ISO-8601 format. pub start_at: Option, /// Filter runs scheduled before or at this datetime (inclusive). Provide timestamps in ISO-8601 format. - pub end_at: Option + pub end_at: Option, + /// Filter runs by environment. If not provided, all environments will be included. + pub environment: Option } /// struct for passing parameters to the method [`stream_run_logs`] @@ -540,15 +550,13 @@ pub struct UpdateUserParams { pub update_user_params: models::UpdateUserParams } - -/// struct for typed successes of method [`accept_invitation`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AcceptInvitationSuccess { - Status200(models::AcceptInvitationResponse), - UnknownValue(serde_json::Value), +/// struct for passing parameters to the method [`verify_email`] +#[derive(Clone, Debug)] +pub struct VerifyEmailParams { + pub verify_email_params: models::VerifyEmailParams } + /// struct for typed successes of method [`acknowledge_alert`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -593,7 +601,7 @@ pub enum CreateAccountSuccess { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum CreateApiKeySuccess { - Status200(models::CreateApiKeyResponse), + Status201(models::CreateApiKeyResponse), UnknownValue(serde_json::Value), } @@ -601,7 +609,7 @@ pub enum CreateApiKeySuccess { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum CreateAppSuccess { - Status200(models::CreateAppResponse), + Status201(models::CreateAppResponse), UnknownValue(serde_json::Value), } @@ -633,7 +641,7 @@ pub enum CreateDeviceLoginTicketSuccess { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum CreateEnvironmentSuccess { - Status200(models::CreateEnvironmentResponse), + Status201(models::CreateEnvironmentResponse), UnknownValue(serde_json::Value), } @@ -649,7 +657,7 @@ pub enum CreatePasswordResetSuccess { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum CreateScheduleSuccess { - Status200(models::CreateScheduleResponse), + Status201(models::CreateScheduleResponse), UnknownValue(serde_json::Value), } @@ -657,7 +665,7 @@ pub enum CreateScheduleSuccess { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum CreateSecretSuccess { - Status200(models::CreateSecretResponse), + Status201(models::CreateSecretResponse), UnknownValue(serde_json::Value), } @@ -713,7 +721,7 @@ pub enum DeleteAuthenticatorSuccess { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum DeleteCatalogSuccess { - Status200(models::DeleteCatalogResponse), + Status204(models::DeleteCatalogResponse), UnknownValue(serde_json::Value), } @@ -753,7 +761,7 @@ pub enum DeleteTeamInvitationSuccess { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum DeployAppSuccess { - Status200(models::DeployAppResponse), + Status201(models::DeployAppResponse), UnknownValue(serde_json::Value), } @@ -1029,6 +1037,14 @@ pub enum RemoveTeamMemberSuccess { UnknownValue(serde_json::Value), } +/// struct for typed successes of method [`resend_email_verification`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ResendEmailVerificationSuccess { + Status204(), + UnknownValue(serde_json::Value), +} + /// struct for typed successes of method [`resend_team_invitation`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -1041,7 +1057,6 @@ pub enum ResendTeamInvitationSuccess { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum RunAppSuccess { - Status200(models::RunAppResponse), Status201(models::RunAppResponse), UnknownValue(serde_json::Value), } @@ -1158,11 +1173,11 @@ pub enum UpdateUserSuccess { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`accept_invitation`] +/// struct for typed successes of method [`verify_email`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum AcceptInvitationError { - DefaultResponse(models::ErrorModel), +pub enum VerifyEmailSuccess { + Status200(models::VerifyEmailResponse), UnknownValue(serde_json::Value), } @@ -1649,6 +1664,14 @@ pub enum RemoveTeamMemberError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`resend_email_verification`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ResendEmailVerificationError { + DefaultResponse(models::ErrorModel), + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`resend_team_invitation`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -1777,43 +1800,15 @@ pub enum UpdateUserError { UnknownValue(serde_json::Value), } - -/// Accept an invitation code to join an account -pub async fn accept_invitation(configuration: &configuration::Configuration, params: AcceptInvitationParams) -> Result, Error> { - - let uri_str = format!("{}/accounts/invite", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::POST, &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.accept_invitation_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 })) - } +/// struct for typed errors of method [`verify_email`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum VerifyEmailError { + DefaultResponse(models::ErrorModel), + UnknownValue(serde_json::Value), } + /// Mark an alert as acknowledged pub async fn acknowledge_alert(configuration: &configuration::Configuration, params: AcknowledgeAlertParams) -> Result, Error> { @@ -2555,7 +2550,7 @@ pub async fn delete_catalog(configuration: &configuration::Configuration, params /// Delete an existing schedule for an app. pub async fn delete_schedule(configuration: &configuration::Configuration, params: DeleteScheduleParams) -> Result, Error> { - let uri_str = format!("{}/schedules/{id}", configuration.base_path, id=crate::apis::urlencode(params.id)); + let uri_str = format!("{}/schedules", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str); if let Some(ref user_agent) = configuration.user_agent { @@ -2564,6 +2559,7 @@ pub async fn delete_schedule(configuration: &configuration::Configuration, param if let Some(ref token) = configuration.bearer_access_token { req_builder = req_builder.bearer_auth(token.to_owned()); }; + req_builder = req_builder.json(¶ms.delete_schedule_params); let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -3076,11 +3072,14 @@ pub async fn export_secrets(configuration: &configuration::Configuration, params } /// Generates current statistics about apps -pub async fn generate_app_statistics(configuration: &configuration::Configuration) -> Result, Error> { +pub async fn generate_app_statistics(configuration: &configuration::Configuration, params: GenerateAppStatisticsParams) -> Result, Error> { let uri_str = format!("{}/stats/apps", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + if let Some(ref param_value) = params.environment { + req_builder = req_builder.query(&[("environment", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } @@ -3162,6 +3161,9 @@ pub async fn generate_run_statistics(configuration: &configuration::Configuratio if let Some(ref param_value) = params.timezone { req_builder = req_builder.query(&[("timezone", ¶m_value.to_string())]); } + if let Some(ref param_value) = params.environment { + req_builder = req_builder.query(&[("environment", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } @@ -3329,6 +3331,9 @@ pub async fn list_alerts(configuration: &configuration::Configuration, params: L if let Some(ref param_value) = params.acked { req_builder = req_builder.query(&[("acked", ¶m_value.to_string())]); } + if let Some(ref param_value) = params.environment { + req_builder = req_builder.query(&[("environment", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } @@ -3487,6 +3492,9 @@ pub async fn list_apps(configuration: &configuration::Configuration, params: Lis if let Some(ref param_value) = params.filter { req_builder = req_builder.query(&[("filter", ¶m_value.to_string())]); } + if let Some(ref param_value) = params.environment { + req_builder = req_builder.query(&[("environment", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } @@ -3741,6 +3749,9 @@ pub async fn list_runs(configuration: &configuration::Configuration, params: Lis if let Some(ref param_value) = params.end_at { req_builder = req_builder.query(&[("end_at", ¶m_value.to_string())]); } + if let Some(ref param_value) = params.environment { + req_builder = req_builder.query(&[("environment", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } @@ -4070,6 +4081,41 @@ pub async fn remove_team_member(configuration: &configuration::Configuration, pa } } +/// If a user doesn't have a verified email address, this API endpoint will send a new confirmation email to them +pub async fn resend_email_verification(configuration: &configuration::Configuration) -> Result, Error> { + + let uri_str = format!("{}/user/resend-verification", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &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()); + }; + + 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 })) + } +} + /// Resend a team invitation to a user if they need a reminder or if they lost it pub async fn resend_team_invitation(configuration: &configuration::Configuration, params: ResendTeamInvitationParams) -> Result, Error> { @@ -4174,6 +4220,9 @@ pub async fn search_runs(configuration: &configuration::Configuration, params: S if let Some(ref param_value) = params.end_at { req_builder = req_builder.query(&[("end_at", ¶m_value.to_string())]); } + if let Some(ref param_value) = params.environment { + req_builder = req_builder.query(&[("environment", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } @@ -4665,3 +4714,39 @@ pub async fn update_user(configuration: &configuration::Configuration, params: U } } +/// If the user hasn't verified their email address, this API endpoint allows them to send a confirmation token they received via email to indeed verify they can receive emails. +pub async fn verify_email(configuration: &configuration::Configuration, params: VerifyEmailParams) -> Result, Error> { + + let uri_str = format!("{}/user/verify", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &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.verify_email_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 })) + } +} + diff --git a/crates/tower-api/src/apis/feature_flags_api.rs b/crates/tower-api/src/apis/feature_flags_api.rs new file mode 100644 index 00000000..e694ea08 --- /dev/null +++ b/crates/tower-api/src/apis/feature_flags_api.rs @@ -0,0 +1,75 @@ +/* + * Tower API + * + * REST API to interact with Tower Services. + * + * The version of the OpenAPI document: v0.7.6 + * Contact: hello@tower.dev + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + +const DEFAULT_TOWER_TRACE_ID: &str = "(none)"; + +/// struct for passing parameters to the method [`get_feature_flag_value`] +#[derive(Clone, Debug)] +pub struct GetFeatureFlagValueParams { + /// The feature flag key + pub key: String +} + + +/// struct for typed successes of method [`get_feature_flag_value`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetFeatureFlagValueSuccess { + Status200(models::GetFeatureFlagResponseBody), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_feature_flag_value`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetFeatureFlagValueError { + DefaultResponse(models::ErrorModel), + UnknownValue(serde_json::Value), +} + + +/// Get the current value of a feature flag. Returns the flag value if enabled, or a default falsey value if disabled. +pub async fn get_feature_flag_value(configuration: &configuration::Configuration, params: GetFeatureFlagValueParams) -> Result, Error> { + + let uri_str = format!("{}/feature-flags/{key}", configuration.base_path, key=crate::apis::urlencode(params.key)); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + 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 })) + } +} + diff --git a/crates/tower-api/src/apis/mod.rs b/crates/tower-api/src/apis/mod.rs index 54c07687..068ce002 100644 --- a/crates/tower-api/src/apis/mod.rs +++ b/crates/tower-api/src/apis/mod.rs @@ -113,5 +113,6 @@ impl From<&str> for ContentType { } pub mod default_api; +pub mod feature_flags_api; pub mod configuration; diff --git a/crates/tower-api/src/models/account.rs b/crates/tower-api/src/models/account.rs index b9be25f9..dc058429 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 ceffbdcd..5b2c49f5 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 20507611..89424736 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 0538dbfe..e8c30a21 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.6.27 + * The version of the OpenAPI document: v0.7.6 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -21,6 +21,8 @@ pub struct Alert { pub created_at: String, #[serde(rename = "detail")] pub detail: models::RunFailureAlert, + #[serde(rename = "environment")] + pub environment: String, #[serde(rename = "seq")] pub seq: i64, #[serde(rename = "status")] @@ -28,12 +30,13 @@ pub struct Alert { } impl Alert { - pub fn new(acked: bool, alert_type: String, created_at: String, detail: models::RunFailureAlert, seq: i64, status: String) -> Alert { + pub fn new(acked: bool, alert_type: String, created_at: String, detail: models::RunFailureAlert, environment: String, seq: i64, status: String) -> Alert { Alert { acked, alert_type, created_at, detail, + environment, seq, status, } diff --git a/crates/tower-api/src/models/api_key.rs b/crates/tower-api/src/models/api_key.rs index 65aa1a61..1f69f966 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 a92e4d25..741f37f3 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.6.27 + * The version of the OpenAPI document: v0.7.6 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -17,8 +17,8 @@ pub struct App { #[serde(rename = "created_at")] pub created_at: String, /// The health status of this app - #[serde(rename = "health_status")] - pub health_status: HealthStatus, + #[serde(rename = "health_status", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub health_status: Option>, /// The last run of this app, null if none. #[serde(rename = "last_run", skip_serializing_if = "Option::is_none")] pub last_run: Option, @@ -52,10 +52,10 @@ pub struct App { } impl App { - pub fn new(created_at: String, health_status: HealthStatus, name: String, next_run_at: Option, owner: String, schedule: Option, short_description: String, version: Option) -> App { + pub fn new(created_at: String, name: String, next_run_at: Option, owner: String, schedule: Option, short_description: String, version: Option) -> App { App { created_at, - health_status, + health_status: None, last_run: None, name, next_run_at, diff --git a/crates/tower-api/src/models/app_statistics.rs b/crates/tower-api/src/models/app_statistics.rs index c8321773..baf5b489 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 7809b315..8a69ba26 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 3c370f6c..76593b8e 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.6.27 + * The version of the OpenAPI document: v0.7.6 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/cancel_run_response.rs b/crates/tower-api/src/models/cancel_run_response.rs index 2ac391cd..5a955d42 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 2654ddb8..2be58de6 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 32d23ef2..d507e189 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 8f60c19b..b95de0b4 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 07d247af..2cb5411b 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 958d56c9..a6e51ef1 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.6.27 + * The version of the OpenAPI document: v0.7.6 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -16,32 +16,17 @@ pub struct CreateAccountParams { /// A URL to the JSON Schema for this object. #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] pub schema: Option, - #[serde(rename = "company")] - pub company: String, - #[serde(rename = "country")] - pub country: String, #[serde(rename = "email")] pub email: String, - #[serde(rename = "first_name")] - pub first_name: String, - #[serde(rename = "invite")] - pub invite: String, - #[serde(rename = "last_name")] - pub last_name: String, #[serde(rename = "password")] pub password: String, } impl CreateAccountParams { - pub fn new(company: String, country: String, email: String, first_name: String, invite: String, last_name: String, password: String) -> CreateAccountParams { + pub fn new(email: String, password: String) -> CreateAccountParams { CreateAccountParams { schema: None, - company, - country, email, - first_name, - invite, - last_name, password, } } 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 a71ee086..322910d9 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 de4c86cc..73243bb2 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 57838d09..89b5e33f 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 7e789aeb..3de095a0 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 c87259d7..7447ca16 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.6.27 + * The version of the OpenAPI document: v0.7.6 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -16,6 +16,9 @@ pub struct CreateAppParams { /// A URL to the JSON Schema for this object. #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] pub schema: Option, + /// Indicates that web traffic should be routed to this app and that its runs should get a hostname assigned to it. + #[serde(rename = "is_externally_accessible", skip_serializing_if = "Option::is_none")] + pub is_externally_accessible: Option, /// The name of the app. #[serde(rename = "name")] pub name: String, @@ -31,6 +34,7 @@ impl CreateAppParams { pub fn new(name: String) -> CreateAppParams { CreateAppParams { schema: None, + is_externally_accessible: None, name, short_description: None, slug: None, diff --git a/crates/tower-api/src/models/create_app_response.rs b/crates/tower-api/src/models/create_app_response.rs index 4fb240bc..ceade33b 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 e593e037..187417f6 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 825bce5b..966af195 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 0e222f42..74b990ea 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 d45675f2..52abae1f 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 5a829451..01bbade0 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 f8ba0792..e9bcd598 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 7fb41c81..4e99ad8b 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 761ceebc..d8deb7c7 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 1bfc214f..8d478023 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 b51a5ff4..fe85106d 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.6.27 + * The version of the OpenAPI document: v0.7.6 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_schedule_response.rs b/crates/tower-api/src/models/create_schedule_response.rs index 5ea8fd97..8e597929 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 19516ee7..3799c2e1 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 e6b4158f..d3e455f4 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 7abc0836..897a4248 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 83f42ddf..99a55f82 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 18c53b19..1b511774 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 75bc1bbb..d80c20eb 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 99cb217a..b01cbd56 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 d89d01ff..54e96643 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 af1b2e9f..a5686516 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 efa81d7c..f5a97d41 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 6db18c1f..66d5f545 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 9334b707..df6da3cd 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 new file mode 100644 index 00000000..ebc26f8c --- /dev/null +++ b/crates/tower-api/src/models/delete_schedule_params.rs @@ -0,0 +1,32 @@ +/* + * Tower API + * + * REST API to interact with Tower Services. + * + * The version of the OpenAPI document: v0.7.6 + * 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 DeleteScheduleParams { + /// 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 delete. + #[serde(rename = "ids")] + pub ids: Vec, +} + +impl DeleteScheduleParams { + pub fn new(ids: Vec) -> DeleteScheduleParams { + DeleteScheduleParams { + schema: None, + ids, + } + } +} + diff --git a/crates/tower-api/src/models/delete_schedule_response.rs b/crates/tower-api/src/models/delete_schedule_response.rs index f3a909aa..0237542b 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.6.27 + * The version of the OpenAPI document: v0.7.6 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -16,16 +16,15 @@ pub struct DeleteScheduleResponse { /// A URL to the JSON Schema for this object. #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] pub schema: Option, - /// The ID of the deleted schedule. - #[serde(rename = "id")] - pub id: String, + #[serde(rename = "the schedules successfully deleted")] + pub the_schedules_successfully_deleted: Vec, } impl DeleteScheduleResponse { - pub fn new(id: String) -> DeleteScheduleResponse { + pub fn new(the_schedules_successfully_deleted: Vec) -> DeleteScheduleResponse { DeleteScheduleResponse { schema: None, - id, + the_schedules_successfully_deleted, } } } diff --git a/crates/tower-api/src/models/delete_secret_response.rs b/crates/tower-api/src/models/delete_secret_response.rs index 04c95e28..9beee5ac 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 94cabda2..eca8094b 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 d01f02f2..43f8208b 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 778097e1..f47ea383 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 6fe1066b..16960713 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 760fef4d..41523f62 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 cb9775b5..ab9ac82d 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 77eb955b..ddca6e10 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 276d1253..51109f00 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 ab779807..ea8bb4c2 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 c47ecf88..8ccd1444 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 b5f5fa14..39eb75d8 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 5f6ed823..1d252f00 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 d66b21eb..04bc77db 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 8c3a9b36..31ca9e1c 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 e9b09217..946907fa 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 0c6c7ad2..8b096714 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 5b84a63f..9472bcf3 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 380c0511..7b9b7576 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.6.27 + * The version of the OpenAPI document: v0.7.6 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -14,7 +14,7 @@ use serde::{Deserialize, Serialize, Deserializer}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct EventLog { #[serde(rename = "data")] - pub data: models::LogLine, + pub data: models::RunLogLine, /// The event name. #[serde(rename = "event")] pub event: Event, @@ -27,7 +27,7 @@ pub struct EventLog { } impl EventLog { - pub fn new(data: models::LogLine, event: Event) -> EventLog { + pub fn new(data: models::RunLogLine, event: Event) -> EventLog { EventLog { data, event, 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 1143d8c1..00d245c5 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 30d3b160..663cd660 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 9eed5f3e..2652acf9 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 20c07993..b8f60d81 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 fa10763b..677e6107 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 556f8d28..1b07b604 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 4df878ad..7c8c0457 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 af44933c..5cad1c65 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 19b11890..1c064665 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 ca53329c..516e3573 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 a3133073..41d44e23 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 f1dc07f5..fd7a2995 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 1338f0ef..382433db 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 750fd78e..84ced574 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 ddb242b5..58c3089d 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 new file mode 100644 index 00000000..5873f584 --- /dev/null +++ b/crates/tower-api/src/models/get_feature_flag_response_body.rs @@ -0,0 +1,80 @@ +/* + * Tower API + * + * REST API to interact with Tower Services. + * + * The version of the OpenAPI document: v0.7.6 + * 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 GetFeatureFlagResponseBody { + /// A URL to the JSON Schema for this object. + #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] + pub schema: Option, + /// Whether the flag is enabled + #[serde(rename = "enabled")] + pub enabled: bool, + /// The feature flag key + #[serde(rename = "key")] + pub key: String, + #[serde(rename = "value", deserialize_with = "Option::deserialize")] + pub value: Option, + /// The type of the value + #[serde(rename = "value_type")] + pub value_type: ValueType, +} + +impl GetFeatureFlagResponseBody { + pub fn new(enabled: bool, key: String, value: Option, value_type: ValueType) -> GetFeatureFlagResponseBody { + GetFeatureFlagResponseBody { + schema: None, + enabled, + key, + value, + value_type, + } + } +} +/// The type of the value +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize)] +pub enum ValueType { + #[serde(rename = "boolean")] + Boolean, + #[serde(rename = "string")] + String, + #[serde(rename = "number")] + Number, + #[serde(rename = "object")] + Object, +} + +impl Default for ValueType { + fn default() -> ValueType { + Self::Boolean + } +} + +impl<'de> Deserialize<'de> for ValueType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + match s.to_lowercase().as_str() { + "boolean" => Ok(Self::Boolean), + "string" => Ok(Self::String), + "number" => Ok(Self::Number), + "object" => Ok(Self::Object), + _ => Err(serde::de::Error::unknown_variant( + &s, + &["boolean", "string", "number", "object"], + )), + } + } +} + 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 0887c0e8..b2ede50a 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 6503f744..2b05ddc8 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 1ce6996e..68375736 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 b2f6d019..f8804bc7 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 1fdf60dc..d6a2e521 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 2a22a32e..b343ef42 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 7ac17841..a2d53b9f 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 32783a2c..d7257395 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 fae16f65..48b9b58a 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 792473d3..72133c3b 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 caed34d0..4c71d971 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 8cf6df9f..87a0cbc0 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 0b038169..442133fe 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 e32d41ae..6ffd119f 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 c2e33c4d..3cfbb349 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 adb63697..eb3f2d7c 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 c2d5c573..c1b5187a 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 e7f01b50..304e2fb0 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 4d29b120..28f67448 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 189e74db..41c1ac5c 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 f1a6dea6..a87b64e3 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 7bafa55c..4ed36ee9 100644 --- a/crates/tower-api/src/models/mod.rs +++ b/crates/tower-api/src/models/mod.rs @@ -1,7 +1,3 @@ -pub mod accept_invitation_params; -pub use self::accept_invitation_params::AcceptInvitationParams; -pub mod accept_invitation_response; -pub use self::accept_invitation_response::AcceptInvitationResponse; pub mod account; pub use self::account::Account; pub mod acknowledge_alert_response; @@ -90,6 +86,8 @@ pub mod delete_authenticator_response; pub use self::delete_authenticator_response::DeleteAuthenticatorResponse; pub mod delete_catalog_response; pub use self::delete_catalog_response::DeleteCatalogResponse; +pub mod delete_schedule_params; +pub use self::delete_schedule_params::DeleteScheduleParams; pub mod delete_schedule_response; pub use self::delete_schedule_response::DeleteScheduleResponse; pub mod delete_secret_response; @@ -160,6 +158,8 @@ pub mod generate_run_statistics_response; pub use self::generate_run_statistics_response::GenerateRunStatisticsResponse; pub mod generate_runner_credentials_response; pub use self::generate_runner_credentials_response::GenerateRunnerCredentialsResponse; +pub mod get_feature_flag_response_body; +pub use self::get_feature_flag_response_body::GetFeatureFlagResponseBody; pub mod invite_team_member_params; pub use self::invite_team_member_params::InviteTeamMemberParams; pub mod invite_team_member_response; @@ -202,8 +202,6 @@ pub mod list_team_members_response; pub use self::list_team_members_response::ListTeamMembersResponse; pub mod list_teams_response; pub use self::list_teams_response::ListTeamsResponse; -pub mod log_line; -pub use self::log_line::LogLine; pub mod pagination; pub use self::pagination::Pagination; pub mod parameter; @@ -314,3 +312,7 @@ pub mod user; pub use self::user::User; pub mod verified_authenticator; pub use self::verified_authenticator::VerifiedAuthenticator; +pub mod verify_email_params; +pub use self::verify_email_params::VerifyEmailParams; +pub mod verify_email_response; +pub use self::verify_email_response::VerifyEmailResponse; diff --git a/crates/tower-api/src/models/pagination.rs b/crates/tower-api/src/models/pagination.rs index 5585f050..5f1816f8 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 a6451786..fa5bc1bf 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 151c540c..846d4340 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.6.27 + * The version of the OpenAPI document: v0.7.6 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -21,6 +21,8 @@ pub struct Plan { pub created_at: String, #[serde(rename = "end_at", skip_serializing_if = "Option::is_none")] pub end_at: Option, + #[serde(rename = "extras", skip_serializing_if = "Option::is_none")] + pub extras: Option, #[serde(rename = "features")] pub features: models::Features, #[serde(rename = "id")] @@ -38,6 +40,7 @@ impl Plan { base_plan_name, created_at, end_at: None, + extras: None, features, id, start_at, diff --git a/crates/tower-api/src/models/refresh_session_params.rs b/crates/tower-api/src/models/refresh_session_params.rs index 49d6cf1a..d11fbe64 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 79375a92..497bd013 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 f92f57c5..9372a426 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 838a1e17..86aa4354 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 4e9e1616..0a7a2dcf 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 9106bd81..918fff9e 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 36c76af6..6f712f38 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.6.27 + * The version of the OpenAPI document: v0.7.6 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_app_params.rs b/crates/tower-api/src/models/run_app_params.rs index 7318fd1c..76473170 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 1d258d7c..4253ab3a 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 e66b1cca..e25d9e92 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 4ec656d7..918e9d57 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.6.27 + * The version of the OpenAPI document: v0.7.6 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -13,20 +13,70 @@ use serde::{Deserialize, Serialize, Deserializer}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct RunLogLine { + /// The channel this log line belongs to. #[serde(rename = "channel")] - pub channel: String, - #[serde(rename = "message")] - pub message: String, - #[serde(rename = "timestamp")] - pub timestamp: String, + pub channel: Channel, + /// Contents of the log message. + #[serde(rename = "content")] + pub content: String, + /// Line number. + #[serde(rename = "line_num")] + pub line_num: i64, + /// This property is deprecated. Please use content instead. + #[serde(rename = "message", skip_serializing_if = "Option::is_none")] + pub message: Option, + /// Timestamp of the log line. + #[serde(rename = "reported_at")] + pub reported_at: String, + /// The uuid of the Run. + #[serde(rename = "run_id")] + pub run_id: String, + /// This property is deprecated. Please use reported_at instead. + #[serde(rename = "timestamp", skip_serializing_if = "Option::is_none")] + pub timestamp: Option, } impl RunLogLine { - pub fn new(channel: String, message: String, timestamp: String) -> RunLogLine { + pub fn new(channel: Channel, content: String, line_num: i64, reported_at: String, run_id: String) -> RunLogLine { RunLogLine { channel, - message, - timestamp, + content, + line_num, + message: None, + reported_at, + run_id, + timestamp: None, + } + } +} +/// The channel this log line belongs to. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize)] +pub enum Channel { + #[serde(rename = "program")] + Program, + #[serde(rename = "setup")] + Setup, +} + +impl Default for Channel { + fn default() -> Channel { + Self::Program + } +} + +impl<'de> Deserialize<'de> for Channel { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + match s.to_lowercase().as_str() { + "program" => Ok(Self::Program), + "setup" => Ok(Self::Setup), + _ => Err(serde::de::Error::unknown_variant( + &s, + &["program", "setup"], + )), } } } diff --git a/crates/tower-api/src/models/run_parameter.rs b/crates/tower-api/src/models/run_parameter.rs index 9d716df2..8e553690 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 b07c0dc2..75a44c5a 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 96627061..9e98ff6f 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 38c24b8f..c6b42981 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 46ccb00e..6480527a 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 63bd333d..4a82d6ec 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.6.27 + * The version of the OpenAPI document: v0.7.6 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -19,6 +19,9 @@ pub struct Schedule { /// The specific app version to run, or null for the default version #[serde(rename = "app_version", skip_serializing_if = "Option::is_none")] pub app_version: Option, + /// The timestamp when the schedule was created + #[serde(rename = "created_at")] + pub created_at: String, /// The cron expression defining when the app should run #[serde(rename = "cron")] pub cron: String, @@ -31,17 +34,22 @@ pub struct Schedule { /// The parameters to pass when running the app #[serde(rename = "parameters", skip_serializing_if = "Option::is_none")] pub parameters: Option>, + /// The timestamp when the schedule was last updated + #[serde(rename = "updated_at")] + pub updated_at: String, } impl Schedule { - pub fn new(app_name: String, cron: String, environment: String, id: String) -> Schedule { + pub fn new(app_name: String, created_at: String, cron: String, environment: String, id: String, updated_at: String) -> Schedule { Schedule { app_name, app_version: None, + created_at, cron, environment, id, parameters: None, + updated_at, } } } diff --git a/crates/tower-api/src/models/search_runs_response.rs b/crates/tower-api/src/models/search_runs_response.rs index a1727ed7..b9ad4906 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 ce2359cb..cae9e2a0 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 3f9090a8..78a08777 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 33c5f32a..fd149831 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 1b0ab33d..f839a685 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.6.27 + * The version of the OpenAPI document: v0.7.6 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -16,6 +16,9 @@ pub struct StatisticsSettings { /// The end time for the statistics period. #[serde(rename = "end_at")] pub end_at: String, + /// The environment to get statistics for. + #[serde(rename = "environment")] + pub environment: String, /// The interval for the statistics period. #[serde(rename = "interval")] pub interval: Interval, @@ -28,9 +31,10 @@ pub struct StatisticsSettings { } impl StatisticsSettings { - pub fn new(end_at: String, interval: Interval, start_at: String, timezone: String) -> StatisticsSettings { + pub fn new(end_at: String, environment: String, interval: Interval, start_at: String, timezone: String) -> StatisticsSettings { StatisticsSettings { end_at, + environment, interval, start_at, timezone, 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 a8ac7329..121bf08d 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 3dbfe984..613c2c91 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 47db460c..6c35725a 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 e3d757ed..3d33cf63 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 6ae7494a..b5187151 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 15054d38..0b76e5c7 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 9c6f3286..6bd81e14 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 9cc9f01d..91c73958 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 1b692b94..1a8d8b10 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.6.27 + * The version of the OpenAPI document: v0.7.6 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -19,6 +19,9 @@ pub struct UpdateAppParams { /// New description for the App #[serde(rename = "description")] pub description: String, + /// Indicates that web traffic should be routed to this app and that its runs should get a hostname assigned to it. + #[serde(rename = "is_externally_accessible", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub is_externally_accessible: Option>, /// New status for the App #[serde(rename = "status")] pub status: String, @@ -29,6 +32,7 @@ impl UpdateAppParams { UpdateAppParams { schema: None, description, + is_externally_accessible: None, status, } } diff --git a/crates/tower-api/src/models/update_app_response.rs b/crates/tower-api/src/models/update_app_response.rs index 4e4faa45..1da1e40b 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 63ffb054..211089de 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 386ccbb2..d5a4a230 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 453b6698..d53d4ff6 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 518d9843..57d352d2 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 8a7d9458..bf2de01d 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 7a2dccde..c581d6a5 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 53977c70..1353d35e 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 30850489..7ca98432 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 72648c48..f0790ca0 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 73ac0012..ac431b4f 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 23a870c9..f56a3ffd 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.6.27 + * The version of the OpenAPI document: v0.7.6 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -16,9 +16,6 @@ pub struct UpdateScheduleParams { /// A URL to the JSON Schema for this object. #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] pub schema: Option, - /// The name of the app that this schedule runs - #[serde(rename = "app_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub app_name: Option>, /// The specific app version to run (if omitted, will use the app's default version) #[serde(rename = "app_version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] pub app_version: Option>, @@ -37,7 +34,6 @@ impl UpdateScheduleParams { pub fn new() -> UpdateScheduleParams { UpdateScheduleParams { schema: None, - app_name: None, app_version: None, cron: None, environment: None, diff --git a/crates/tower-api/src/models/update_schedule_response.rs b/crates/tower-api/src/models/update_schedule_response.rs index 93bd656c..d735be0f 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 448461a1..8402f422 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 4fc33a70..3434a7dd 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 2503ce5e..b1978368 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.6.27 + * The version of the OpenAPI document: v0.7.6 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -16,7 +16,7 @@ pub struct UpdateTeamParams { /// A URL to the JSON Schema for this object. #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] pub schema: Option, - /// The name of the team to to update. This is optional, if you supply null it will not update the team name. + /// The name of the team to update. This is optional, if you supply null it will not update the team name. #[serde(rename = "name", deserialize_with = "Option::deserialize")] pub name: Option, } diff --git a/crates/tower-api/src/models/update_team_response.rs b/crates/tower-api/src/models/update_team_response.rs index 0cfb699e..3667c6e9 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 a22dca2e..895341c4 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 cc7e12bf..50656c4a 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 d4724aee..1f2aec78 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.6.27 + * The version of the OpenAPI document: v0.7.6 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -25,8 +25,11 @@ pub struct User { pub first_name: String, #[serde(rename = "is_alerts_enabled")] pub is_alerts_enabled: bool, - #[serde(rename = "is_invitation_claimed")] - pub is_invitation_claimed: bool, + #[serde(rename = "is_confirmed")] + pub is_confirmed: bool, + /// This property is deprecated. It will be removed in a future version. + #[serde(rename = "is_invitation_claimed", skip_serializing_if = "Option::is_none")] + pub is_invitation_claimed: Option, #[serde(rename = "last_name")] pub last_name: String, #[serde(rename = "profile_photo_url")] @@ -34,7 +37,7 @@ pub struct User { } impl User { - pub fn new(company: String, country: String, created_at: String, email: String, first_name: String, is_alerts_enabled: bool, is_invitation_claimed: bool, last_name: String, profile_photo_url: String) -> User { + pub fn new(company: String, country: String, created_at: String, email: String, first_name: String, is_alerts_enabled: bool, is_confirmed: bool, last_name: String, profile_photo_url: String) -> User { User { company, country, @@ -42,7 +45,8 @@ impl User { email, first_name, is_alerts_enabled, - is_invitation_claimed, + is_confirmed, + is_invitation_claimed: None, last_name, profile_photo_url, } diff --git a/crates/tower-api/src/models/verified_authenticator.rs b/crates/tower-api/src/models/verified_authenticator.rs index 6cc8b86b..89f9205a 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.6.27 + * The version of the OpenAPI document: v0.7.6 * 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 new file mode 100644 index 00000000..8ab702ae --- /dev/null +++ b/crates/tower-api/src/models/verify_email_params.rs @@ -0,0 +1,31 @@ +/* + * Tower API + * + * REST API to interact with Tower Services. + * + * The version of the OpenAPI document: v0.7.6 + * 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 VerifyEmailParams { + /// A URL to the JSON Schema for this object. + #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] + pub schema: Option, + #[serde(rename = "code")] + pub code: String, +} + +impl VerifyEmailParams { + pub fn new(code: String) -> VerifyEmailParams { + VerifyEmailParams { + schema: None, + code, + } + } +} + diff --git a/crates/tower-api/src/models/verify_email_response.rs b/crates/tower-api/src/models/verify_email_response.rs new file mode 100644 index 00000000..e48beccf --- /dev/null +++ b/crates/tower-api/src/models/verify_email_response.rs @@ -0,0 +1,32 @@ +/* + * Tower API + * + * REST API to interact with Tower Services. + * + * The version of the OpenAPI document: v0.7.6 + * 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 VerifyEmailResponse { + /// A URL to the JSON Schema for this object. + #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] + pub schema: Option, + /// The user that was verified + #[serde(rename = "user")] + pub user: models::User, +} + +impl VerifyEmailResponse { + pub fn new(user: models::User) -> VerifyEmailResponse { + VerifyEmailResponse { + schema: None, + user, + } + } +} + diff --git a/crates/tower-cmd/src/api.rs b/crates/tower-cmd/src/api.rs index 8930f89d..b47a63bb 100644 --- a/crates/tower-cmd/src/api.rs +++ b/crates/tower-cmd/src/api.rs @@ -42,6 +42,7 @@ pub async fn list_apps(config: &Config) -> Result Resul let params = tower_api::apis::default_api::CreateAppParams { create_app_params: tower_api::models::CreateAppParams{ + schema: None, name: name.to_string(), short_description: Some(description.to_string()), - schema: None, slug: None, + is_externally_accessible: None, }, }; @@ -221,7 +223,7 @@ pub async fn refresh_session(config: &Config) -> Result Option { match self { - Self::Status200(data) => Some(data), + Self::Status201(data) => Some(data), Self::UnknownValue(_) => None, } } @@ -465,7 +467,6 @@ impl ResponseEntity for tower_api::apis::default_api::RunAppSuccess { fn extract_data(self) -> Option { match self { - Self::Status200(data) => Some(data), Self::Status201(data) => Some(data), Self::UnknownValue(_) => None, } @@ -510,7 +511,7 @@ impl ResponseEntity for tower_api::apis::default_api::CreateAppSuccess { fn extract_data(self) -> Option { match self { - Self::Status200(resp) => Some(resp), + Self::Status201(resp) => Some(resp), Self::UnknownValue(_) => None, } } diff --git a/crates/tower-cmd/src/apps.rs b/crates/tower-cmd/src/apps.rs index 6ad153ef..83f62a10 100644 --- a/crates/tower-cmd/src/apps.rs +++ b/crates/tower-cmd/src/apps.rs @@ -56,8 +56,8 @@ pub async fn do_logs(config: Config, cmd: &ArgMatches) { if let Ok(resp) = api::describe_run_logs(&config, &name, seq).await { for line in resp.log_lines { - let ts = dates::format_str(&line.timestamp); - output::log_line(&ts, &line.message, output::LogLineType::Remote); + let ts = dates::format_str(&line.reported_at); + output::log_line(&ts, &line.content, output::LogLineType::Remote); } } } diff --git a/crates/tower-cmd/src/util/apps.rs b/crates/tower-cmd/src/util/apps.rs index 9c5e3d03..72f84177 100644 --- a/crates/tower-cmd/src/util/apps.rs +++ b/crates/tower-cmd/src/util/apps.rs @@ -72,6 +72,7 @@ pub async fn ensure_app_exists( name: app_name.to_string(), short_description: Some(description.to_string()), slug: None, + is_externally_accessible: None, // Add the missing field }, }, ) diff --git a/pyproject.toml b/pyproject.toml index 6d1bb8cf..bfafb926 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -75,4 +75,5 @@ dev = [ "pytest-httpx==0.35.0", "pytest-env>=1.1.3", "pyiceberg[sql-sqlite]==0.9.1", + "tower[iceberg]", ] diff --git a/src/tower/tower_api_client/api/default/create_api_key.py b/src/tower/tower_api_client/api/default/create_api_key.py index 9cccd382..d089a7ae 100644 --- a/src/tower/tower_api_client/api/default/create_api_key.py +++ b/src/tower/tower_api_client/api/default/create_api_key.py @@ -33,10 +33,10 @@ def _get_kwargs( def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[CreateAPIKeyResponse]: - if response.status_code == 200: - response_200 = CreateAPIKeyResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = CreateAPIKeyResponse.from_dict(response.json()) - return response_200 + return response_201 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/tower/tower_api_client/api/default/create_app.py b/src/tower/tower_api_client/api/default/create_app.py index 9d3701ae..1016979e 100644 --- a/src/tower/tower_api_client/api/default/create_app.py +++ b/src/tower/tower_api_client/api/default/create_app.py @@ -33,10 +33,10 @@ def _get_kwargs( def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[CreateAppResponse]: - if response.status_code == 200: - response_200 = CreateAppResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = CreateAppResponse.from_dict(response.json()) - return response_200 + return response_201 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/tower/tower_api_client/api/default/accept_invitation.py b/src/tower/tower_api_client/api/default/create_environment.py similarity index 67% rename from src/tower/tower_api_client/api/default/accept_invitation.py rename to src/tower/tower_api_client/api/default/create_environment.py index 3cb62388..ecf29485 100644 --- a/src/tower/tower_api_client/api/default/accept_invitation.py +++ b/src/tower/tower_api_client/api/default/create_environment.py @@ -5,20 +5,20 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.accept_invitation_params import AcceptInvitationParams -from ...models.accept_invitation_response import AcceptInvitationResponse +from ...models.create_environment_params import CreateEnvironmentParams +from ...models.create_environment_response import CreateEnvironmentResponse from ...types import Response def _get_kwargs( *, - body: AcceptInvitationParams, + body: CreateEnvironmentParams, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "post", - "url": "/accounts/invite", + "url": "/environments", } _body = body.to_dict() @@ -32,11 +32,11 @@ def _get_kwargs( def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[AcceptInvitationResponse]: - if response.status_code == 200: - response_200 = AcceptInvitationResponse.from_dict(response.json()) +) -> Optional[CreateEnvironmentResponse]: + if response.status_code == 201: + response_201 = CreateEnvironmentResponse.from_dict(response.json()) - return response_200 + return response_201 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -45,7 +45,7 @@ def _parse_response( def _build_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[AcceptInvitationResponse]: +) -> Response[CreateEnvironmentResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,21 +57,21 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - body: AcceptInvitationParams, -) -> Response[AcceptInvitationResponse]: - """Accept an invitation code + body: CreateEnvironmentParams, +) -> Response[CreateEnvironmentResponse]: + """Create environment - Accept an invitation code to join an account + Create a new environment for an app. Args: - body (AcceptInvitationParams): + body (CreateEnvironmentParams): 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[AcceptInvitationResponse] + Response[CreateEnvironmentResponse] """ kwargs = _get_kwargs( @@ -88,21 +88,21 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - body: AcceptInvitationParams, -) -> Optional[AcceptInvitationResponse]: - """Accept an invitation code + body: CreateEnvironmentParams, +) -> Optional[CreateEnvironmentResponse]: + """Create environment - Accept an invitation code to join an account + Create a new environment for an app. Args: - body (AcceptInvitationParams): + body (CreateEnvironmentParams): 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: - AcceptInvitationResponse + CreateEnvironmentResponse """ return sync_detailed( @@ -114,21 +114,21 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - body: AcceptInvitationParams, -) -> Response[AcceptInvitationResponse]: - """Accept an invitation code + body: CreateEnvironmentParams, +) -> Response[CreateEnvironmentResponse]: + """Create environment - Accept an invitation code to join an account + Create a new environment for an app. Args: - body (AcceptInvitationParams): + body (CreateEnvironmentParams): 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[AcceptInvitationResponse] + Response[CreateEnvironmentResponse] """ kwargs = _get_kwargs( @@ -143,21 +143,21 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - body: AcceptInvitationParams, -) -> Optional[AcceptInvitationResponse]: - """Accept an invitation code + body: CreateEnvironmentParams, +) -> Optional[CreateEnvironmentResponse]: + """Create environment - Accept an invitation code to join an account + Create a new environment for an app. Args: - body (AcceptInvitationParams): + body (CreateEnvironmentParams): 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: - AcceptInvitationResponse + CreateEnvironmentResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/create_schedule.py b/src/tower/tower_api_client/api/default/create_schedule.py index 2b65f22b..17cbf4fd 100644 --- a/src/tower/tower_api_client/api/default/create_schedule.py +++ b/src/tower/tower_api_client/api/default/create_schedule.py @@ -33,10 +33,10 @@ def _get_kwargs( def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[CreateScheduleResponse]: - if response.status_code == 200: - response_200 = CreateScheduleResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = CreateScheduleResponse.from_dict(response.json()) - return response_200 + return response_201 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/tower/tower_api_client/api/default/create_secret.py b/src/tower/tower_api_client/api/default/create_secret.py index 1907aaa7..5513c6b5 100644 --- a/src/tower/tower_api_client/api/default/create_secret.py +++ b/src/tower/tower_api_client/api/default/create_secret.py @@ -33,10 +33,10 @@ def _get_kwargs( def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[CreateSecretResponse]: - if response.status_code == 200: - response_200 = CreateSecretResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = CreateSecretResponse.from_dict(response.json()) - return response_200 + return response_201 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/tower/tower_api_client/api/default/delete_catalog.py b/src/tower/tower_api_client/api/default/delete_catalog.py index b19f3355..64ac281b 100644 --- a/src/tower/tower_api_client/api/default/delete_catalog.py +++ b/src/tower/tower_api_client/api/default/delete_catalog.py @@ -34,10 +34,10 @@ def _get_kwargs( def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[DeleteCatalogResponse]: - if response.status_code == 200: - response_200 = DeleteCatalogResponse.from_dict(response.json()) + if response.status_code == 204: + response_204 = DeleteCatalogResponse.from_dict(response.json()) - return response_200 + return response_204 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/tower/tower_api_client/api/default/delete_schedule.py b/src/tower/tower_api_client/api/default/delete_schedule.py index dafcee8e..ffa13287 100644 --- a/src/tower/tower_api_client/api/default/delete_schedule.py +++ b/src/tower/tower_api_client/api/default/delete_schedule.py @@ -5,20 +5,28 @@ from ... import errors from ...client import AuthenticatedClient, Client +from ...models.delete_schedule_params import DeleteScheduleParams from ...models.delete_schedule_response import DeleteScheduleResponse from ...types import Response def _get_kwargs( - id: str, + *, + body: DeleteScheduleParams, ) -> dict[str, Any]: + headers: dict[str, Any] = {} + _kwargs: dict[str, Any] = { "method": "delete", - "url": "/schedules/{id}".format( - id=id, - ), + "url": "/schedules", } + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers return _kwargs @@ -47,16 +55,16 @@ def _build_response( def sync_detailed( - id: str, *, client: AuthenticatedClient, + body: DeleteScheduleParams, ) -> Response[DeleteScheduleResponse]: """Delete schedule Delete an existing schedule for an app. Args: - id (str): The ID of the schedule to delete. + body (DeleteScheduleParams): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -67,7 +75,7 @@ def sync_detailed( """ kwargs = _get_kwargs( - id=id, + body=body, ) response = client.get_httpx_client().request( @@ -78,16 +86,16 @@ def sync_detailed( def sync( - id: str, *, client: AuthenticatedClient, + body: DeleteScheduleParams, ) -> Optional[DeleteScheduleResponse]: """Delete schedule Delete an existing schedule for an app. Args: - id (str): The ID of the schedule to delete. + body (DeleteScheduleParams): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -98,22 +106,22 @@ def sync( """ return sync_detailed( - id=id, client=client, + body=body, ).parsed async def asyncio_detailed( - id: str, *, client: AuthenticatedClient, + body: DeleteScheduleParams, ) -> Response[DeleteScheduleResponse]: """Delete schedule Delete an existing schedule for an app. Args: - id (str): The ID of the schedule to delete. + body (DeleteScheduleParams): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -124,7 +132,7 @@ async def asyncio_detailed( """ kwargs = _get_kwargs( - id=id, + body=body, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -133,16 +141,16 @@ async def asyncio_detailed( async def asyncio( - id: str, *, client: AuthenticatedClient, + body: DeleteScheduleParams, ) -> Optional[DeleteScheduleResponse]: """Delete schedule Delete an existing schedule for an app. Args: - id (str): The ID of the schedule to delete. + body (DeleteScheduleParams): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -154,7 +162,7 @@ async def asyncio( return ( await asyncio_detailed( - id=id, client=client, + body=body, ) ).parsed diff --git a/src/tower/tower_api_client/api/default/deploy_app.py b/src/tower/tower_api_client/api/default/deploy_app.py index 9547e5d1..ac82ce58 100644 --- a/src/tower/tower_api_client/api/default/deploy_app.py +++ b/src/tower/tower_api_client/api/default/deploy_app.py @@ -14,11 +14,15 @@ def _get_kwargs( name: str, *, content_encoding: Union[Unset, str] = UNSET, + x_tower_checksum_sha256: Union[Unset, str] = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} if not isinstance(content_encoding, Unset): headers["Content-Encoding"] = content_encoding + if not isinstance(x_tower_checksum_sha256, Unset): + headers["X-Tower-Checksum-SHA256"] = x_tower_checksum_sha256 + _kwargs: dict[str, Any] = { "method": "post", "url": "/apps/{name}/deploy".format( @@ -33,10 +37,10 @@ def _get_kwargs( def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[Union[DeployAppResponse, ErrorModel]]: - if response.status_code == 200: - response_200 = DeployAppResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = DeployAppResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ErrorModel.from_dict(response.json()) @@ -71,6 +75,7 @@ def sync_detailed( *, client: AuthenticatedClient, content_encoding: Union[Unset, str] = UNSET, + x_tower_checksum_sha256: Union[Unset, str] = UNSET, ) -> Response[Union[DeployAppResponse, ErrorModel]]: """Deploy app @@ -80,6 +85,8 @@ def sync_detailed( Args: name (str): The name of the app to deploy. content_encoding (Union[Unset, str]): The encoding of the content. + x_tower_checksum_sha256 (Union[Unset, str]): The SHA256 hash of the content, used to + verify integrity. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -92,6 +99,7 @@ def sync_detailed( kwargs = _get_kwargs( name=name, content_encoding=content_encoding, + x_tower_checksum_sha256=x_tower_checksum_sha256, ) response = client.get_httpx_client().request( @@ -106,6 +114,7 @@ def sync( *, client: AuthenticatedClient, content_encoding: Union[Unset, str] = UNSET, + x_tower_checksum_sha256: Union[Unset, str] = UNSET, ) -> Optional[Union[DeployAppResponse, ErrorModel]]: """Deploy app @@ -115,6 +124,8 @@ def sync( Args: name (str): The name of the app to deploy. content_encoding (Union[Unset, str]): The encoding of the content. + x_tower_checksum_sha256 (Union[Unset, str]): The SHA256 hash of the content, used to + verify integrity. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -128,6 +139,7 @@ def sync( name=name, client=client, content_encoding=content_encoding, + x_tower_checksum_sha256=x_tower_checksum_sha256, ).parsed @@ -136,6 +148,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, content_encoding: Union[Unset, str] = UNSET, + x_tower_checksum_sha256: Union[Unset, str] = UNSET, ) -> Response[Union[DeployAppResponse, ErrorModel]]: """Deploy app @@ -145,6 +158,8 @@ async def asyncio_detailed( Args: name (str): The name of the app to deploy. content_encoding (Union[Unset, str]): The encoding of the content. + x_tower_checksum_sha256 (Union[Unset, str]): The SHA256 hash of the content, used to + verify integrity. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -157,6 +172,7 @@ async def asyncio_detailed( kwargs = _get_kwargs( name=name, content_encoding=content_encoding, + x_tower_checksum_sha256=x_tower_checksum_sha256, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -169,6 +185,7 @@ async def asyncio( *, client: AuthenticatedClient, content_encoding: Union[Unset, str] = UNSET, + x_tower_checksum_sha256: Union[Unset, str] = UNSET, ) -> Optional[Union[DeployAppResponse, ErrorModel]]: """Deploy app @@ -178,6 +195,8 @@ async def asyncio( Args: name (str): The name of the app to deploy. content_encoding (Union[Unset, str]): The encoding of the content. + x_tower_checksum_sha256 (Union[Unset, str]): The SHA256 hash of the content, used to + verify integrity. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -192,5 +211,6 @@ async def asyncio( name=name, client=client, content_encoding=content_encoding, + x_tower_checksum_sha256=x_tower_checksum_sha256, ) ).parsed diff --git a/src/tower/tower_api_client/api/default/generate_app_statistics.py b/src/tower/tower_api_client/api/default/generate_app_statistics.py index 35a92e33..c778e47c 100644 --- a/src/tower/tower_api_client/api/default/generate_app_statistics.py +++ b/src/tower/tower_api_client/api/default/generate_app_statistics.py @@ -6,13 +6,23 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.generate_app_statistics_response import GenerateAppStatisticsResponse -from ...types import Response +from ...types import UNSET, Response, Unset -def _get_kwargs() -> dict[str, Any]: +def _get_kwargs( + *, + environment: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["environment"] = environment + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + _kwargs: dict[str, Any] = { "method": "get", "url": "/stats/apps", + "params": params, } return _kwargs @@ -45,11 +55,16 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, + environment: Union[Unset, str] = UNSET, ) -> Response[GenerateAppStatisticsResponse]: """Generate app statistics Generates current statistics about apps + Args: + environment (Union[Unset, str]): The environment to filter the statistics by. If not + provided, statistics for all environments will be returned. + 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. @@ -58,7 +73,9 @@ def sync_detailed( Response[GenerateAppStatisticsResponse] """ - kwargs = _get_kwargs() + kwargs = _get_kwargs( + environment=environment, + ) response = client.get_httpx_client().request( **kwargs, @@ -70,11 +87,16 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, + environment: Union[Unset, str] = UNSET, ) -> Optional[GenerateAppStatisticsResponse]: """Generate app statistics Generates current statistics about apps + Args: + environment (Union[Unset, str]): The environment to filter the statistics by. If not + provided, statistics for all environments will be returned. + 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. @@ -85,17 +107,23 @@ def sync( return sync_detailed( client=client, + environment=environment, ).parsed async def asyncio_detailed( *, client: AuthenticatedClient, + environment: Union[Unset, str] = UNSET, ) -> Response[GenerateAppStatisticsResponse]: """Generate app statistics Generates current statistics about apps + Args: + environment (Union[Unset, str]): The environment to filter the statistics by. If not + provided, statistics for all environments will be returned. + 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. @@ -104,7 +132,9 @@ async def asyncio_detailed( Response[GenerateAppStatisticsResponse] """ - kwargs = _get_kwargs() + kwargs = _get_kwargs( + environment=environment, + ) response = await client.get_async_httpx_client().request(**kwargs) @@ -114,11 +144,16 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, + environment: Union[Unset, str] = UNSET, ) -> Optional[GenerateAppStatisticsResponse]: """Generate app statistics Generates current statistics about apps + Args: + environment (Union[Unset, str]): The environment to filter the statistics by. If not + provided, statistics for all environments will be returned. + 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. @@ -130,5 +165,6 @@ async def asyncio( return ( await asyncio_detailed( client=client, + environment=environment, ) ).parsed diff --git a/src/tower/tower_api_client/api/default/generate_run_statistics.py b/src/tower/tower_api_client/api/default/generate_run_statistics.py index 001634c5..642f54d5 100644 --- a/src/tower/tower_api_client/api/default/generate_run_statistics.py +++ b/src/tower/tower_api_client/api/default/generate_run_statistics.py @@ -19,6 +19,7 @@ def _get_kwargs( start_at: datetime.datetime, end_at: datetime.datetime, timezone: Union[Unset, str] = "UTC", + environment: Union[Unset, str] = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -39,6 +40,8 @@ def _get_kwargs( params["timezone"] = timezone + params["environment"] = environment + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} _kwargs: dict[str, Any] = { @@ -81,6 +84,7 @@ def sync_detailed( start_at: datetime.datetime, end_at: datetime.datetime, timezone: Union[Unset, str] = "UTC", + environment: Union[Unset, str] = UNSET, ) -> Response[GenerateRunStatisticsResponse]: """Generate run statistics @@ -93,6 +97,8 @@ def sync_detailed( end_at (datetime.datetime): End date and time for statistics (inclusive) timezone (Union[Unset, str]): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to UTC. Default: 'UTC'. + environment (Union[Unset, str]): Filter runs by environment. If not provided, all + environments will be included. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -107,6 +113,7 @@ def sync_detailed( start_at=start_at, end_at=end_at, timezone=timezone, + environment=environment, ) response = client.get_httpx_client().request( @@ -123,6 +130,7 @@ def sync( start_at: datetime.datetime, end_at: datetime.datetime, timezone: Union[Unset, str] = "UTC", + environment: Union[Unset, str] = UNSET, ) -> Optional[GenerateRunStatisticsResponse]: """Generate run statistics @@ -135,6 +143,8 @@ def sync( end_at (datetime.datetime): End date and time for statistics (inclusive) timezone (Union[Unset, str]): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to UTC. Default: 'UTC'. + environment (Union[Unset, str]): Filter runs by environment. If not provided, all + environments will be included. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,6 +160,7 @@ def sync( start_at=start_at, end_at=end_at, timezone=timezone, + environment=environment, ).parsed @@ -160,6 +171,7 @@ async def asyncio_detailed( start_at: datetime.datetime, end_at: datetime.datetime, timezone: Union[Unset, str] = "UTC", + environment: Union[Unset, str] = UNSET, ) -> Response[GenerateRunStatisticsResponse]: """Generate run statistics @@ -172,6 +184,8 @@ async def asyncio_detailed( end_at (datetime.datetime): End date and time for statistics (inclusive) timezone (Union[Unset, str]): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to UTC. Default: 'UTC'. + environment (Union[Unset, str]): Filter runs by environment. If not provided, all + environments will be included. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -186,6 +200,7 @@ async def asyncio_detailed( start_at=start_at, end_at=end_at, timezone=timezone, + environment=environment, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -200,6 +215,7 @@ async def asyncio( start_at: datetime.datetime, end_at: datetime.datetime, timezone: Union[Unset, str] = "UTC", + environment: Union[Unset, str] = UNSET, ) -> Optional[GenerateRunStatisticsResponse]: """Generate run statistics @@ -212,6 +228,8 @@ async def asyncio( end_at (datetime.datetime): End date and time for statistics (inclusive) timezone (Union[Unset, str]): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to UTC. Default: 'UTC'. + environment (Union[Unset, str]): Filter runs by environment. If not provided, all + environments will be included. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -228,5 +246,6 @@ async def asyncio( start_at=start_at, end_at=end_at, timezone=timezone, + environment=environment, ) ).parsed diff --git a/src/tower/tower_api_client/api/default/list_alerts.py b/src/tower/tower_api_client/api/default/list_alerts.py index b154f827..a69576b3 100644 --- a/src/tower/tower_api_client/api/default/list_alerts.py +++ b/src/tower/tower_api_client/api/default/list_alerts.py @@ -18,6 +18,7 @@ def _get_kwargs( page: Union[Unset, int] = UNSET, page_size: Union[Unset, int] = UNSET, acked: Union[Unset, str] = UNSET, + environment: Union[Unset, str] = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -39,6 +40,8 @@ def _get_kwargs( params["acked"] = acked + params["environment"] = environment + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} _kwargs: dict[str, Any] = { @@ -83,6 +86,7 @@ def sync_detailed( page: Union[Unset, int] = UNSET, page_size: Union[Unset, int] = UNSET, acked: Union[Unset, str] = UNSET, + environment: Union[Unset, str] = UNSET, ) -> Response[ListAlertsResponse]: """List alerts @@ -97,6 +101,7 @@ def sync_detailed( page (Union[Unset, int]): The page number to fetch. page_size (Union[Unset, int]): The number of records to fetch on each page. acked (Union[Unset, str]): Filter alerts by acknowledged status. + environment (Union[Unset, str]): Filter alerts by environment (e.g., production, staging) Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -113,6 +118,7 @@ def sync_detailed( page=page, page_size=page_size, acked=acked, + environment=environment, ) response = client.get_httpx_client().request( @@ -131,6 +137,7 @@ def sync( page: Union[Unset, int] = UNSET, page_size: Union[Unset, int] = UNSET, acked: Union[Unset, str] = UNSET, + environment: Union[Unset, str] = UNSET, ) -> Optional[ListAlertsResponse]: """List alerts @@ -145,6 +152,7 @@ def sync( page (Union[Unset, int]): The page number to fetch. page_size (Union[Unset, int]): The number of records to fetch on each page. acked (Union[Unset, str]): Filter alerts by acknowledged status. + environment (Union[Unset, str]): Filter alerts by environment (e.g., production, staging) Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -162,6 +170,7 @@ def sync( page=page, page_size=page_size, acked=acked, + environment=environment, ).parsed @@ -174,6 +183,7 @@ async def asyncio_detailed( page: Union[Unset, int] = UNSET, page_size: Union[Unset, int] = UNSET, acked: Union[Unset, str] = UNSET, + environment: Union[Unset, str] = UNSET, ) -> Response[ListAlertsResponse]: """List alerts @@ -188,6 +198,7 @@ async def asyncio_detailed( page (Union[Unset, int]): The page number to fetch. page_size (Union[Unset, int]): The number of records to fetch on each page. acked (Union[Unset, str]): Filter alerts by acknowledged status. + environment (Union[Unset, str]): Filter alerts by environment (e.g., production, staging) Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -204,6 +215,7 @@ async def asyncio_detailed( page=page, page_size=page_size, acked=acked, + environment=environment, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -220,6 +232,7 @@ async def asyncio( page: Union[Unset, int] = UNSET, page_size: Union[Unset, int] = UNSET, acked: Union[Unset, str] = UNSET, + environment: Union[Unset, str] = UNSET, ) -> Optional[ListAlertsResponse]: """List alerts @@ -234,6 +247,7 @@ async def asyncio( page (Union[Unset, int]): The page number to fetch. page_size (Union[Unset, int]): The number of records to fetch on each page. acked (Union[Unset, str]): Filter alerts by acknowledged status. + environment (Union[Unset, str]): Filter alerts by environment (e.g., production, staging) Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -252,5 +266,6 @@ async def asyncio( page=page, page_size=page_size, acked=acked, + environment=environment, ) ).parsed diff --git a/src/tower/tower_api_client/api/default/list_apps.py b/src/tower/tower_api_client/api/default/list_apps.py index 03be8d0f..360d563c 100644 --- a/src/tower/tower_api_client/api/default/list_apps.py +++ b/src/tower/tower_api_client/api/default/list_apps.py @@ -19,6 +19,7 @@ def _get_kwargs( num_runs: Union[Unset, int] = 20, sort: Union[Unset, ListAppsSort] = ListAppsSort.CREATED_AT, filter_: Union[Unset, ListAppsFilter] = UNSET, + environment: Union[Unset, str] = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -42,6 +43,8 @@ def _get_kwargs( params["filter"] = json_filter_ + params["environment"] = environment + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} _kwargs: dict[str, Any] = { @@ -86,6 +89,7 @@ def sync_detailed( num_runs: Union[Unset, int] = 20, sort: Union[Unset, ListAppsSort] = ListAppsSort.CREATED_AT, filter_: Union[Unset, ListAppsFilter] = UNSET, + environment: Union[Unset, str] = UNSET, ) -> Response[ListAppsResponse]: """List apps @@ -100,6 +104,8 @@ def sync_detailed( sort (Union[Unset, ListAppsSort]): Sort order for the results. Default: ListAppsSort.CREATED_AT. filter_ (Union[Unset, ListAppsFilter]): Filter to see apps with certain statuses. + environment (Union[Unset, str]): The environment to filter the apps by. If not provided, + apps for all environments will be returned. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -116,6 +122,7 @@ def sync_detailed( num_runs=num_runs, sort=sort, filter_=filter_, + environment=environment, ) response = client.get_httpx_client().request( @@ -134,6 +141,7 @@ def sync( num_runs: Union[Unset, int] = 20, sort: Union[Unset, ListAppsSort] = ListAppsSort.CREATED_AT, filter_: Union[Unset, ListAppsFilter] = UNSET, + environment: Union[Unset, str] = UNSET, ) -> Optional[ListAppsResponse]: """List apps @@ -148,6 +156,8 @@ def sync( sort (Union[Unset, ListAppsSort]): Sort order for the results. Default: ListAppsSort.CREATED_AT. filter_ (Union[Unset, ListAppsFilter]): Filter to see apps with certain statuses. + environment (Union[Unset, str]): The environment to filter the apps by. If not provided, + apps for all environments will be returned. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -165,6 +175,7 @@ def sync( num_runs=num_runs, sort=sort, filter_=filter_, + environment=environment, ).parsed @@ -177,6 +188,7 @@ async def asyncio_detailed( num_runs: Union[Unset, int] = 20, sort: Union[Unset, ListAppsSort] = ListAppsSort.CREATED_AT, filter_: Union[Unset, ListAppsFilter] = UNSET, + environment: Union[Unset, str] = UNSET, ) -> Response[ListAppsResponse]: """List apps @@ -191,6 +203,8 @@ async def asyncio_detailed( sort (Union[Unset, ListAppsSort]): Sort order for the results. Default: ListAppsSort.CREATED_AT. filter_ (Union[Unset, ListAppsFilter]): Filter to see apps with certain statuses. + environment (Union[Unset, str]): The environment to filter the apps by. If not provided, + apps for all environments will be returned. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -207,6 +221,7 @@ async def asyncio_detailed( num_runs=num_runs, sort=sort, filter_=filter_, + environment=environment, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -223,6 +238,7 @@ async def asyncio( num_runs: Union[Unset, int] = 20, sort: Union[Unset, ListAppsSort] = ListAppsSort.CREATED_AT, filter_: Union[Unset, ListAppsFilter] = UNSET, + environment: Union[Unset, str] = UNSET, ) -> Optional[ListAppsResponse]: """List apps @@ -237,6 +253,8 @@ async def asyncio( sort (Union[Unset, ListAppsSort]): Sort order for the results. Default: ListAppsSort.CREATED_AT. filter_ (Union[Unset, ListAppsFilter]): Filter to see apps with certain statuses. + environment (Union[Unset, str]): The environment to filter the apps by. If not provided, + apps for all environments will be returned. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -255,5 +273,6 @@ async def asyncio( num_runs=num_runs, sort=sort, filter_=filter_, + environment=environment, ) ).parsed diff --git a/src/tower/tower_api_client/api/default/list_environments.py b/src/tower/tower_api_client/api/default/list_environments.py new file mode 100644 index 00000000..a8c81ccb --- /dev/null +++ b/src/tower/tower_api_client/api/default/list_environments.py @@ -0,0 +1,134 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.list_environments_response import ListEnvironmentsResponse +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/environments", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ListEnvironmentsResponse]: + if response.status_code == 200: + response_200 = ListEnvironmentsResponse.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[ListEnvironmentsResponse]: + 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, +) -> Response[ListEnvironmentsResponse]: + """List environments + + List all environments in your account. + + 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[ListEnvironmentsResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> Optional[ListEnvironmentsResponse]: + """List environments + + List all environments in your account. + + 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: + ListEnvironmentsResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[ListEnvironmentsResponse]: + """List environments + + List all environments in your account. + + 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[ListEnvironmentsResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> Optional[ListEnvironmentsResponse]: + """List environments + + List all environments in your account. + + 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: + ListEnvironmentsResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/list_plans.py b/src/tower/tower_api_client/api/default/list_plans.py new file mode 100644 index 00000000..53a91914 --- /dev/null +++ b/src/tower/tower_api_client/api/default/list_plans.py @@ -0,0 +1,181 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.list_account_plans_response import ListAccountPlansResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["page"] = page + + params["page_size"] = page_size + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/plans", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ListAccountPlansResponse]: + if response.status_code == 200: + response_200 = ListAccountPlansResponse.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[ListAccountPlansResponse]: + 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, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, +) -> Response[ListAccountPlansResponse]: + """List account plans + + List active and past account plans for the current account. + + Args: + page (Union[Unset, int]): The page number to fetch. Default: 1. + page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. + + 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[ListAccountPlansResponse] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, +) -> Optional[ListAccountPlansResponse]: + """List account plans + + List active and past account plans for the current account. + + Args: + page (Union[Unset, int]): The page number to fetch. Default: 1. + page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. + + 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: + ListAccountPlansResponse + """ + + return sync_detailed( + client=client, + page=page, + page_size=page_size, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, +) -> Response[ListAccountPlansResponse]: + """List account plans + + List active and past account plans for the current account. + + Args: + page (Union[Unset, int]): The page number to fetch. Default: 1. + page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. + + 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[ListAccountPlansResponse] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, +) -> Optional[ListAccountPlansResponse]: + """List account plans + + List active and past account plans for the current account. + + Args: + page (Union[Unset, int]): The page number to fetch. Default: 1. + page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. + + 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: + ListAccountPlansResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + page_size=page_size, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/list_runs.py b/src/tower/tower_api_client/api/default/list_runs.py index 11d31a1a..0399ca87 100644 --- a/src/tower/tower_api_client/api/default/list_runs.py +++ b/src/tower/tower_api_client/api/default/list_runs.py @@ -19,6 +19,7 @@ def _get_kwargs( status: Union[Unset, list[ListRunsStatusItem]] = UNSET, start_at: Union[Unset, datetime.datetime] = UNSET, end_at: Union[Unset, datetime.datetime] = UNSET, + environment: Union[Unset, str] = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -45,6 +46,8 @@ def _get_kwargs( json_end_at = end_at.isoformat() params["end_at"] = json_end_at + params["environment"] = environment + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} _kwargs: dict[str, Any] = { @@ -91,6 +94,7 @@ def sync_detailed( status: Union[Unset, list[ListRunsStatusItem]] = UNSET, start_at: Union[Unset, datetime.datetime] = UNSET, end_at: Union[Unset, datetime.datetime] = UNSET, + environment: Union[Unset, str] = UNSET, ) -> Response[ListRunsResponse]: """List runs @@ -107,6 +111,8 @@ def sync_detailed( datetime (inclusive) end_at (Union[Unset, datetime.datetime]): Filter runs scheduled before or at this datetime (inclusive) + environment (Union[Unset, str]): Filter runs by environment. If not provided, all + environments will be included. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -123,6 +129,7 @@ def sync_detailed( status=status, start_at=start_at, end_at=end_at, + environment=environment, ) response = client.get_httpx_client().request( @@ -141,6 +148,7 @@ def sync( status: Union[Unset, list[ListRunsStatusItem]] = UNSET, start_at: Union[Unset, datetime.datetime] = UNSET, end_at: Union[Unset, datetime.datetime] = UNSET, + environment: Union[Unset, str] = UNSET, ) -> Optional[ListRunsResponse]: """List runs @@ -157,6 +165,8 @@ def sync( datetime (inclusive) end_at (Union[Unset, datetime.datetime]): Filter runs scheduled before or at this datetime (inclusive) + environment (Union[Unset, str]): Filter runs by environment. If not provided, all + environments will be included. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -174,6 +184,7 @@ def sync( status=status, start_at=start_at, end_at=end_at, + environment=environment, ).parsed @@ -186,6 +197,7 @@ async def asyncio_detailed( status: Union[Unset, list[ListRunsStatusItem]] = UNSET, start_at: Union[Unset, datetime.datetime] = UNSET, end_at: Union[Unset, datetime.datetime] = UNSET, + environment: Union[Unset, str] = UNSET, ) -> Response[ListRunsResponse]: """List runs @@ -202,6 +214,8 @@ async def asyncio_detailed( datetime (inclusive) end_at (Union[Unset, datetime.datetime]): Filter runs scheduled before or at this datetime (inclusive) + environment (Union[Unset, str]): Filter runs by environment. If not provided, all + environments will be included. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -218,6 +232,7 @@ async def asyncio_detailed( status=status, start_at=start_at, end_at=end_at, + environment=environment, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -234,6 +249,7 @@ async def asyncio( status: Union[Unset, list[ListRunsStatusItem]] = UNSET, start_at: Union[Unset, datetime.datetime] = UNSET, end_at: Union[Unset, datetime.datetime] = UNSET, + environment: Union[Unset, str] = UNSET, ) -> Optional[ListRunsResponse]: """List runs @@ -250,6 +266,8 @@ async def asyncio( datetime (inclusive) end_at (Union[Unset, datetime.datetime]): Filter runs scheduled before or at this datetime (inclusive) + environment (Union[Unset, str]): Filter runs by environment. If not provided, all + environments will be included. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -268,5 +286,6 @@ async def asyncio( status=status, start_at=start_at, end_at=end_at, + environment=environment, ) ).parsed diff --git a/src/tower/tower_api_client/api/default/resend_email_verification.py b/src/tower/tower_api_client/api/default/resend_email_verification.py new file mode 100644 index 00000000..a5f249d9 --- /dev/null +++ b/src/tower/tower_api_client/api/default/resend_email_verification.py @@ -0,0 +1,89 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/user/resend-verification", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: + if response.status_code == 204: + return None + 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[Any]: + 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, +) -> Response[Any]: + """Resent email verification + + If a user doesn't have a verified email address, this API endpoint will send a new confirmation + email to them + + 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[Any] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[Any]: + """Resent email verification + + If a user doesn't have a verified email address, this API endpoint will send a new confirmation + email to them + + 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[Any] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/src/tower/tower_api_client/api/default/run_app.py b/src/tower/tower_api_client/api/default/run_app.py index 6aabf401..47686314 100644 --- a/src/tower/tower_api_client/api/default/run_app.py +++ b/src/tower/tower_api_client/api/default/run_app.py @@ -37,10 +37,6 @@ def _get_kwargs( def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[Union[ErrorModel, RunAppResponse]]: - if response.status_code == 200: - response_200 = RunAppResponse.from_dict(response.json()) - - return response_200 if response.status_code == 201: response_201 = RunAppResponse.from_dict(response.json()) diff --git a/src/tower/tower_api_client/api/default/search_runs.py b/src/tower/tower_api_client/api/default/search_runs.py index 9999fe9b..329032d0 100644 --- a/src/tower/tower_api_client/api/default/search_runs.py +++ b/src/tower/tower_api_client/api/default/search_runs.py @@ -18,6 +18,7 @@ def _get_kwargs( status: Union[Unset, list[SearchRunsStatusItem]] = UNSET, start_at: Union[Unset, datetime.datetime] = UNSET, end_at: Union[Unset, datetime.datetime] = UNSET, + environment: Union[Unset, str] = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -44,6 +45,8 @@ def _get_kwargs( json_end_at = end_at.isoformat() params["end_at"] = json_end_at + params["environment"] = environment + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} _kwargs: dict[str, Any] = { @@ -87,6 +90,7 @@ def sync_detailed( status: Union[Unset, list[SearchRunsStatusItem]] = UNSET, start_at: Union[Unset, datetime.datetime] = UNSET, end_at: Union[Unset, datetime.datetime] = UNSET, + environment: Union[Unset, str] = UNSET, ) -> Response[SearchRunsResponse]: """Search runs @@ -101,6 +105,8 @@ def sync_detailed( (inclusive). Provide timestamps in ISO-8601 format. end_at (Union[Unset, datetime.datetime]): Filter runs scheduled before or at this datetime (inclusive). Provide timestamps in ISO-8601 format. + environment (Union[Unset, str]): Filter runs by environment. If not provided, all + environments will be included. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -116,6 +122,7 @@ def sync_detailed( status=status, start_at=start_at, end_at=end_at, + environment=environment, ) response = client.get_httpx_client().request( @@ -133,6 +140,7 @@ def sync( status: Union[Unset, list[SearchRunsStatusItem]] = UNSET, start_at: Union[Unset, datetime.datetime] = UNSET, end_at: Union[Unset, datetime.datetime] = UNSET, + environment: Union[Unset, str] = UNSET, ) -> Optional[SearchRunsResponse]: """Search runs @@ -147,6 +155,8 @@ def sync( (inclusive). Provide timestamps in ISO-8601 format. end_at (Union[Unset, datetime.datetime]): Filter runs scheduled before or at this datetime (inclusive). Provide timestamps in ISO-8601 format. + environment (Union[Unset, str]): Filter runs by environment. If not provided, all + environments will be included. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -163,6 +173,7 @@ def sync( status=status, start_at=start_at, end_at=end_at, + environment=environment, ).parsed @@ -174,6 +185,7 @@ async def asyncio_detailed( status: Union[Unset, list[SearchRunsStatusItem]] = UNSET, start_at: Union[Unset, datetime.datetime] = UNSET, end_at: Union[Unset, datetime.datetime] = UNSET, + environment: Union[Unset, str] = UNSET, ) -> Response[SearchRunsResponse]: """Search runs @@ -188,6 +200,8 @@ async def asyncio_detailed( (inclusive). Provide timestamps in ISO-8601 format. end_at (Union[Unset, datetime.datetime]): Filter runs scheduled before or at this datetime (inclusive). Provide timestamps in ISO-8601 format. + environment (Union[Unset, str]): Filter runs by environment. If not provided, all + environments will be included. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -203,6 +217,7 @@ async def asyncio_detailed( status=status, start_at=start_at, end_at=end_at, + environment=environment, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -218,6 +233,7 @@ async def asyncio( status: Union[Unset, list[SearchRunsStatusItem]] = UNSET, start_at: Union[Unset, datetime.datetime] = UNSET, end_at: Union[Unset, datetime.datetime] = UNSET, + environment: Union[Unset, str] = UNSET, ) -> Optional[SearchRunsResponse]: """Search runs @@ -232,6 +248,8 @@ async def asyncio( (inclusive). Provide timestamps in ISO-8601 format. end_at (Union[Unset, datetime.datetime]): Filter runs scheduled before or at this datetime (inclusive). Provide timestamps in ISO-8601 format. + environment (Union[Unset, str]): Filter runs by environment. If not provided, all + environments will be included. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -249,5 +267,6 @@ async def asyncio( status=status, start_at=start_at, end_at=end_at, + environment=environment, ) ).parsed diff --git a/src/tower/tower_api_client/api/default/stream_alerts.py b/src/tower/tower_api_client/api/default/stream_alerts.py index 18534507..113b0aa0 100644 --- a/src/tower/tower_api_client/api/default/stream_alerts.py +++ b/src/tower/tower_api_client/api/default/stream_alerts.py @@ -5,8 +5,10 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.run_failure_alert import RunFailureAlert -from ...models.sse_warning import SSEWarning +from ...models.stream_alerts_event_error import StreamAlertsEventError +from ...models.stream_alerts_event_run_failure_alert import ( + StreamAlertsEventRunFailureAlert, +) from ...types import Response @@ -21,7 +23,9 @@ def _get_kwargs() -> dict[str, Any]: def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[list[Union["RunFailureAlert", "SSEWarning"]]]: +) -> Optional[ + list[Union["StreamAlertsEventError", "StreamAlertsEventRunFailureAlert"]] +]: if response.status_code == 200: response_200 = [] _response_200 = response.text @@ -29,18 +33,20 @@ def _parse_response( def _parse_response_200_item( data: object, - ) -> Union["RunFailureAlert", "SSEWarning"]: + ) -> Union["StreamAlertsEventError", "StreamAlertsEventRunFailureAlert"]: try: if not isinstance(data, dict): raise TypeError() - response_200_item_type_0 = SSEWarning.from_dict(data) + response_200_item_type_0 = StreamAlertsEventError.from_dict(data) return response_200_item_type_0 except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() - response_200_item_type_1 = RunFailureAlert.from_dict(data) + response_200_item_type_1 = StreamAlertsEventRunFailureAlert.from_dict( + data + ) return response_200_item_type_1 @@ -57,7 +63,9 @@ def _parse_response_200_item( def _build_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[list[Union["RunFailureAlert", "SSEWarning"]]]: +) -> Response[ + list[Union["StreamAlertsEventError", "StreamAlertsEventRunFailureAlert"]] +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +77,9 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, -) -> Response[list[Union["RunFailureAlert", "SSEWarning"]]]: +) -> Response[ + list[Union["StreamAlertsEventError", "StreamAlertsEventRunFailureAlert"]] +]: """Stream alert notifications Streams alert notifications in real-time @@ -79,7 +89,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[list[Union['RunFailureAlert', 'SSEWarning']]] + Response[list[Union['StreamAlertsEventError', 'StreamAlertsEventRunFailureAlert']]] """ kwargs = _get_kwargs() @@ -94,7 +104,9 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, -) -> Optional[list[Union["RunFailureAlert", "SSEWarning"]]]: +) -> Optional[ + list[Union["StreamAlertsEventError", "StreamAlertsEventRunFailureAlert"]] +]: """Stream alert notifications Streams alert notifications in real-time @@ -104,7 +116,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - list[Union['RunFailureAlert', 'SSEWarning']] + list[Union['StreamAlertsEventError', 'StreamAlertsEventRunFailureAlert']] """ return sync_detailed( @@ -115,7 +127,9 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, -) -> Response[list[Union["RunFailureAlert", "SSEWarning"]]]: +) -> Response[ + list[Union["StreamAlertsEventError", "StreamAlertsEventRunFailureAlert"]] +]: """Stream alert notifications Streams alert notifications in real-time @@ -125,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[list[Union['RunFailureAlert', 'SSEWarning']]] + Response[list[Union['StreamAlertsEventError', 'StreamAlertsEventRunFailureAlert']]] """ kwargs = _get_kwargs() @@ -138,7 +152,9 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, -) -> Optional[list[Union["RunFailureAlert", "SSEWarning"]]]: +) -> Optional[ + list[Union["StreamAlertsEventError", "StreamAlertsEventRunFailureAlert"]] +]: """Stream alert notifications Streams alert notifications in real-time @@ -148,7 +164,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - list[Union['RunFailureAlert', 'SSEWarning']] + list[Union['StreamAlertsEventError', 'StreamAlertsEventRunFailureAlert']] """ return ( diff --git a/src/tower/tower_api_client/api/default/stream_run_logs.py b/src/tower/tower_api_client/api/default/stream_run_logs.py index 15e46a38..ae252d07 100644 --- a/src/tower/tower_api_client/api/default/stream_run_logs.py +++ b/src/tower/tower_api_client/api/default/stream_run_logs.py @@ -5,8 +5,8 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.log_line import LogLine -from ...models.sse_warning import SSEWarning +from ...models.stream_run_logs_event_log import StreamRunLogsEventLog +from ...models.stream_run_logs_event_warning import StreamRunLogsEventWarning from ...types import Response @@ -27,7 +27,7 @@ def _get_kwargs( def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[list[Union["LogLine", "SSEWarning"]]]: +) -> Optional[list[Union["StreamRunLogsEventLog", "StreamRunLogsEventWarning"]]]: if response.status_code == 200: response_200 = [] _response_200 = response.text @@ -35,18 +35,18 @@ def _parse_response( def _parse_response_200_item( data: object, - ) -> Union["LogLine", "SSEWarning"]: + ) -> Union["StreamRunLogsEventLog", "StreamRunLogsEventWarning"]: try: if not isinstance(data, dict): raise TypeError() - response_200_item_type_0 = LogLine.from_dict(data) + response_200_item_type_0 = StreamRunLogsEventLog.from_dict(data) return response_200_item_type_0 except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() - response_200_item_type_1 = SSEWarning.from_dict(data) + response_200_item_type_1 = StreamRunLogsEventWarning.from_dict(data) return response_200_item_type_1 @@ -63,7 +63,7 @@ def _parse_response_200_item( def _build_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[list[Union["LogLine", "SSEWarning"]]]: +) -> Response[list[Union["StreamRunLogsEventLog", "StreamRunLogsEventWarning"]]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -77,7 +77,7 @@ def sync_detailed( seq: int, *, client: AuthenticatedClient, -) -> Response[list[Union["LogLine", "SSEWarning"]]]: +) -> Response[list[Union["StreamRunLogsEventLog", "StreamRunLogsEventWarning"]]]: """Stream run logs Streams the logs associated with a particular run of an app in real-time. @@ -91,7 +91,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[list[Union['LogLine', 'SSEWarning']]] + Response[list[Union['StreamRunLogsEventLog', 'StreamRunLogsEventWarning']]] """ kwargs = _get_kwargs( @@ -111,7 +111,7 @@ def sync( seq: int, *, client: AuthenticatedClient, -) -> Optional[list[Union["LogLine", "SSEWarning"]]]: +) -> Optional[list[Union["StreamRunLogsEventLog", "StreamRunLogsEventWarning"]]]: """Stream run logs Streams the logs associated with a particular run of an app in real-time. @@ -125,7 +125,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - list[Union['LogLine', 'SSEWarning']] + list[Union['StreamRunLogsEventLog', 'StreamRunLogsEventWarning']] """ return sync_detailed( @@ -140,7 +140,7 @@ async def asyncio_detailed( seq: int, *, client: AuthenticatedClient, -) -> Response[list[Union["LogLine", "SSEWarning"]]]: +) -> Response[list[Union["StreamRunLogsEventLog", "StreamRunLogsEventWarning"]]]: """Stream run logs Streams the logs associated with a particular run of an app in real-time. @@ -154,7 +154,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[list[Union['LogLine', 'SSEWarning']]] + Response[list[Union['StreamRunLogsEventLog', 'StreamRunLogsEventWarning']]] """ kwargs = _get_kwargs( @@ -172,7 +172,7 @@ async def asyncio( seq: int, *, client: AuthenticatedClient, -) -> Optional[list[Union["LogLine", "SSEWarning"]]]: +) -> Optional[list[Union["StreamRunLogsEventLog", "StreamRunLogsEventWarning"]]]: """Stream run logs Streams the logs associated with a particular run of an app in real-time. @@ -186,7 +186,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - list[Union['LogLine', 'SSEWarning']] + list[Union['StreamRunLogsEventLog', 'StreamRunLogsEventWarning']] """ return ( diff --git a/src/tower/tower_api_client/api/default/update_environment.py b/src/tower/tower_api_client/api/default/update_environment.py new file mode 100644 index 00000000..967e1368 --- /dev/null +++ b/src/tower/tower_api_client/api/default/update_environment.py @@ -0,0 +1,183 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.update_environment_params import UpdateEnvironmentParams +from ...models.update_environment_response import UpdateEnvironmentResponse +from ...types import Response + + +def _get_kwargs( + name: str, + *, + body: UpdateEnvironmentParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/environments/{name}".format( + name=name, + ), + } + + _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[UpdateEnvironmentResponse]: + if response.status_code == 200: + response_200 = UpdateEnvironmentResponse.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[UpdateEnvironmentResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, + body: UpdateEnvironmentParams, +) -> Response[UpdateEnvironmentResponse]: + """Update environment + + Rename your environment + + Args: + name (str): The current name of the environment to update. + body (UpdateEnvironmentParams): + + 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[UpdateEnvironmentResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, + body: UpdateEnvironmentParams, +) -> Optional[UpdateEnvironmentResponse]: + """Update environment + + Rename your environment + + Args: + name (str): The current name of the environment to update. + body (UpdateEnvironmentParams): + + 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: + UpdateEnvironmentResponse + """ + + return sync_detailed( + name=name, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, + body: UpdateEnvironmentParams, +) -> Response[UpdateEnvironmentResponse]: + """Update environment + + Rename your environment + + Args: + name (str): The current name of the environment to update. + body (UpdateEnvironmentParams): + + 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[UpdateEnvironmentResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, + body: UpdateEnvironmentParams, +) -> Optional[UpdateEnvironmentResponse]: + """Update environment + + Rename your environment + + Args: + name (str): The current name of the environment to update. + body (UpdateEnvironmentParams): + + 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: + UpdateEnvironmentResponse + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/update_plan.py b/src/tower/tower_api_client/api/default/update_plan.py new file mode 100644 index 00000000..f3c5a220 --- /dev/null +++ b/src/tower/tower_api_client/api/default/update_plan.py @@ -0,0 +1,160 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.update_plan_params import UpdatePlanParams +from ...models.update_plan_response import UpdatePlanResponse +from ...types import Response + + +def _get_kwargs( + *, + body: UpdatePlanParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/plan", + } + + _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[UpdatePlanResponse]: + if response.status_code == 201: + response_201 = UpdatePlanResponse.from_dict(response.json()) + + return response_201 + 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[UpdatePlanResponse]: + 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: UpdatePlanParams, +) -> Response[UpdatePlanResponse]: + """Update plan + + Args: + body (UpdatePlanParams): + + 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[UpdatePlanResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: UpdatePlanParams, +) -> Optional[UpdatePlanResponse]: + """Update plan + + Args: + body (UpdatePlanParams): + + 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: + UpdatePlanResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: UpdatePlanParams, +) -> Response[UpdatePlanResponse]: + """Update plan + + Args: + body (UpdatePlanParams): + + 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[UpdatePlanResponse] + """ + + 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: UpdatePlanParams, +) -> Optional[UpdatePlanResponse]: + """Update plan + + Args: + body (UpdatePlanParams): + + 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: + UpdatePlanResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/verify_email.py b/src/tower/tower_api_client/api/default/verify_email.py new file mode 100644 index 00000000..916008c6 --- /dev/null +++ b/src/tower/tower_api_client/api/default/verify_email.py @@ -0,0 +1,172 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.verify_email_params import VerifyEmailParams +from ...models.verify_email_response import VerifyEmailResponse +from ...types import Response + + +def _get_kwargs( + *, + body: VerifyEmailParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/user/verify", + } + + _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[VerifyEmailResponse]: + if response.status_code == 200: + response_200 = VerifyEmailResponse.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[VerifyEmailResponse]: + 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: VerifyEmailParams, +) -> Response[VerifyEmailResponse]: + """Verify email + + If the user hasn't verified their email address, this API endpoint allows them to send a + confirmation token they received via email to indeed verify they can receive emails. + + Args: + body (VerifyEmailParams): + + 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[VerifyEmailResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: VerifyEmailParams, +) -> Optional[VerifyEmailResponse]: + """Verify email + + If the user hasn't verified their email address, this API endpoint allows them to send a + confirmation token they received via email to indeed verify they can receive emails. + + Args: + body (VerifyEmailParams): + + 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: + VerifyEmailResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: VerifyEmailParams, +) -> Response[VerifyEmailResponse]: + """Verify email + + If the user hasn't verified their email address, this API endpoint allows them to send a + confirmation token they received via email to indeed verify they can receive emails. + + Args: + body (VerifyEmailParams): + + 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[VerifyEmailResponse] + """ + + 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: VerifyEmailParams, +) -> Optional[VerifyEmailResponse]: + """Verify email + + If the user hasn't verified their email address, this API endpoint allows them to send a + confirmation token they received via email to indeed verify they can receive emails. + + Args: + body (VerifyEmailParams): + + 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: + VerifyEmailResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/feature_flags/__init__.py b/src/tower/tower_api_client/api/feature_flags/__init__.py new file mode 100644 index 00000000..2d7c0b23 --- /dev/null +++ b/src/tower/tower_api_client/api/feature_flags/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/src/tower/tower_api_client/api/feature_flags/get_feature_flag_value.py b/src/tower/tower_api_client/api/feature_flags/get_feature_flag_value.py new file mode 100644 index 00000000..30397328 --- /dev/null +++ b/src/tower/tower_api_client/api/feature_flags/get_feature_flag_value.py @@ -0,0 +1,164 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_feature_flag_response_body import GetFeatureFlagResponseBody +from ...types import Response + + +def _get_kwargs( + key: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/feature-flags/{key}".format( + key=key, + ), + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[GetFeatureFlagResponseBody]: + if response.status_code == 200: + response_200 = GetFeatureFlagResponseBody.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[GetFeatureFlagResponseBody]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + key: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[GetFeatureFlagResponseBody]: + """Get feature flag value + + Get the current value of a feature flag. Returns the flag value if enabled, or a default falsey + value if disabled. + + Args: + key (str): The feature flag key Example: SCHEDULES_ENABLED. + + 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[GetFeatureFlagResponseBody] + """ + + kwargs = _get_kwargs( + key=key, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + key: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[GetFeatureFlagResponseBody]: + """Get feature flag value + + Get the current value of a feature flag. Returns the flag value if enabled, or a default falsey + value if disabled. + + Args: + key (str): The feature flag key Example: SCHEDULES_ENABLED. + + 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: + GetFeatureFlagResponseBody + """ + + return sync_detailed( + key=key, + client=client, + ).parsed + + +async def asyncio_detailed( + key: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[GetFeatureFlagResponseBody]: + """Get feature flag value + + Get the current value of a feature flag. Returns the flag value if enabled, or a default falsey + value if disabled. + + Args: + key (str): The feature flag key Example: SCHEDULES_ENABLED. + + 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[GetFeatureFlagResponseBody] + """ + + kwargs = _get_kwargs( + key=key, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + key: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[GetFeatureFlagResponseBody]: + """Get feature flag value + + Get the current value of a feature flag. Returns the flag value if enabled, or a default falsey + value if disabled. + + Args: + key (str): The feature flag key Example: SCHEDULES_ENABLED. + + 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: + GetFeatureFlagResponseBody + """ + + return ( + await asyncio_detailed( + key=key, + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/models/__init__.py b/src/tower/tower_api_client/models/__init__.py index 135ab035..c8a34bb9 100644 --- a/src/tower/tower_api_client/models/__init__.py +++ b/src/tower/tower_api_client/models/__init__.py @@ -1,7 +1,5 @@ """Contains all the data models used in inputs/outputs""" -from .accept_invitation_params import AcceptInvitationParams -from .accept_invitation_response import AcceptInvitationResponse from .account import Account from .acknowledge_alert_response import AcknowledgeAlertResponse from .acknowledge_all_alerts_response import AcknowledgeAllAlertsResponse @@ -31,6 +29,8 @@ from .create_catalog_params_type import CreateCatalogParamsType from .create_catalog_response import CreateCatalogResponse from .create_device_login_ticket_response import CreateDeviceLoginTicketResponse +from .create_environment_params import CreateEnvironmentParams +from .create_environment_response import CreateEnvironmentResponse from .create_password_reset_params import CreatePasswordResetParams from .create_password_reset_response import CreatePasswordResetResponse from .create_schedule_params import CreateScheduleParams @@ -47,6 +47,7 @@ from .delete_authenticator_params import DeleteAuthenticatorParams from .delete_authenticator_response import DeleteAuthenticatorResponse from .delete_catalog_response import DeleteCatalogResponse +from .delete_schedule_params import DeleteScheduleParams from .delete_schedule_response import DeleteScheduleResponse from .delete_secret_response import DeleteSecretResponse from .delete_team_invitation_params import DeleteTeamInvitationParams @@ -62,6 +63,7 @@ from .describe_secrets_key_response import DescribeSecretsKeyResponse from .describe_session_response import DescribeSessionResponse from .encrypted_catalog_property import EncryptedCatalogProperty +from .environment import Environment from .error_detail import ErrorDetail from .error_model import ErrorModel from .export_catalogs_params import ExportCatalogsParams @@ -72,14 +74,20 @@ from .exported_catalog_property import ExportedCatalogProperty from .exported_secret import ExportedSecret from .featurebase_identity import FeaturebaseIdentity +from .features import Features from .generate_app_statistics_response import GenerateAppStatisticsResponse from .generate_authenticator_response import GenerateAuthenticatorResponse from .generate_run_statistics_response import GenerateRunStatisticsResponse from .generate_run_statistics_status_item import GenerateRunStatisticsStatusItem from .generate_runner_credentials_response import GenerateRunnerCredentialsResponse +from .get_feature_flag_response_body import GetFeatureFlagResponseBody +from .get_feature_flag_response_body_value_type import ( + GetFeatureFlagResponseBodyValueType, +) from .invite_team_member_params import InviteTeamMemberParams from .invite_team_member_response import InviteTeamMemberResponse from .leave_team_response import LeaveTeamResponse +from .list_account_plans_response import ListAccountPlansResponse from .list_alerts_response import ListAlertsResponse from .list_api_keys_response import ListAPIKeysResponse from .list_app_environments_response import ListAppEnvironmentsResponse @@ -89,6 +97,7 @@ from .list_apps_sort import ListAppsSort from .list_authenticators_response import ListAuthenticatorsResponse from .list_catalogs_response import ListCatalogsResponse +from .list_environments_response import ListEnvironmentsResponse from .list_my_team_invitations_response import ListMyTeamInvitationsResponse from .list_runs_response import ListRunsResponse from .list_runs_status_item import ListRunsStatusItem @@ -98,10 +107,9 @@ from .list_team_invitations_response import ListTeamInvitationsResponse from .list_team_members_response import ListTeamMembersResponse from .list_teams_response import ListTeamsResponse -from .log_line import LogLine -from .log_line_channel import LogLineChannel from .pagination import Pagination from .parameter import Parameter +from .plan import Plan from .refresh_session_params import RefreshSessionParams from .refresh_session_response import RefreshSessionResponse from .remove_team_member_params import RemoveTeamMemberParams @@ -114,6 +122,7 @@ from .run_app_response import RunAppResponse from .run_failure_alert import RunFailureAlert from .run_log_line import RunLogLine +from .run_log_line_channel import RunLogLineChannel from .run_parameter import RunParameter from .run_results import RunResults from .run_statistics import RunStatistics @@ -129,6 +138,10 @@ from .sse_warning import SSEWarning from .statistics_settings import StatisticsSettings from .statistics_settings_interval import StatisticsSettingsInterval +from .stream_alerts_event_error import StreamAlertsEventError +from .stream_alerts_event_run_failure_alert import StreamAlertsEventRunFailureAlert +from .stream_run_logs_event_log import StreamRunLogsEventLog +from .stream_run_logs_event_warning import StreamRunLogsEventWarning from .team import Team from .team_invitation import TeamInvitation from .token import Token @@ -139,10 +152,14 @@ from .update_app_response import UpdateAppResponse from .update_catalog_params import UpdateCatalogParams from .update_catalog_response import UpdateCatalogResponse +from .update_environment_params import UpdateEnvironmentParams +from .update_environment_response import UpdateEnvironmentResponse from .update_my_team_invitation_params import UpdateMyTeamInvitationParams from .update_my_team_invitation_response import UpdateMyTeamInvitationResponse from .update_password_reset_params import UpdatePasswordResetParams from .update_password_reset_response import UpdatePasswordResetResponse +from .update_plan_params import UpdatePlanParams +from .update_plan_response import UpdatePlanResponse from .update_schedule_params import UpdateScheduleParams from .update_schedule_response import UpdateScheduleResponse from .update_secret_params import UpdateSecretParams @@ -153,10 +170,10 @@ from .update_user_response import UpdateUserResponse from .user import User from .verified_authenticator import VerifiedAuthenticator +from .verify_email_params import VerifyEmailParams +from .verify_email_response import VerifyEmailResponse __all__ = ( - "AcceptInvitationParams", - "AcceptInvitationResponse", "Account", "AcknowledgeAlertResponse", "AcknowledgeAllAlertsResponse", @@ -186,6 +203,8 @@ "CreateCatalogParamsType", "CreateCatalogResponse", "CreateDeviceLoginTicketResponse", + "CreateEnvironmentParams", + "CreateEnvironmentResponse", "CreatePasswordResetParams", "CreatePasswordResetResponse", "CreateScheduleParams", @@ -202,6 +221,7 @@ "DeleteAuthenticatorParams", "DeleteAuthenticatorResponse", "DeleteCatalogResponse", + "DeleteScheduleParams", "DeleteScheduleResponse", "DeleteSecretResponse", "DeleteTeamInvitationParams", @@ -217,6 +237,7 @@ "DescribeSecretsKeyResponse", "DescribeSessionResponse", "EncryptedCatalogProperty", + "Environment", "ErrorDetail", "ErrorModel", "ExportCatalogsParams", @@ -227,14 +248,18 @@ "ExportSecretsParams", "ExportSecretsResponse", "FeaturebaseIdentity", + "Features", "GenerateAppStatisticsResponse", "GenerateAuthenticatorResponse", "GenerateRunnerCredentialsResponse", "GenerateRunStatisticsResponse", "GenerateRunStatisticsStatusItem", + "GetFeatureFlagResponseBody", + "GetFeatureFlagResponseBodyValueType", "InviteTeamMemberParams", "InviteTeamMemberResponse", "LeaveTeamResponse", + "ListAccountPlansResponse", "ListAlertsResponse", "ListAPIKeysResponse", "ListAppEnvironmentsResponse", @@ -244,6 +269,7 @@ "ListAppVersionsResponse", "ListAuthenticatorsResponse", "ListCatalogsResponse", + "ListEnvironmentsResponse", "ListMyTeamInvitationsResponse", "ListRunsResponse", "ListRunsStatusItem", @@ -253,10 +279,9 @@ "ListTeamInvitationsResponse", "ListTeamMembersResponse", "ListTeamsResponse", - "LogLine", - "LogLineChannel", "Pagination", "Parameter", + "Plan", "RefreshSessionParams", "RefreshSessionResponse", "RemoveTeamMemberParams", @@ -269,6 +294,7 @@ "RunAppResponse", "RunFailureAlert", "RunLogLine", + "RunLogLineChannel", "RunnerCredentials", "RunParameter", "RunResults", @@ -284,6 +310,10 @@ "SSEWarning", "StatisticsSettings", "StatisticsSettingsInterval", + "StreamAlertsEventError", + "StreamAlertsEventRunFailureAlert", + "StreamRunLogsEventLog", + "StreamRunLogsEventWarning", "Team", "TeamInvitation", "Token", @@ -294,10 +324,14 @@ "UpdateAppResponse", "UpdateCatalogParams", "UpdateCatalogResponse", + "UpdateEnvironmentParams", + "UpdateEnvironmentResponse", "UpdateMyTeamInvitationParams", "UpdateMyTeamInvitationResponse", "UpdatePasswordResetParams", "UpdatePasswordResetResponse", + "UpdatePlanParams", + "UpdatePlanResponse", "UpdateScheduleParams", "UpdateScheduleResponse", "UpdateSecretParams", @@ -308,4 +342,6 @@ "UpdateUserResponse", "User", "VerifiedAuthenticator", + "VerifyEmailParams", + "VerifyEmailResponse", ) diff --git a/src/tower/tower_api_client/models/alert.py b/src/tower/tower_api_client/models/alert.py index caada1f7..6cb9e9d9 100644 --- a/src/tower/tower_api_client/models/alert.py +++ b/src/tower/tower_api_client/models/alert.py @@ -20,6 +20,7 @@ class Alert: alert_type (str): created_at (datetime.datetime): detail (RunFailureAlert): + environment (str): seq (int): status (str): """ @@ -28,6 +29,7 @@ class Alert: alert_type: str created_at: datetime.datetime detail: "RunFailureAlert" + environment: str seq: int status: str @@ -40,6 +42,8 @@ def to_dict(self) -> dict[str, Any]: detail = self.detail.to_dict() + environment = self.environment + seq = self.seq status = self.status @@ -51,6 +55,7 @@ def to_dict(self) -> dict[str, Any]: "alert_type": alert_type, "created_at": created_at, "detail": detail, + "environment": environment, "seq": seq, "status": status, } @@ -71,6 +76,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: detail = RunFailureAlert.from_dict(d.pop("detail")) + environment = d.pop("environment") + seq = d.pop("seq") status = d.pop("status") @@ -80,6 +87,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: alert_type=alert_type, created_at=created_at, detail=detail, + environment=environment, seq=seq, status=status, ) diff --git a/src/tower/tower_api_client/models/app.py b/src/tower/tower_api_client/models/app.py index c2aaf2e2..38c1630e 100644 --- a/src/tower/tower_api_client/models/app.py +++ b/src/tower/tower_api_client/models/app.py @@ -22,7 +22,6 @@ class App: """ Attributes: created_at (datetime.datetime): The date and time this app was created. - health_status (AppHealthStatus): The health status of this app name (str): The name of the app. next_run_at (Union[None, datetime.datetime]): The next time this app will run as part of it's schedule, null if none. @@ -30,6 +29,7 @@ class App: schedule (Union[None, str]): The schedule associated with this app, null if none. short_description (str): A short description of the app. Can be empty. version (Union[None, str]): The current version of this app, null if none. + health_status (Union[Unset, AppHealthStatus]): The health status of this app last_run (Union[Unset, Run]): run_results (Union[Unset, RunResults]): slug (Union[Unset, str]): This property is deprecated. Please use name instead. @@ -37,13 +37,13 @@ class App: """ created_at: datetime.datetime - health_status: AppHealthStatus name: str next_run_at: Union[None, datetime.datetime] owner: str schedule: Union[None, str] short_description: str version: Union[None, str] + health_status: Union[Unset, AppHealthStatus] = UNSET last_run: Union[Unset, "Run"] = UNSET run_results: Union[Unset, "RunResults"] = UNSET slug: Union[Unset, str] = UNSET @@ -52,8 +52,6 @@ class App: def to_dict(self) -> dict[str, Any]: created_at = self.created_at.isoformat() - health_status = self.health_status.value - name = self.name next_run_at: Union[None, str] @@ -72,6 +70,10 @@ def to_dict(self) -> dict[str, Any]: version: Union[None, str] version = self.version + health_status: Union[Unset, str] = UNSET + if not isinstance(self.health_status, Unset): + health_status = self.health_status.value + last_run: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.last_run, Unset): last_run = self.last_run.to_dict() @@ -90,7 +92,6 @@ def to_dict(self) -> dict[str, Any]: field_dict.update( { "created_at": created_at, - "health_status": health_status, "name": name, "next_run_at": next_run_at, "owner": owner, @@ -99,6 +100,8 @@ def to_dict(self) -> dict[str, Any]: "version": version, } ) + if health_status is not UNSET: + field_dict["health_status"] = health_status if last_run is not UNSET: field_dict["last_run"] = last_run if run_results is not UNSET: @@ -118,8 +121,6 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) created_at = isoparse(d.pop("created_at")) - health_status = AppHealthStatus(d.pop("health_status")) - name = d.pop("name") def _parse_next_run_at(data: object) -> Union[None, datetime.datetime]: @@ -155,6 +156,13 @@ def _parse_version(data: object) -> Union[None, str]: version = _parse_version(d.pop("version")) + _health_status = d.pop("health_status", UNSET) + health_status: Union[Unset, AppHealthStatus] + if isinstance(_health_status, Unset): + health_status = UNSET + else: + health_status = AppHealthStatus(_health_status) + _last_run = d.pop("last_run", UNSET) last_run: Union[Unset, Run] if isinstance(_last_run, Unset): @@ -180,13 +188,13 @@ def _parse_version(data: object) -> Union[None, str]: app = cls( created_at=created_at, - health_status=health_status, name=name, next_run_at=next_run_at, owner=owner, schedule=schedule, short_description=short_description, version=version, + health_status=health_status, last_run=last_run, run_results=run_results, slug=slug, diff --git a/src/tower/tower_api_client/models/create_account_params.py b/src/tower/tower_api_client/models/create_account_params.py index 67563add..ddb98ddd 100644 --- a/src/tower/tower_api_client/models/create_account_params.py +++ b/src/tower/tower_api_client/models/create_account_params.py @@ -12,39 +12,19 @@ class CreateAccountParams: """ Attributes: - company (str): - country (str): email (str): - first_name (str): - invite (str): - last_name (str): password (str): schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/CreateAccountParams.json. """ - company: str - country: str email: str - first_name: str - invite: str - last_name: str password: str schema: Union[Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: - company = self.company - - country = self.country - email = self.email - first_name = self.first_name - - invite = self.invite - - last_name = self.last_name - password = self.password schema = self.schema @@ -52,12 +32,7 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update( { - "company": company, - "country": country, "email": email, - "first_name": first_name, - "invite": invite, - "last_name": last_name, "password": password, } ) @@ -69,29 +44,14 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - company = d.pop("company") - - country = d.pop("country") - email = d.pop("email") - first_name = d.pop("first_name") - - invite = d.pop("invite") - - last_name = d.pop("last_name") - password = d.pop("password") schema = d.pop("$schema", UNSET) create_account_params = cls( - company=company, - country=country, email=email, - first_name=first_name, - invite=invite, - last_name=last_name, password=password, schema=schema, ) diff --git a/src/tower/tower_api_client/models/create_app_params.py b/src/tower/tower_api_client/models/create_app_params.py index 6f54a0f9..d917fbc9 100644 --- a/src/tower/tower_api_client/models/create_app_params.py +++ b/src/tower/tower_api_client/models/create_app_params.py @@ -15,12 +15,15 @@ class CreateAppParams: name (str): The name of the app. schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/CreateAppParams.json. + is_externally_accessible (Union[Unset, bool]): Indicates that web traffic should be routed to this app and that + its runs should get a hostname assigned to it. Default: False. short_description (Union[Unset, str]): A description of the app. slug (Union[Unset, str]): The slug of the app. Legacy CLI will send it but we don't need it. """ name: str schema: Union[Unset, str] = UNSET + is_externally_accessible: Union[Unset, bool] = False short_description: Union[Unset, str] = UNSET slug: Union[Unset, str] = UNSET @@ -29,6 +32,8 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema + is_externally_accessible = self.is_externally_accessible + short_description = self.short_description slug = self.slug @@ -41,6 +46,8 @@ def to_dict(self) -> dict[str, Any]: ) if schema is not UNSET: field_dict["$schema"] = schema + if is_externally_accessible is not UNSET: + field_dict["is_externally_accessible"] = is_externally_accessible if short_description is not UNSET: field_dict["short_description"] = short_description if slug is not UNSET: @@ -55,6 +62,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: schema = d.pop("$schema", UNSET) + is_externally_accessible = d.pop("is_externally_accessible", UNSET) + short_description = d.pop("short_description", UNSET) slug = d.pop("slug", UNSET) @@ -62,6 +71,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: create_app_params = cls( name=name, schema=schema, + is_externally_accessible=is_externally_accessible, short_description=short_description, slug=slug, ) diff --git a/src/tower/tower_api_client/models/create_environment_params.py b/src/tower/tower_api_client/models/create_environment_params.py new file mode 100644 index 00000000..941bc5ac --- /dev/null +++ b/src/tower/tower_api_client/models/create_environment_params.py @@ -0,0 +1,51 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CreateEnvironmentParams") + + +@_attrs_define +class CreateEnvironmentParams: + """ + Attributes: + name (str): The name of the environment + schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CreateEnvironmentParams.json. + """ + + name: str + schema: Union[Unset, str] = UNSET + + def to_dict(self) -> dict[str, Any]: + name = self.name + + schema = self.schema + + field_dict: dict[str, Any] = {} + field_dict.update( + { + "name": name, + } + ) + 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) + name = d.pop("name") + + schema = d.pop("$schema", UNSET) + + create_environment_params = cls( + name=name, + schema=schema, + ) + + return create_environment_params diff --git a/src/tower/tower_api_client/models/create_environment_response.py b/src/tower/tower_api_client/models/create_environment_response.py new file mode 100644 index 00000000..621be5c2 --- /dev/null +++ b/src/tower/tower_api_client/models/create_environment_response.py @@ -0,0 +1,57 @@ +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.environment import Environment + + +T = TypeVar("T", bound="CreateEnvironmentResponse") + + +@_attrs_define +class CreateEnvironmentResponse: + """ + Attributes: + environment (Environment): + schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CreateEnvironmentResponse.json. + """ + + environment: "Environment" + schema: Union[Unset, str] = UNSET + + def to_dict(self) -> dict[str, Any]: + environment = self.environment.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + field_dict.update( + { + "environment": environment, + } + ) + 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.environment import Environment + + d = dict(src_dict) + environment = Environment.from_dict(d.pop("environment")) + + schema = d.pop("$schema", UNSET) + + create_environment_response = cls( + environment=environment, + schema=schema, + ) + + return create_environment_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 19992456..e526bd86 100644 --- a/src/tower/tower_api_client/models/create_schedule_params.py +++ b/src/tower/tower_api_client/models/create_schedule_params.py @@ -17,7 +17,7 @@ class CreateScheduleParams: """ Attributes: app_name (str): The name of the app to create a schedule for - cron_string (str): The cron expression defining when the app should run + cron (str): The cron expression defining when the app should run schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/CreateScheduleParams.json. app_version (Union[None, Unset, str]): The specific app version to run (if omitted, will use the app's default @@ -27,7 +27,7 @@ class CreateScheduleParams: """ app_name: str - cron_string: str + cron: str schema: Union[Unset, str] = UNSET app_version: Union[None, Unset, str] = UNSET environment: Union[Unset, str] = "default" @@ -36,7 +36,7 @@ class CreateScheduleParams: def to_dict(self) -> dict[str, Any]: app_name = self.app_name - cron_string = self.cron_string + cron = self.cron schema = self.schema @@ -59,7 +59,7 @@ def to_dict(self) -> dict[str, Any]: field_dict.update( { "app_name": app_name, - "cron_string": cron_string, + "cron": cron, } ) if schema is not UNSET: @@ -80,7 +80,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) app_name = d.pop("app_name") - cron_string = d.pop("cron_string") + cron = d.pop("cron") schema = d.pop("$schema", UNSET) @@ -104,7 +104,7 @@ def _parse_app_version(data: object) -> Union[None, Unset, str]: create_schedule_params = cls( app_name=app_name, - cron_string=cron_string, + cron=cron, schema=schema, app_version=app_version, environment=environment, diff --git a/src/tower/tower_api_client/models/delete_schedule_params.py b/src/tower/tower_api_client/models/delete_schedule_params.py new file mode 100644 index 00000000..29ee4ed6 --- /dev/null +++ b/src/tower/tower_api_client/models/delete_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="DeleteScheduleParams") + + +@_attrs_define +class DeleteScheduleParams: + """ + Attributes: + ids (list[str]): The IDs of the schedules to delete. + schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DeleteScheduleParams.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) + + delete_schedule_params = cls( + ids=ids, + schema=schema, + ) + + return delete_schedule_params diff --git a/src/tower/tower_api_client/models/delete_schedule_response.py b/src/tower/tower_api_client/models/delete_schedule_response.py index 5da8741f..cd4b334b 100644 --- a/src/tower/tower_api_client/models/delete_schedule_response.py +++ b/src/tower/tower_api_client/models/delete_schedule_response.py @@ -1,10 +1,14 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +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="DeleteScheduleResponse") @@ -12,23 +16,32 @@ class DeleteScheduleResponse: """ Attributes: - id (str): The ID of the deleted schedule. + the_schedules_successfully_deleted (list['Schedule']): schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/DeleteScheduleResponse.json. """ - id: str + the_schedules_successfully_deleted: list["Schedule"] schema: Union[Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: - id = self.id + the_schedules_successfully_deleted = [] + for ( + the_schedules_successfully_deleted_item_data + ) in self.the_schedules_successfully_deleted: + the_schedules_successfully_deleted_item = ( + the_schedules_successfully_deleted_item_data.to_dict() + ) + the_schedules_successfully_deleted.append( + the_schedules_successfully_deleted_item + ) schema = self.schema field_dict: dict[str, Any] = {} field_dict.update( { - "id": id, + "the schedules successfully deleted": the_schedules_successfully_deleted, } ) if schema is not UNSET: @@ -38,13 +51,28 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.schedule import Schedule + d = dict(src_dict) - id = d.pop("id") + the_schedules_successfully_deleted = [] + _the_schedules_successfully_deleted = d.pop( + "the schedules successfully deleted" + ) + for ( + the_schedules_successfully_deleted_item_data + ) in _the_schedules_successfully_deleted: + the_schedules_successfully_deleted_item = Schedule.from_dict( + the_schedules_successfully_deleted_item_data + ) + + the_schedules_successfully_deleted.append( + the_schedules_successfully_deleted_item + ) schema = d.pop("$schema", UNSET) delete_schedule_response = cls( - id=id, + the_schedules_successfully_deleted=the_schedules_successfully_deleted, schema=schema, ) diff --git a/src/tower/tower_api_client/models/environment.py b/src/tower/tower_api_client/models/environment.py new file mode 100644 index 00000000..8c6ec596 --- /dev/null +++ b/src/tower/tower_api_client/models/environment.py @@ -0,0 +1,39 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="Environment") + + +@_attrs_define +class Environment: + """ + Attributes: + name (str): The human readable name for the environment + """ + + name: str + + def to_dict(self) -> dict[str, Any]: + name = self.name + + field_dict: dict[str, Any] = {} + field_dict.update( + { + "name": name, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + environment = cls( + name=name, + ) + + return environment diff --git a/src/tower/tower_api_client/models/features.py b/src/tower/tower_api_client/models/features.py new file mode 100644 index 00000000..4543f273 --- /dev/null +++ b/src/tower/tower_api_client/models/features.py @@ -0,0 +1,75 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="Features") + + +@_attrs_define +class Features: + """ + Attributes: + has_self_hosted_runners (Union[Unset, bool]): Whether self-hosted runners are enabled + num_apps (Union[Unset, int]): The number of apps that can be created + num_minutes (Union[Unset, int]): The number of minutes that can be used for free per month + num_schedules (Union[Unset, int]): The number of schedules that can be created + num_team_members (Union[Unset, int]): The number of team members that can be added + """ + + has_self_hosted_runners: Union[Unset, bool] = UNSET + num_apps: Union[Unset, int] = UNSET + num_minutes: Union[Unset, int] = UNSET + num_schedules: Union[Unset, int] = UNSET + num_team_members: Union[Unset, int] = UNSET + + def to_dict(self) -> dict[str, Any]: + has_self_hosted_runners = self.has_self_hosted_runners + + num_apps = self.num_apps + + num_minutes = self.num_minutes + + num_schedules = self.num_schedules + + num_team_members = self.num_team_members + + field_dict: dict[str, Any] = {} + field_dict.update({}) + if has_self_hosted_runners is not UNSET: + field_dict["has_self_hosted_runners"] = has_self_hosted_runners + if num_apps is not UNSET: + field_dict["num_apps"] = num_apps + if num_minutes is not UNSET: + field_dict["num_minutes"] = num_minutes + if num_schedules is not UNSET: + field_dict["num_schedules"] = num_schedules + if num_team_members is not UNSET: + field_dict["num_team_members"] = num_team_members + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + has_self_hosted_runners = d.pop("has_self_hosted_runners", UNSET) + + num_apps = d.pop("num_apps", UNSET) + + num_minutes = d.pop("num_minutes", UNSET) + + num_schedules = d.pop("num_schedules", UNSET) + + num_team_members = d.pop("num_team_members", UNSET) + + features = cls( + has_self_hosted_runners=has_self_hosted_runners, + num_apps=num_apps, + num_minutes=num_minutes, + num_schedules=num_schedules, + num_team_members=num_team_members, + ) + + return features diff --git a/src/tower/tower_api_client/models/get_feature_flag_response_body.py b/src/tower/tower_api_client/models/get_feature_flag_response_body.py new file mode 100644 index 00000000..c61447c8 --- /dev/null +++ b/src/tower/tower_api_client/models/get_feature_flag_response_body.py @@ -0,0 +1,78 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.get_feature_flag_response_body_value_type import ( + GetFeatureFlagResponseBodyValueType, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="GetFeatureFlagResponseBody") + + +@_attrs_define +class GetFeatureFlagResponseBody: + """ + Attributes: + enabled (bool): Whether the flag is enabled + key (str): The feature flag key + value (Any): The flag value (type depends on value_type) + value_type (GetFeatureFlagResponseBodyValueType): The type of the value + schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/GetFeatureFlagResponseBody.json. + """ + + enabled: bool + key: str + value: Any + value_type: GetFeatureFlagResponseBodyValueType + schema: Union[Unset, str] = UNSET + + def to_dict(self) -> dict[str, Any]: + enabled = self.enabled + + key = self.key + + value = self.value + + value_type = self.value_type.value + + schema = self.schema + + field_dict: dict[str, Any] = {} + field_dict.update( + { + "enabled": enabled, + "key": key, + "value": value, + "value_type": value_type, + } + ) + 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) + enabled = d.pop("enabled") + + key = d.pop("key") + + value = d.pop("value") + + value_type = GetFeatureFlagResponseBodyValueType(d.pop("value_type")) + + schema = d.pop("$schema", UNSET) + + get_feature_flag_response_body = cls( + enabled=enabled, + key=key, + value=value, + value_type=value_type, + schema=schema, + ) + + return get_feature_flag_response_body diff --git a/src/tower/tower_api_client/models/get_feature_flag_response_body_value_type.py b/src/tower/tower_api_client/models/get_feature_flag_response_body_value_type.py new file mode 100644 index 00000000..20e19b5d --- /dev/null +++ b/src/tower/tower_api_client/models/get_feature_flag_response_body_value_type.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class GetFeatureFlagResponseBodyValueType(str, Enum): + BOOLEAN = "boolean" + NUMBER = "number" + OBJECT = "object" + STRING = "string" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/list_account_plans_response.py b/src/tower/tower_api_client/models/list_account_plans_response.py new file mode 100644 index 00000000..5831fa00 --- /dev/null +++ b/src/tower/tower_api_client/models/list_account_plans_response.py @@ -0,0 +1,75 @@ +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.pagination import Pagination + from ..models.plan import Plan + + +T = TypeVar("T", bound="ListAccountPlansResponse") + + +@_attrs_define +class ListAccountPlansResponse: + """ + Attributes: + pages (Pagination): + plans (list['Plan']): + schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ListAccountPlansResponse.json. + """ + + pages: "Pagination" + plans: list["Plan"] + schema: Union[Unset, str] = UNSET + + def to_dict(self) -> dict[str, Any]: + pages = self.pages.to_dict() + + plans = [] + for plans_item_data in self.plans: + plans_item = plans_item_data.to_dict() + plans.append(plans_item) + + schema = self.schema + + field_dict: dict[str, Any] = {} + field_dict.update( + { + "pages": pages, + "plans": plans, + } + ) + 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.pagination import Pagination + from ..models.plan import Plan + + d = dict(src_dict) + pages = Pagination.from_dict(d.pop("pages")) + + plans = [] + _plans = d.pop("plans") + for plans_item_data in _plans: + plans_item = Plan.from_dict(plans_item_data) + + plans.append(plans_item) + + schema = d.pop("$schema", UNSET) + + list_account_plans_response = cls( + pages=pages, + plans=plans, + schema=schema, + ) + + return list_account_plans_response diff --git a/src/tower/tower_api_client/models/list_environments_response.py b/src/tower/tower_api_client/models/list_environments_response.py new file mode 100644 index 00000000..fd1b8cee --- /dev/null +++ b/src/tower/tower_api_client/models/list_environments_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.environment import Environment + + +T = TypeVar("T", bound="ListEnvironmentsResponse") + + +@_attrs_define +class ListEnvironmentsResponse: + """ + Attributes: + environments (list['Environment']): + schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ListEnvironmentsResponse.json. + """ + + environments: list["Environment"] + schema: Union[Unset, str] = UNSET + + def to_dict(self) -> dict[str, Any]: + environments = [] + for environments_item_data in self.environments: + environments_item = environments_item_data.to_dict() + environments.append(environments_item) + + schema = self.schema + + field_dict: dict[str, Any] = {} + field_dict.update( + { + "environments": environments, + } + ) + 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.environment import Environment + + d = dict(src_dict) + environments = [] + _environments = d.pop("environments") + for environments_item_data in _environments: + environments_item = Environment.from_dict(environments_item_data) + + environments.append(environments_item) + + schema = d.pop("$schema", UNSET) + + list_environments_response = cls( + environments=environments, + schema=schema, + ) + + return list_environments_response diff --git a/src/tower/tower_api_client/models/log_line.py b/src/tower/tower_api_client/models/log_line.py deleted file mode 100644 index a59e58f1..00000000 --- a/src/tower/tower_api_client/models/log_line.py +++ /dev/null @@ -1,75 +0,0 @@ -import datetime -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from dateutil.parser import isoparse - -from ..models.log_line_channel import LogLineChannel - -T = TypeVar("T", bound="LogLine") - - -@_attrs_define -class LogLine: - """ - Attributes: - channel (LogLineChannel): The channel (either Program or Setup) this log line belongs to. - content (str): Contents of the log message. - line_num (int): Line number. - reported_at (datetime.datetime): Timestamp of the log line. - run_id (str): The uuid of the Run. - """ - - channel: LogLineChannel - content: str - line_num: int - reported_at: datetime.datetime - run_id: str - - def to_dict(self) -> dict[str, Any]: - channel = self.channel.value - - content = self.content - - line_num = self.line_num - - reported_at = self.reported_at.isoformat() - - run_id = self.run_id - - field_dict: dict[str, Any] = {} - field_dict.update( - { - "channel": channel, - "content": content, - "line_num": line_num, - "reported_at": reported_at, - "run_id": run_id, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - channel = LogLineChannel(d.pop("channel")) - - content = d.pop("content") - - line_num = d.pop("line_num") - - reported_at = isoparse(d.pop("reported_at")) - - run_id = d.pop("run_id") - - log_line = cls( - channel=channel, - content=content, - line_num=line_num, - reported_at=reported_at, - run_id=run_id, - ) - - return log_line diff --git a/src/tower/tower_api_client/models/plan.py b/src/tower/tower_api_client/models/plan.py new file mode 100644 index 00000000..f17575f7 --- /dev/null +++ b/src/tower/tower_api_client/models/plan.py @@ -0,0 +1,129 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.features import Features + + +T = TypeVar("T", bound="Plan") + + +@_attrs_define +class Plan: + """ + Attributes: + account_id (str): + base_plan_name (str): + created_at (datetime.datetime): + features (Features): + id (str): + start_at (datetime.datetime): + status (str): + end_at (Union[Unset, datetime.datetime]): + extras (Union[Unset, Features]): + """ + + account_id: str + base_plan_name: str + created_at: datetime.datetime + features: "Features" + id: str + start_at: datetime.datetime + status: str + end_at: Union[Unset, datetime.datetime] = UNSET + extras: Union[Unset, "Features"] = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + base_plan_name = self.base_plan_name + + created_at = self.created_at.isoformat() + + features = self.features.to_dict() + + id = self.id + + start_at = self.start_at.isoformat() + + status = self.status + + end_at: Union[Unset, str] = UNSET + if not isinstance(self.end_at, Unset): + end_at = self.end_at.isoformat() + + extras: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.extras, Unset): + extras = self.extras.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update( + { + "account_id": account_id, + "base_plan_name": base_plan_name, + "created_at": created_at, + "features": features, + "id": id, + "start_at": start_at, + "status": status, + } + ) + if end_at is not UNSET: + field_dict["end_at"] = end_at + if extras is not UNSET: + field_dict["extras"] = extras + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.features import Features + + d = dict(src_dict) + account_id = d.pop("account_id") + + base_plan_name = d.pop("base_plan_name") + + created_at = isoparse(d.pop("created_at")) + + features = Features.from_dict(d.pop("features")) + + id = d.pop("id") + + start_at = isoparse(d.pop("start_at")) + + status = d.pop("status") + + _end_at = d.pop("end_at", UNSET) + end_at: Union[Unset, datetime.datetime] + if isinstance(_end_at, Unset): + end_at = UNSET + else: + end_at = isoparse(_end_at) + + _extras = d.pop("extras", UNSET) + extras: Union[Unset, Features] + if isinstance(_extras, Unset): + extras = UNSET + else: + extras = Features.from_dict(_extras) + + plan = cls( + account_id=account_id, + base_plan_name=base_plan_name, + created_at=created_at, + features=features, + id=id, + start_at=start_at, + status=status, + end_at=end_at, + extras=extras, + ) + + return plan diff --git a/src/tower/tower_api_client/models/run.py b/src/tower/tower_api_client/models/run.py index c017ae5c..716b8ef4 100644 --- a/src/tower/tower_api_client/models/run.py +++ b/src/tower/tower_api_client/models/run.py @@ -20,6 +20,7 @@ class Run: """ Attributes: + link (str): Link to the run in the Tower UI app_name (str): app_version (str): cancelled_at (Union[None, datetime.datetime]): @@ -37,6 +38,7 @@ class Run: app_slug (Union[Unset, str]): This property is deprecated. Please use app_name instead. """ + link: str app_name: str app_version: str cancelled_at: Union[None, datetime.datetime] @@ -54,6 +56,8 @@ class Run: app_slug: Union[Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: + link = self.link + app_name = self.app_name app_version = self.app_version @@ -103,6 +107,7 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update( { + "$link": link, "app_name": app_name, "app_version": app_version, "cancelled_at": cancelled_at, @@ -129,6 +134,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.run_parameter import RunParameter d = dict(src_dict) + link = d.pop("$link") + app_name = d.pop("app_name") app_version = d.pop("app_version") @@ -209,6 +216,7 @@ def _parse_started_at(data: object) -> Union[None, datetime.datetime]: app_slug = d.pop("app_slug", UNSET) run = cls( + link=link, app_name=app_name, app_version=app_version, cancelled_at=cancelled_at, diff --git a/src/tower/tower_api_client/models/run_log_line.py b/src/tower/tower_api_client/models/run_log_line.py index 36301968..dcd98ea2 100644 --- a/src/tower/tower_api_client/models/run_log_line.py +++ b/src/tower/tower_api_client/models/run_log_line.py @@ -1,10 +1,13 @@ import datetime from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from dateutil.parser import isoparse +from ..models.run_log_line_channel import RunLogLineChannel +from ..types import UNSET, Unset + T = TypeVar("T", bound="RunLogLine") @@ -12,44 +15,85 @@ class RunLogLine: """ Attributes: - channel (str): - message (str): - timestamp (datetime.datetime): + channel (RunLogLineChannel): The channel this log line belongs to. + content (str): Contents of the log message. + line_num (int): Line number. + reported_at (datetime.datetime): Timestamp of the log line. + run_id (str): The uuid of the Run. + message (Union[Unset, str]): This property is deprecated. Please use content instead. + timestamp (Union[Unset, datetime.datetime]): This property is deprecated. Please use reported_at instead. """ - channel: str - message: str - timestamp: datetime.datetime + channel: RunLogLineChannel + content: str + line_num: int + reported_at: datetime.datetime + run_id: str + message: Union[Unset, str] = UNSET + timestamp: Union[Unset, datetime.datetime] = UNSET def to_dict(self) -> dict[str, Any]: - channel = self.channel + channel = self.channel.value + + content = self.content + + line_num = self.line_num + + reported_at = self.reported_at.isoformat() + + run_id = self.run_id message = self.message - timestamp = self.timestamp.isoformat() + timestamp: Union[Unset, str] = UNSET + if not isinstance(self.timestamp, Unset): + timestamp = self.timestamp.isoformat() field_dict: dict[str, Any] = {} field_dict.update( { "channel": channel, - "message": message, - "timestamp": timestamp, + "content": content, + "line_num": line_num, + "reported_at": reported_at, + "run_id": run_id, } ) + if message is not UNSET: + field_dict["message"] = message + if timestamp is not UNSET: + field_dict["timestamp"] = timestamp return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - channel = d.pop("channel") + channel = RunLogLineChannel(d.pop("channel")) + + content = d.pop("content") + + line_num = d.pop("line_num") + + reported_at = isoparse(d.pop("reported_at")) + + run_id = d.pop("run_id") - message = d.pop("message") + message = d.pop("message", UNSET) - timestamp = isoparse(d.pop("timestamp")) + _timestamp = d.pop("timestamp", UNSET) + timestamp: Union[Unset, datetime.datetime] + if isinstance(_timestamp, Unset): + timestamp = UNSET + else: + timestamp = isoparse(_timestamp) run_log_line = cls( channel=channel, + content=content, + line_num=line_num, + reported_at=reported_at, + run_id=run_id, message=message, timestamp=timestamp, ) diff --git a/src/tower/tower_api_client/models/log_line_channel.py b/src/tower/tower_api_client/models/run_log_line_channel.py similarity index 78% rename from src/tower/tower_api_client/models/log_line_channel.py rename to src/tower/tower_api_client/models/run_log_line_channel.py index d69b8f83..547ca73c 100644 --- a/src/tower/tower_api_client/models/log_line_channel.py +++ b/src/tower/tower_api_client/models/run_log_line_channel.py @@ -1,7 +1,7 @@ from enum import Enum -class LogLineChannel(str, Enum): +class RunLogLineChannel(str, Enum): PROGRAM = "program" SETUP = "setup" diff --git a/src/tower/tower_api_client/models/schedule.py b/src/tower/tower_api_client/models/schedule.py index 0be0f015..a1b0ddfe 100644 --- a/src/tower/tower_api_client/models/schedule.py +++ b/src/tower/tower_api_client/models/schedule.py @@ -1,7 +1,9 @@ +import datetime from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define +from dateutil.parser import isoparse from ..types import UNSET, Unset @@ -17,29 +19,37 @@ class Schedule: """ Attributes: app_name (str): The name of the app that will be executed + created_at (datetime.datetime): The timestamp when the schedule was created 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 + 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 """ app_name: str + created_at: datetime.datetime cron: str environment: str id: str + updated_at: datetime.datetime app_version: Union[Unset, str] = UNSET parameters: Union[Unset, list["RunParameter"]] = UNSET def to_dict(self) -> dict[str, Any]: app_name = self.app_name + created_at = self.created_at.isoformat() + cron = self.cron environment = self.environment id = self.id + updated_at = self.updated_at.isoformat() + app_version = self.app_version parameters: Union[Unset, list[dict[str, Any]]] = UNSET @@ -53,9 +63,11 @@ def to_dict(self) -> dict[str, Any]: field_dict.update( { "app_name": app_name, + "created_at": created_at, "cron": cron, "environment": environment, "id": id, + "updated_at": updated_at, } ) if app_version is not UNSET: @@ -72,12 +84,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) app_name = d.pop("app_name") + created_at = isoparse(d.pop("created_at")) + cron = d.pop("cron") environment = d.pop("environment") id = d.pop("id") + updated_at = isoparse(d.pop("updated_at")) + app_version = d.pop("app_version", UNSET) parameters = [] @@ -89,9 +105,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: schedule = cls( app_name=app_name, + created_at=created_at, cron=cron, environment=environment, id=id, + updated_at=updated_at, app_version=app_version, parameters=parameters, ) diff --git a/src/tower/tower_api_client/models/statistics_settings.py b/src/tower/tower_api_client/models/statistics_settings.py index 9f43be5e..7810a52e 100644 --- a/src/tower/tower_api_client/models/statistics_settings.py +++ b/src/tower/tower_api_client/models/statistics_settings.py @@ -15,12 +15,14 @@ class StatisticsSettings: """ Attributes: end_at (datetime.datetime): The end time for the statistics period. + environment (str): The environment to get statistics for. interval (StatisticsSettingsInterval): The interval for the statistics period. start_at (datetime.datetime): The start time for the statistics period. timezone (str): The time zone for the statistics period. """ end_at: datetime.datetime + environment: str interval: StatisticsSettingsInterval start_at: datetime.datetime timezone: str @@ -28,6 +30,8 @@ class StatisticsSettings: def to_dict(self) -> dict[str, Any]: end_at = self.end_at.isoformat() + environment = self.environment + interval = self.interval.value start_at = self.start_at.isoformat() @@ -38,6 +42,7 @@ def to_dict(self) -> dict[str, Any]: field_dict.update( { "end_at": end_at, + "environment": environment, "interval": interval, "start_at": start_at, "timezone": timezone, @@ -51,6 +56,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) end_at = isoparse(d.pop("end_at")) + environment = d.pop("environment") + interval = StatisticsSettingsInterval(d.pop("interval")) start_at = isoparse(d.pop("start_at")) @@ -59,6 +66,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: statistics_settings = cls( end_at=end_at, + environment=environment, interval=interval, start_at=start_at, timezone=timezone, diff --git a/src/tower/tower_api_client/models/stream_alerts_event_error.py b/src/tower/tower_api_client/models/stream_alerts_event_error.py new file mode 100644 index 00000000..8456720d --- /dev/null +++ b/src/tower/tower_api_client/models/stream_alerts_event_error.py @@ -0,0 +1,102 @@ +from collections.abc import Mapping +from typing import ( + TYPE_CHECKING, + Any, + Literal, + TypeVar, + Union, + cast, +) + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.sse_warning import SSEWarning + + +T = TypeVar("T", bound="StreamAlertsEventError") + + +@_attrs_define +class StreamAlertsEventError: + """ + Attributes: + data (SSEWarning): + event (Literal['error']): The event name. + id (Union[Unset, int]): The event ID. + retry (Union[Unset, int]): The retry time in milliseconds. + """ + + data: "SSEWarning" + event: Literal["error"] + id: Union[Unset, int] = UNSET + retry: Union[Unset, int] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + event = self.event + + id = self.id + + retry = self.retry + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + "event": event, + } + ) + if id is not UNSET: + field_dict["id"] = id + if retry is not UNSET: + field_dict["retry"] = retry + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.sse_warning import SSEWarning + + d = dict(src_dict) + data = SSEWarning.from_dict(d.pop("data")) + + event = cast(Literal["error"], d.pop("event")) + if event != "error": + raise ValueError(f"event must match const 'error', got '{event}'") + + id = d.pop("id", UNSET) + + retry = d.pop("retry", UNSET) + + stream_alerts_event_error = cls( + data=data, + event=event, + id=id, + retry=retry, + ) + + stream_alerts_event_error.additional_properties = d + return stream_alerts_event_error + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/tower/tower_api_client/models/stream_alerts_event_run_failure_alert.py b/src/tower/tower_api_client/models/stream_alerts_event_run_failure_alert.py new file mode 100644 index 00000000..c69cfe80 --- /dev/null +++ b/src/tower/tower_api_client/models/stream_alerts_event_run_failure_alert.py @@ -0,0 +1,104 @@ +from collections.abc import Mapping +from typing import ( + TYPE_CHECKING, + Any, + Literal, + TypeVar, + Union, + cast, +) + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.run_failure_alert import RunFailureAlert + + +T = TypeVar("T", bound="StreamAlertsEventRunFailureAlert") + + +@_attrs_define +class StreamAlertsEventRunFailureAlert: + """ + Attributes: + data (RunFailureAlert): + event (Literal['run_failure_alert']): The event name. + id (Union[Unset, int]): The event ID. + retry (Union[Unset, int]): The retry time in milliseconds. + """ + + data: "RunFailureAlert" + event: Literal["run_failure_alert"] + id: Union[Unset, int] = UNSET + retry: Union[Unset, int] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + event = self.event + + id = self.id + + retry = self.retry + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + "event": event, + } + ) + if id is not UNSET: + field_dict["id"] = id + if retry is not UNSET: + field_dict["retry"] = retry + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.run_failure_alert import RunFailureAlert + + d = dict(src_dict) + data = RunFailureAlert.from_dict(d.pop("data")) + + event = cast(Literal["run_failure_alert"], d.pop("event")) + if event != "run_failure_alert": + raise ValueError( + f"event must match const 'run_failure_alert', got '{event}'" + ) + + id = d.pop("id", UNSET) + + retry = d.pop("retry", UNSET) + + stream_alerts_event_run_failure_alert = cls( + data=data, + event=event, + id=id, + retry=retry, + ) + + stream_alerts_event_run_failure_alert.additional_properties = d + return stream_alerts_event_run_failure_alert + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/tower/tower_api_client/models/stream_run_logs_event_log.py b/src/tower/tower_api_client/models/stream_run_logs_event_log.py new file mode 100644 index 00000000..3d9c2c44 --- /dev/null +++ b/src/tower/tower_api_client/models/stream_run_logs_event_log.py @@ -0,0 +1,102 @@ +from collections.abc import Mapping +from typing import ( + TYPE_CHECKING, + Any, + Literal, + TypeVar, + Union, + cast, +) + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.run_log_line import RunLogLine + + +T = TypeVar("T", bound="StreamRunLogsEventLog") + + +@_attrs_define +class StreamRunLogsEventLog: + """ + Attributes: + data (RunLogLine): + event (Literal['log']): The event name. + id (Union[Unset, int]): The event ID. + retry (Union[Unset, int]): The retry time in milliseconds. + """ + + data: "RunLogLine" + event: Literal["log"] + id: Union[Unset, int] = UNSET + retry: Union[Unset, int] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + event = self.event + + id = self.id + + retry = self.retry + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + "event": event, + } + ) + if id is not UNSET: + field_dict["id"] = id + if retry is not UNSET: + field_dict["retry"] = retry + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.run_log_line import RunLogLine + + d = dict(src_dict) + data = RunLogLine.from_dict(d.pop("data")) + + event = cast(Literal["log"], d.pop("event")) + if event != "log": + raise ValueError(f"event must match const 'log', got '{event}'") + + id = d.pop("id", UNSET) + + retry = d.pop("retry", UNSET) + + stream_run_logs_event_log = cls( + data=data, + event=event, + id=id, + retry=retry, + ) + + stream_run_logs_event_log.additional_properties = d + return stream_run_logs_event_log + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/tower/tower_api_client/models/stream_run_logs_event_warning.py b/src/tower/tower_api_client/models/stream_run_logs_event_warning.py new file mode 100644 index 00000000..3aabe9c9 --- /dev/null +++ b/src/tower/tower_api_client/models/stream_run_logs_event_warning.py @@ -0,0 +1,102 @@ +from collections.abc import Mapping +from typing import ( + TYPE_CHECKING, + Any, + Literal, + TypeVar, + Union, + cast, +) + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.sse_warning import SSEWarning + + +T = TypeVar("T", bound="StreamRunLogsEventWarning") + + +@_attrs_define +class StreamRunLogsEventWarning: + """ + Attributes: + data (SSEWarning): + event (Literal['warning']): The event name. + id (Union[Unset, int]): The event ID. + retry (Union[Unset, int]): The retry time in milliseconds. + """ + + data: "SSEWarning" + event: Literal["warning"] + id: Union[Unset, int] = UNSET + retry: Union[Unset, int] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + event = self.event + + id = self.id + + retry = self.retry + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + "event": event, + } + ) + if id is not UNSET: + field_dict["id"] = id + if retry is not UNSET: + field_dict["retry"] = retry + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.sse_warning import SSEWarning + + d = dict(src_dict) + data = SSEWarning.from_dict(d.pop("data")) + + event = cast(Literal["warning"], d.pop("event")) + if event != "warning": + raise ValueError(f"event must match const 'warning', got '{event}'") + + id = d.pop("id", UNSET) + + retry = d.pop("retry", UNSET) + + stream_run_logs_event_warning = cls( + data=data, + event=event, + id=id, + retry=retry, + ) + + stream_run_logs_event_warning.additional_properties = d + return stream_run_logs_event_warning + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/tower/tower_api_client/models/update_app_params.py b/src/tower/tower_api_client/models/update_app_params.py index defe8759..70758672 100644 --- a/src/tower/tower_api_client/models/update_app_params.py +++ b/src/tower/tower_api_client/models/update_app_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -16,11 +16,14 @@ class UpdateAppParams: status (str): New status for the App schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/UpdateAppParams.json. + is_externally_accessible (Union[None, Unset, bool]): Indicates that web traffic should be routed to this app and + that its runs should get a hostname assigned to it. """ description: str status: str schema: Union[Unset, str] = UNSET + is_externally_accessible: Union[None, Unset, bool] = UNSET def to_dict(self) -> dict[str, Any]: description = self.description @@ -29,6 +32,12 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema + is_externally_accessible: Union[None, Unset, bool] + if isinstance(self.is_externally_accessible, Unset): + is_externally_accessible = UNSET + else: + is_externally_accessible = self.is_externally_accessible + field_dict: dict[str, Any] = {} field_dict.update( { @@ -38,6 +47,8 @@ def to_dict(self) -> dict[str, Any]: ) if schema is not UNSET: field_dict["$schema"] = schema + if is_externally_accessible is not UNSET: + field_dict["is_externally_accessible"] = is_externally_accessible return field_dict @@ -50,10 +61,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: schema = d.pop("$schema", UNSET) + def _parse_is_externally_accessible(data: object) -> Union[None, Unset, bool]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, bool], data) + + is_externally_accessible = _parse_is_externally_accessible( + d.pop("is_externally_accessible", UNSET) + ) + update_app_params = cls( description=description, status=status, schema=schema, + is_externally_accessible=is_externally_accessible, ) return update_app_params diff --git a/src/tower/tower_api_client/models/update_environment_params.py b/src/tower/tower_api_client/models/update_environment_params.py new file mode 100644 index 00000000..462fd892 --- /dev/null +++ b/src/tower/tower_api_client/models/update_environment_params.py @@ -0,0 +1,51 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateEnvironmentParams") + + +@_attrs_define +class UpdateEnvironmentParams: + """ + Attributes: + new_name (str): The desired new name of the environment + schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateEnvironmentParams.json. + """ + + new_name: str + schema: Union[Unset, str] = UNSET + + def to_dict(self) -> dict[str, Any]: + new_name = self.new_name + + schema = self.schema + + field_dict: dict[str, Any] = {} + field_dict.update( + { + "new_name": new_name, + } + ) + 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) + new_name = d.pop("new_name") + + schema = d.pop("$schema", UNSET) + + update_environment_params = cls( + new_name=new_name, + schema=schema, + ) + + return update_environment_params diff --git a/src/tower/tower_api_client/models/update_environment_response.py b/src/tower/tower_api_client/models/update_environment_response.py new file mode 100644 index 00000000..3051af64 --- /dev/null +++ b/src/tower/tower_api_client/models/update_environment_response.py @@ -0,0 +1,57 @@ +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.environment import Environment + + +T = TypeVar("T", bound="UpdateEnvironmentResponse") + + +@_attrs_define +class UpdateEnvironmentResponse: + """ + Attributes: + environment (Environment): + schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateEnvironmentResponse.json. + """ + + environment: "Environment" + schema: Union[Unset, str] = UNSET + + def to_dict(self) -> dict[str, Any]: + environment = self.environment.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + field_dict.update( + { + "environment": environment, + } + ) + 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.environment import Environment + + d = dict(src_dict) + environment = Environment.from_dict(d.pop("environment")) + + schema = d.pop("$schema", UNSET) + + update_environment_response = cls( + environment=environment, + schema=schema, + ) + + return update_environment_response diff --git a/src/tower/tower_api_client/models/update_plan_params.py b/src/tower/tower_api_client/models/update_plan_params.py new file mode 100644 index 00000000..5b9c2e5d --- /dev/null +++ b/src/tower/tower_api_client/models/update_plan_params.py @@ -0,0 +1,69 @@ +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdatePlanParams") + + +@_attrs_define +class UpdatePlanParams: + """ + Attributes: + base_plan_name (str): The name of the base plan to use. + schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdatePlanParams.json. + end_at (Union[Unset, datetime.datetime]): Optional expiration date for the plan. + """ + + base_plan_name: str + schema: Union[Unset, str] = UNSET + end_at: Union[Unset, datetime.datetime] = UNSET + + def to_dict(self) -> dict[str, Any]: + base_plan_name = self.base_plan_name + + schema = self.schema + + end_at: Union[Unset, str] = UNSET + if not isinstance(self.end_at, Unset): + end_at = self.end_at.isoformat() + + field_dict: dict[str, Any] = {} + field_dict.update( + { + "base_plan_name": base_plan_name, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + if end_at is not UNSET: + field_dict["end_at"] = end_at + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + base_plan_name = d.pop("base_plan_name") + + schema = d.pop("$schema", UNSET) + + _end_at = d.pop("end_at", UNSET) + end_at: Union[Unset, datetime.datetime] + if isinstance(_end_at, Unset): + end_at = UNSET + else: + end_at = isoparse(_end_at) + + update_plan_params = cls( + base_plan_name=base_plan_name, + schema=schema, + end_at=end_at, + ) + + return update_plan_params diff --git a/src/tower/tower_api_client/models/update_plan_response.py b/src/tower/tower_api_client/models/update_plan_response.py new file mode 100644 index 00000000..2c55c359 --- /dev/null +++ b/src/tower/tower_api_client/models/update_plan_response.py @@ -0,0 +1,57 @@ +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.plan import Plan + + +T = TypeVar("T", bound="UpdatePlanResponse") + + +@_attrs_define +class UpdatePlanResponse: + """ + Attributes: + plan (Plan): + schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdatePlanResponse.json. + """ + + plan: "Plan" + schema: Union[Unset, str] = UNSET + + def to_dict(self) -> dict[str, Any]: + plan = self.plan.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + field_dict.update( + { + "plan": plan, + } + ) + 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.plan import Plan + + d = dict(src_dict) + plan = Plan.from_dict(d.pop("plan")) + + schema = d.pop("$schema", UNSET) + + update_plan_response = cls( + plan=plan, + schema=schema, + ) + + return update_plan_response 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 85da8fb4..a3e3b9f3 100644 --- a/src/tower/tower_api_client/models/update_schedule_params.py +++ b/src/tower/tower_api_client/models/update_schedule_params.py @@ -18,7 +18,6 @@ class UpdateScheduleParams: Attributes: schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/UpdateScheduleParams.json. - app_name (Union[None, Unset, str]): The name of the app that this schedule runs app_version (Union[None, Unset, str]): The specific app version to run (if omitted, will use the app's default version) cron (Union[Unset, str]): The cron expression defining when the app should run @@ -27,7 +26,6 @@ class UpdateScheduleParams: """ schema: Union[Unset, str] = UNSET - app_name: Union[None, Unset, str] = UNSET app_version: Union[None, Unset, str] = UNSET cron: Union[Unset, str] = UNSET environment: Union[Unset, str] = UNSET @@ -36,12 +34,6 @@ class UpdateScheduleParams: def to_dict(self) -> dict[str, Any]: schema = self.schema - app_name: Union[None, Unset, str] - if isinstance(self.app_name, Unset): - app_name = UNSET - else: - app_name = self.app_name - app_version: Union[None, Unset, str] if isinstance(self.app_version, Unset): app_version = UNSET @@ -63,8 +55,6 @@ def to_dict(self) -> dict[str, Any]: field_dict.update({}) if schema is not UNSET: field_dict["$schema"] = schema - if app_name is not UNSET: - field_dict["app_name"] = app_name if app_version is not UNSET: field_dict["app_version"] = app_version if cron is not UNSET: @@ -83,15 +73,6 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) schema = d.pop("$schema", UNSET) - def _parse_app_name(data: object) -> Union[None, Unset, str]: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(Union[None, Unset, str], data) - - app_name = _parse_app_name(d.pop("app_name", UNSET)) - def _parse_app_version(data: object) -> Union[None, Unset, str]: if data is None: return data @@ -114,7 +95,6 @@ def _parse_app_version(data: object) -> Union[None, Unset, str]: update_schedule_params = cls( schema=schema, - app_name=app_name, app_version=app_version, cron=cron, environment=environment, diff --git a/src/tower/tower_api_client/models/update_team_params.py b/src/tower/tower_api_client/models/update_team_params.py index d06faee6..52955553 100644 --- a/src/tower/tower_api_client/models/update_team_params.py +++ b/src/tower/tower_api_client/models/update_team_params.py @@ -12,8 +12,8 @@ class UpdateTeamParams: """ Attributes: - name (Union[None, str]): The name of the team to update. This is optional, if you supply null it will not - update the team name. + name (Union[None, str]): The name of the team to update. This is optional, if you supply null it will not update + the team name. schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/UpdateTeamParams.json. """ diff --git a/src/tower/tower_api_client/models/user.py b/src/tower/tower_api_client/models/user.py index 4eee905b..b9a79186 100644 --- a/src/tower/tower_api_client/models/user.py +++ b/src/tower/tower_api_client/models/user.py @@ -1,10 +1,12 @@ import datetime from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from dateutil.parser import isoparse +from ..types import UNSET, Unset + T = TypeVar("T", bound="User") @@ -18,9 +20,10 @@ class User: email (str): first_name (str): is_alerts_enabled (bool): - is_invitation_claimed (bool): + is_confirmed (bool): last_name (str): profile_photo_url (str): + is_invitation_claimed (Union[Unset, bool]): This property is deprecated. It will be removed in a future version. """ company: str @@ -29,9 +32,10 @@ class User: email: str first_name: str is_alerts_enabled: bool - is_invitation_claimed: bool + is_confirmed: bool last_name: str profile_photo_url: str + is_invitation_claimed: Union[Unset, bool] = UNSET def to_dict(self) -> dict[str, Any]: company = self.company @@ -46,12 +50,14 @@ def to_dict(self) -> dict[str, Any]: is_alerts_enabled = self.is_alerts_enabled - is_invitation_claimed = self.is_invitation_claimed + is_confirmed = self.is_confirmed last_name = self.last_name profile_photo_url = self.profile_photo_url + is_invitation_claimed = self.is_invitation_claimed + field_dict: dict[str, Any] = {} field_dict.update( { @@ -61,11 +67,13 @@ def to_dict(self) -> dict[str, Any]: "email": email, "first_name": first_name, "is_alerts_enabled": is_alerts_enabled, - "is_invitation_claimed": is_invitation_claimed, + "is_confirmed": is_confirmed, "last_name": last_name, "profile_photo_url": profile_photo_url, } ) + if is_invitation_claimed is not UNSET: + field_dict["is_invitation_claimed"] = is_invitation_claimed return field_dict @@ -84,12 +92,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: is_alerts_enabled = d.pop("is_alerts_enabled") - is_invitation_claimed = d.pop("is_invitation_claimed") + is_confirmed = d.pop("is_confirmed") last_name = d.pop("last_name") profile_photo_url = d.pop("profile_photo_url") + is_invitation_claimed = d.pop("is_invitation_claimed", UNSET) + user = cls( company=company, country=country, @@ -97,9 +107,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: email=email, first_name=first_name, is_alerts_enabled=is_alerts_enabled, - is_invitation_claimed=is_invitation_claimed, + is_confirmed=is_confirmed, last_name=last_name, profile_photo_url=profile_photo_url, + is_invitation_claimed=is_invitation_claimed, ) return user diff --git a/src/tower/tower_api_client/models/accept_invitation_params.py b/src/tower/tower_api_client/models/verify_email_params.py similarity index 76% rename from src/tower/tower_api_client/models/accept_invitation_params.py rename to src/tower/tower_api_client/models/verify_email_params.py index bad62c87..9af6b609 100644 --- a/src/tower/tower_api_client/models/accept_invitation_params.py +++ b/src/tower/tower_api_client/models/verify_email_params.py @@ -5,16 +5,16 @@ from ..types import UNSET, Unset -T = TypeVar("T", bound="AcceptInvitationParams") +T = TypeVar("T", bound="VerifyEmailParams") @_attrs_define -class AcceptInvitationParams: +class VerifyEmailParams: """ Attributes: - code (str): The invitation code to accept + code (str): schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/AcceptInvitationParams.json. + https://api.tower.dev/v1/schemas/VerifyEmailParams.json. """ code: str @@ -43,9 +43,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: schema = d.pop("$schema", UNSET) - accept_invitation_params = cls( + verify_email_params = cls( code=code, schema=schema, ) - return accept_invitation_params + return verify_email_params diff --git a/src/tower/tower_api_client/models/accept_invitation_response.py b/src/tower/tower_api_client/models/verify_email_response.py similarity index 81% rename from src/tower/tower_api_client/models/accept_invitation_response.py rename to src/tower/tower_api_client/models/verify_email_response.py index 71e7ac9b..54a8d7aa 100644 --- a/src/tower/tower_api_client/models/accept_invitation_response.py +++ b/src/tower/tower_api_client/models/verify_email_response.py @@ -9,16 +9,16 @@ from ..models.user import User -T = TypeVar("T", bound="AcceptInvitationResponse") +T = TypeVar("T", bound="VerifyEmailResponse") @_attrs_define -class AcceptInvitationResponse: +class VerifyEmailResponse: """ Attributes: user (User): schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/AcceptInvitationResponse.json. + https://api.tower.dev/v1/schemas/VerifyEmailResponse.json. """ user: "User" @@ -49,9 +49,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: schema = d.pop("$schema", UNSET) - accept_invitation_response = cls( + verify_email_response = cls( user=user, schema=schema, ) - return accept_invitation_response + return verify_email_response diff --git a/tests/tower/test_client.py b/tests/tower/test_client.py index c54135ae..82365c70 100644 --- a/tests/tower/test_client.py +++ b/tests/tower/test_client.py @@ -38,6 +38,7 @@ def _create_run_response( return { "run": { + "$link": f"https://api.example.com/v1/apps/my-app/runs/{number}", "app_name": "my-app", "app_version": app_version, "cancelled_at": None, @@ -74,6 +75,7 @@ def _create_run( parameters = [] return Run( + link="https://api.example.com/v1/apps/my-app/runs/0", app_name="my-app", exit_code=None, app_version=app_version, @@ -99,7 +101,7 @@ def test_running_apps(httpx_mock, mock_api_config, mock_run_response_factory): method="POST", url="https://api.example.com/v1/apps/my-app/runs", json=mock_run_response_factory(), - status_code=200, + status_code=201, ) # Call the function that makes the API request diff --git a/tests/tower/test_tables.py b/tests/tower/test_tables.py index 94c5b3c1..a92c0ee3 100644 --- a/tests/tower/test_tables.py +++ b/tests/tower/test_tables.py @@ -8,7 +8,7 @@ # We import all the things we need from Tower. import tower.polars as pl -import tower.pyarrow as pa +import pyarrow as pa from pyiceberg.catalog.memory import InMemoryCatalog # Imports the library under test diff --git a/uv.lock b/uv.lock index 1a792aaa..50ed3240 100644 --- a/uv.lock +++ b/uv.lock @@ -1254,6 +1254,7 @@ dev = [ { name = "pytest" }, { name = "pytest-env" }, { name = "pytest-httpx" }, + { name = "tower", extra = ["iceberg"] }, ] [package.metadata] @@ -1281,6 +1282,7 @@ dev = [ { name = "pytest", specifier = "==8.3.5" }, { name = "pytest-env", specifier = ">=1.1.3" }, { name = "pytest-httpx", specifier = "==0.35.0" }, + { name = "tower", extras = ["iceberg"], editable = "." }, ] [[package]]