From 243406b5448a5bc6a14ca548bfcdff892f9d626c Mon Sep 17 00:00:00 2001 From: Joshua Smock Date: Thu, 11 Dec 2025 17:59:36 +0100 Subject: [PATCH 1/6] Update API spec (#137) --- crates/tower-api/README.md | 35 +- crates/tower-api/src/apis/configuration.rs | 2 +- crates/tower-api/src/apis/default_api.rs | 504 +++++++++++++++--- .../tower-api/src/apis/feature_flags_api.rs | 2 +- crates/tower-api/src/models/account.rs | 13 +- .../src/models/acknowledge_alert_response.rs | 2 +- .../models/acknowledge_all_alerts_response.rs | 2 +- crates/tower-api/src/models/alert.rs | 2 +- crates/tower-api/src/models/api_key.rs | 2 +- crates/tower-api/src/models/app.rs | 13 +- crates/tower-api/src/models/app_statistics.rs | 2 +- crates/tower-api/src/models/app_summary.rs | 2 +- crates/tower-api/src/models/app_version.rs | 2 +- .../src/models/batch_schedule_params.rs | 2 +- .../src/models/batch_schedule_response.rs | 2 +- .../src/models/cancel_run_response.rs | 2 +- crates/tower-api/src/models/catalog.rs | 2 +- .../tower-api/src/models/catalog_property.rs | 2 +- .../claim_device_login_ticket_params.rs | 2 +- .../claim_device_login_ticket_response.rs | 2 +- .../src/models/create_account_params.rs | 2 +- .../create_account_params_flags_struct.rs | 2 +- .../src/models/create_account_response.rs | 2 +- .../src/models/create_api_key_params.rs | 2 +- .../src/models/create_api_key_response.rs | 2 +- .../tower-api/src/models/create_app_params.rs | 11 +- .../src/models/create_app_response.rs | 2 +- .../src/models/create_authenticator_params.rs | 2 +- .../models/create_authenticator_response.rs | 2 +- .../src/models/create_catalog_params.rs | 6 +- .../src/models/create_catalog_response.rs | 2 +- .../create_device_login_ticket_response.rs | 2 +- .../src/models/create_environment_params.rs | 2 +- .../src/models/create_environment_response.rs | 2 +- .../models/create_password_reset_params.rs | 2 +- .../models/create_password_reset_response.rs | 2 +- .../models/create_sandbox_secrets_params.rs | 38 ++ .../models/create_sandbox_secrets_response.rs | 33 ++ .../src/models/create_schedule_params.rs | 2 +- .../src/models/create_schedule_response.rs | 2 +- .../src/models/create_secret_params.rs | 2 +- .../src/models/create_secret_response.rs | 2 +- .../src/models/create_session_params.rs | 2 +- .../src/models/create_session_response.rs | 2 +- .../src/models/create_team_params.rs | 2 +- .../src/models/create_team_response.rs | 2 +- .../src/models/delete_api_key_params.rs | 2 +- .../src/models/delete_api_key_response.rs | 2 +- .../src/models/delete_app_response.rs | 2 +- .../src/models/delete_authenticator_params.rs | 2 +- .../models/delete_authenticator_response.rs | 2 +- .../src/models/delete_catalog_response.rs | 2 +- .../src/models/delete_schedule_params.rs | 2 +- .../src/models/delete_schedule_response.rs | 2 +- .../src/models/delete_secret_response.rs | 2 +- .../models/delete_team_invitation_params.rs | 2 +- .../models/delete_team_invitation_response.rs | 2 +- .../src/models/delete_team_params.rs | 2 +- .../src/models/delete_team_response.rs | 2 +- .../src/models/deploy_app_request.rs | 27 + .../src/models/deploy_app_response.rs | 2 +- .../src/models/describe_account_body.rs | 32 ++ .../src/models/describe_app_response.rs | 2 +- .../models/describe_app_version_response.rs | 2 +- .../describe_device_login_session_response.rs | 2 +- .../models/describe_email_preferences_body.rs | 2 +- .../src/models/describe_run_graph_response.rs | 29 + .../src/models/describe_run_links.rs | 37 ++ .../src/models/describe_run_logs_response.rs | 2 +- .../src/models/describe_run_response.rs | 13 +- .../models/describe_secrets_key_response.rs | 2 +- .../src/models/describe_session_response.rs | 2 +- .../src/models/email_subscriptions.rs | 2 +- .../src/models/encrypted_catalog_property.rs | 2 +- crates/tower-api/src/models/environment.rs | 2 +- crates/tower-api/src/models/error_detail.rs | 2 +- crates/tower-api/src/models/error_model.rs | 2 +- crates/tower-api/src/models/event_alert.rs | 66 +++ crates/tower-api/src/models/event_error.rs | 2 +- crates/tower-api/src/models/event_log.rs | 2 +- crates/tower-api/src/models/event_warning.rs | 2 +- .../src/models/export_catalogs_params.rs | 2 +- .../src/models/export_catalogs_response.rs | 2 +- .../src/models/export_secrets_params.rs | 2 +- .../src/models/export_secrets_response.rs | 2 +- .../tower-api/src/models/exported_catalog.rs | 2 +- .../src/models/exported_catalog_property.rs | 2 +- .../tower-api/src/models/exported_secret.rs | 2 +- .../src/models/featurebase_identity.rs | 2 +- crates/tower-api/src/models/features.rs | 2 +- .../generate_app_statistics_response.rs | 2 +- .../models/generate_authenticator_response.rs | 2 +- .../generate_run_statistics_response.rs | 2 +- .../generate_runner_credentials_response.rs | 2 +- .../models/get_feature_flag_response_body.rs | 2 +- .../src/models/invite_team_member_params.rs | 2 +- .../src/models/invite_team_member_response.rs | 2 +- .../src/models/leave_team_response.rs | 2 +- .../src/models/list_account_plans_response.rs | 2 +- .../src/models/list_alerts_response.rs | 2 +- .../src/models/list_api_keys_response.rs | 9 +- .../models/list_app_environments_response.rs | 2 +- .../src/models/list_app_versions_response.rs | 2 +- .../src/models/list_apps_response.rs | 2 +- .../models/list_authenticators_response.rs | 2 +- .../src/models/list_catalogs_response.rs | 2 +- .../src/models/list_environments_response.rs | 11 +- .../list_my_team_invitations_response.rs | 2 +- .../src/models/list_runners_response.rs | 37 ++ .../src/models/list_runs_response.rs | 2 +- .../src/models/list_schedules_response.rs | 2 +- .../list_secret_environments_response.rs | 2 +- .../src/models/list_secrets_response.rs | 2 +- .../models/list_team_invitations_response.rs | 2 +- .../src/models/list_team_members_response.rs | 2 +- .../src/models/list_teams_response.rs | 9 +- crates/tower-api/src/models/mod.rs | 38 +- crates/tower-api/src/models/pagination.rs | 2 +- crates/tower-api/src/models/parameter.rs | 2 +- crates/tower-api/src/models/plan.rs | 2 +- .../src/models/refresh_session_params.rs | 2 +- .../src/models/refresh_session_response.rs | 2 +- .../src/models/remove_team_member_params.rs | 2 +- .../src/models/remove_team_member_response.rs | 2 +- .../models/resend_team_invitation_params.rs | 2 +- .../models/resend_team_invitation_response.rs | 2 +- crates/tower-api/src/models/run.rs | 27 +- .../src/models/run_app_initiator_data.rs | 61 +++ crates/tower-api/src/models/run_app_params.rs | 6 +- .../tower-api/src/models/run_app_response.rs | 2 +- .../tower-api/src/models/run_failure_alert.rs | 2 +- crates/tower-api/src/models/run_graph_node.rs | 29 + .../tower-api/src/models/run_graph_run_id.rs | 29 + crates/tower-api/src/models/run_initiator.rs | 26 + crates/tower-api/src/models/run_log_line.rs | 2 +- crates/tower-api/src/models/run_parameter.rs | 2 +- crates/tower-api/src/models/run_results.rs | 2 +- crates/tower-api/src/models/run_statistics.rs | 2 +- .../src/models/run_timeseries_point.rs | 2 +- crates/tower-api/src/models/runner.rs | 61 +++ .../src/models/runner_credentials.rs | 2 +- crates/tower-api/src/models/schedule.rs | 2 +- .../src/models/search_runs_response.rs | 2 +- crates/tower-api/src/models/secret.rs | 2 +- crates/tower-api/src/models/session.rs | 2 +- crates/tower-api/src/models/sse_warning.rs | 2 +- .../src/models/statistics_settings.rs | 2 +- .../stream_alerts_200_response_inner.rs | 19 +- .../stream_run_logs_200_response_inner.rs | 2 +- crates/tower-api/src/models/team.rs | 2 +- .../tower-api/src/models/team_invitation.rs | 2 +- crates/tower-api/src/models/token.rs | 2 +- .../src/models/unverified_authenticator.rs | 2 +- .../src/models/update_account_params.rs | 39 ++ .../src/models/update_account_response.rs | 32 ++ .../tower-api/src/models/update_app_params.rs | 37 +- .../src/models/update_app_response.rs | 2 +- .../src/models/update_catalog_params.rs | 2 +- .../src/models/update_catalog_response.rs | 2 +- .../models/update_email_preferences_body.rs | 2 +- .../src/models/update_environment_params.rs | 2 +- .../src/models/update_environment_response.rs | 2 +- .../update_my_team_invitation_params.rs | 2 +- .../update_my_team_invitation_response.rs | 2 +- .../models/update_password_reset_params.rs | 2 +- .../models/update_password_reset_response.rs | 2 +- .../src/models/update_plan_params.rs | 2 +- .../src/models/update_plan_response.rs | 2 +- .../src/models/update_schedule_params.rs | 2 +- .../src/models/update_schedule_response.rs | 2 +- .../src/models/update_secret_params.rs | 2 +- .../src/models/update_secret_response.rs | 2 +- .../src/models/update_team_params.rs | 2 +- .../src/models/update_team_response.rs | 2 +- .../src/models/update_user_params.rs | 2 +- .../src/models/update_user_response.rs | 2 +- crates/tower-api/src/models/user.rs | 2 +- .../src/models/verified_authenticator.rs | 2 +- .../src/models/verify_email_params.rs | 2 +- .../src/models/verify_email_response.rs | 2 +- crates/tower-cmd/src/api.rs | 10 +- crates/tower-cmd/src/util/apps.rs | 3 +- src/tower/_client.py | 1 + .../api/default/create_authenticator.py | 2 +- .../api/default/create_sandbox_secrets.py | 168 ++++++ .../api/default/delete_authenticator.py | 2 +- .../api/default/deploy_app.py | 86 ++- .../api/default/describe_account.py | 160 ++++++ .../api/default/describe_run_graph.py | 183 +++++++ .../api/default/describe_run_logs.py | 31 +- .../api/default/generate_authenticator.py | 2 +- .../api/default/list_alerts.py | 60 +-- .../api/default/list_api_keys.py | 55 +- .../tower_api_client/api/default/list_apps.py | 48 +- .../api/default/list_authenticators.py | 2 +- .../api/default/list_catalogs.py | 60 +-- .../api/default/list_environments.py | 55 +- .../api/default/list_runners.py | 181 +++++++ .../tower_api_client/api/default/list_runs.py | 16 +- .../api/default/list_schedules.py | 36 +- .../api/default/list_secrets.py | 60 +-- .../api/default/list_teams.py | 55 +- .../api/default/stream_alerts.py | 44 +- ...date_account_name.py => update_account.py} | 60 +-- src/tower/tower_api_client/models/__init__.py | 38 +- src/tower/tower_api_client/models/account.py | 8 + src/tower/tower_api_client/models/app.py | 18 + .../models/create_app_params.py | 23 +- .../models/create_catalog_params_type.py | 1 + .../models/create_sandbox_secrets_params.py | 59 ++ ....py => create_sandbox_secrets_response.py} | 24 +- .../models/deploy_app_json_body.py | 62 +++ ...e_response.py => describe_account_body.py} | 10 +- .../models/describe_run_graph_response.py | 65 +++ .../models/describe_run_links.py | 68 +++ .../models/describe_run_response.py | 10 + .../generate_run_statistics_status_item.py | 1 - .../models/list_api_keys_response.py | 10 + .../models/list_apps_filter.py | 1 + .../models/list_environments_response.py | 10 + .../models/list_runners_response.py | 75 +++ .../models/list_runs_status_item.py | 1 - .../models/list_teams_response.py | 10 + src/tower/tower_api_client/models/run.py | 44 +- .../models/run_app_initiator_data.py | 41 ++ .../models/run_app_initiator_data_type.py | 10 + .../tower_api_client/models/run_app_params.py | 18 + .../tower_api_client/models/run_graph_node.py | 53 ++ .../models/run_graph_run_id.py | 47 ++ .../tower_api_client/models/run_initiator.py | 46 ++ src/tower/tower_api_client/models/runner.py | 104 ++++ .../models/search_runs_status_item.py | 1 - ..._alert.py => stream_alerts_event_alert.py} | 32 +- .../models/update_account_params.py | 58 ++ .../models/update_account_response.py | 57 ++ .../models/update_app_params.py | 80 ++- tests/integration/features/steps/cli_steps.py | 48 +- tests/mock-api-server/main.py | 31 +- tests/tower/test_client.py | 17 +- 239 files changed, 3552 insertions(+), 636 deletions(-) create mode 100644 crates/tower-api/src/models/create_sandbox_secrets_params.rs create mode 100644 crates/tower-api/src/models/create_sandbox_secrets_response.rs create mode 100644 crates/tower-api/src/models/deploy_app_request.rs create mode 100644 crates/tower-api/src/models/describe_account_body.rs create mode 100644 crates/tower-api/src/models/describe_run_graph_response.rs create mode 100644 crates/tower-api/src/models/describe_run_links.rs create mode 100644 crates/tower-api/src/models/event_alert.rs create mode 100644 crates/tower-api/src/models/list_runners_response.rs create mode 100644 crates/tower-api/src/models/run_app_initiator_data.rs create mode 100644 crates/tower-api/src/models/run_graph_node.rs create mode 100644 crates/tower-api/src/models/run_graph_run_id.rs create mode 100644 crates/tower-api/src/models/run_initiator.rs create mode 100644 crates/tower-api/src/models/runner.rs create mode 100644 crates/tower-api/src/models/update_account_params.rs create mode 100644 crates/tower-api/src/models/update_account_response.rs create mode 100644 src/tower/tower_api_client/api/default/create_sandbox_secrets.py create mode 100644 src/tower/tower_api_client/api/default/describe_account.py create mode 100644 src/tower/tower_api_client/api/default/describe_run_graph.py create mode 100644 src/tower/tower_api_client/api/default/list_runners.py rename src/tower/tower_api_client/api/default/{update_account_name.py => update_account.py} (73%) create mode 100644 src/tower/tower_api_client/models/create_sandbox_secrets_params.py rename src/tower/tower_api_client/models/{update_account_name_params.py => create_sandbox_secrets_response.py} (58%) create mode 100644 src/tower/tower_api_client/models/deploy_app_json_body.py rename src/tower/tower_api_client/models/{update_account_name_response.py => describe_account_body.py} (81%) create mode 100644 src/tower/tower_api_client/models/describe_run_graph_response.py create mode 100644 src/tower/tower_api_client/models/describe_run_links.py create mode 100644 src/tower/tower_api_client/models/list_runners_response.py create mode 100644 src/tower/tower_api_client/models/run_app_initiator_data.py create mode 100644 src/tower/tower_api_client/models/run_app_initiator_data_type.py create mode 100644 src/tower/tower_api_client/models/run_graph_node.py create mode 100644 src/tower/tower_api_client/models/run_graph_run_id.py create mode 100644 src/tower/tower_api_client/models/run_initiator.py create mode 100644 src/tower/tower_api_client/models/runner.py rename src/tower/tower_api_client/models/{stream_alerts_event_run_failure_alert.py => stream_alerts_event_alert.py} (69%) create mode 100644 src/tower/tower_api_client/models/update_account_params.py create mode 100644 src/tower/tower_api_client/models/update_account_response.py diff --git a/crates/tower-api/README.md b/crates/tower-api/README.md index 44f689d7..d20a2c3e 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.8.0 +- API version: v0.9.9 - Package version: 1.0.0 - Generator version: 7.13.0 - Build package: `org.openapitools.codegen.languages.RustClientCodegen` @@ -35,11 +35,12 @@ Class | Method | HTTP request | Description *DefaultApi* | [**create_account**](docs/DefaultApi.md#create_account) | **POST** /accounts | Create account *DefaultApi* | [**create_api_key**](docs/DefaultApi.md#create_api_key) | **POST** /api-keys | Create API Key *DefaultApi* | [**create_app**](docs/DefaultApi.md#create_app) | **POST** /apps | Create app -*DefaultApi* | [**create_authenticator**](docs/DefaultApi.md#create_authenticator) | **POST** /accounts/authenticator | Create authenticator +*DefaultApi* | [**create_authenticator**](docs/DefaultApi.md#create_authenticator) | **POST** /authenticators | Create authenticator *DefaultApi* | [**create_catalog**](docs/DefaultApi.md#create_catalog) | **POST** /catalogs | Create catalog *DefaultApi* | [**create_device_login_ticket**](docs/DefaultApi.md#create_device_login_ticket) | **GET** /login/device | Create device login ticket *DefaultApi* | [**create_environment**](docs/DefaultApi.md#create_environment) | **POST** /environments | Create environment *DefaultApi* | [**create_password_reset**](docs/DefaultApi.md#create_password_reset) | **POST** /accounts/password-reset | Create password reset +*DefaultApi* | [**create_sandbox_secrets**](docs/DefaultApi.md#create_sandbox_secrets) | **POST** /sandbox/secrets | Create Tower-provided sandbox secrets *DefaultApi* | [**create_schedule**](docs/DefaultApi.md#create_schedule) | **POST** /schedules | Create schedule *DefaultApi* | [**create_secret**](docs/DefaultApi.md#create_secret) | **POST** /secrets | Create secret *DefaultApi* | [**create_session**](docs/DefaultApi.md#create_session) | **POST** /session | Create session @@ -48,25 +49,27 @@ Class | Method | HTTP request | Description *DefaultApi* | [**delete_alert**](docs/DefaultApi.md#delete_alert) | **DELETE** /alerts/{alert_id} | Delete alert *DefaultApi* | [**delete_api_key**](docs/DefaultApi.md#delete_api_key) | **DELETE** /api-keys | Delete API key *DefaultApi* | [**delete_app**](docs/DefaultApi.md#delete_app) | **DELETE** /apps/{name} | Delete app -*DefaultApi* | [**delete_authenticator**](docs/DefaultApi.md#delete_authenticator) | **DELETE** /accounts/authenticator | Delete authenticator +*DefaultApi* | [**delete_authenticator**](docs/DefaultApi.md#delete_authenticator) | **DELETE** /authenticators | 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 | 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 *DefaultApi* | [**deploy_app**](docs/DefaultApi.md#deploy_app) | **POST** /apps/{name}/deploy | Deploy app +*DefaultApi* | [**describe_account**](docs/DefaultApi.md#describe_account) | **GET** /accounts/{name} | Describe account *DefaultApi* | [**describe_app**](docs/DefaultApi.md#describe_app) | **GET** /apps/{name} | Describe app *DefaultApi* | [**describe_app_version**](docs/DefaultApi.md#describe_app_version) | **GET** /apps/{name}/versions/{num} | Describe app version *DefaultApi* | [**describe_device_login_session**](docs/DefaultApi.md#describe_device_login_session) | **GET** /login/device/{device_code} | Describe device login session *DefaultApi* | [**describe_email_preferences**](docs/DefaultApi.md#describe_email_preferences) | **GET** /user/email-preferences | Describe email preferences *DefaultApi* | [**describe_run**](docs/DefaultApi.md#describe_run) | **GET** /apps/{name}/runs/{seq} | Describe run +*DefaultApi* | [**describe_run_graph**](docs/DefaultApi.md#describe_run_graph) | **GET** /apps/{name}/runs/{seq}/graph | Describe run graph *DefaultApi* | [**describe_run_logs**](docs/DefaultApi.md#describe_run_logs) | **GET** /apps/{name}/runs/{seq}/logs | Describe run logs *DefaultApi* | [**describe_secrets_key**](docs/DefaultApi.md#describe_secrets_key) | **GET** /secrets/key | Describe encryption key *DefaultApi* | [**describe_session**](docs/DefaultApi.md#describe_session) | **GET** /session | Describe session *DefaultApi* | [**export_catalogs**](docs/DefaultApi.md#export_catalogs) | **POST** /catalogs/export | Export catalogs *DefaultApi* | [**export_secrets**](docs/DefaultApi.md#export_secrets) | **POST** /secrets/export | Export secrets *DefaultApi* | [**generate_app_statistics**](docs/DefaultApi.md#generate_app_statistics) | **GET** /stats/apps | Generate app statistics -*DefaultApi* | [**generate_authenticator**](docs/DefaultApi.md#generate_authenticator) | **POST** /accounts/authenticator/generate | Generate authenticator +*DefaultApi* | [**generate_authenticator**](docs/DefaultApi.md#generate_authenticator) | **POST** /authenticators/generate | Generate authenticator *DefaultApi* | [**generate_run_statistics**](docs/DefaultApi.md#generate_run_statistics) | **GET** /stats/runs | Generate run statistics *DefaultApi* | [**generate_runner_credentials**](docs/DefaultApi.md#generate_runner_credentials) | **POST** /runners/credentials | Generate runner credentials *DefaultApi* | [**invite_team_member**](docs/DefaultApi.md#invite_team_member) | **POST** /teams/{name}/invites | Invite team member @@ -76,11 +79,12 @@ Class | Method | HTTP request | Description *DefaultApi* | [**list_app_environments**](docs/DefaultApi.md#list_app_environments) | **GET** /apps/{name}/environments | List app environments *DefaultApi* | [**list_app_versions**](docs/DefaultApi.md#list_app_versions) | **GET** /apps/{name}/versions | List app versions *DefaultApi* | [**list_apps**](docs/DefaultApi.md#list_apps) | **GET** /apps | List apps -*DefaultApi* | [**list_authenticators**](docs/DefaultApi.md#list_authenticators) | **GET** /accounts/authenticator | List authenticators +*DefaultApi* | [**list_authenticators**](docs/DefaultApi.md#list_authenticators) | **GET** /authenticators | List authenticators *DefaultApi* | [**list_catalogs**](docs/DefaultApi.md#list_catalogs) | **GET** /catalogs | List catalogs *DefaultApi* | [**list_environments**](docs/DefaultApi.md#list_environments) | **GET** /environments | List environments *DefaultApi* | [**list_my_team_invitations**](docs/DefaultApi.md#list_my_team_invitations) | **GET** /team-invites | List my team invitations *DefaultApi* | [**list_plans**](docs/DefaultApi.md#list_plans) | **GET** /plans | List account plans +*DefaultApi* | [**list_runners**](docs/DefaultApi.md#list_runners) | **GET** /runners | List runners *DefaultApi* | [**list_runs**](docs/DefaultApi.md#list_runs) | **GET** /apps/{name}/runs | List runs *DefaultApi* | [**list_schedules**](docs/DefaultApi.md#list_schedules) | **GET** /schedules | List schedules *DefaultApi* | [**list_secret_environments**](docs/DefaultApi.md#list_secret_environments) | **GET** /secrets/environments | List secret environments @@ -96,7 +100,7 @@ Class | Method | HTTP request | Description *DefaultApi* | [**search_runs**](docs/DefaultApi.md#search_runs) | **GET** /runs | Search runs *DefaultApi* | [**stream_alerts**](docs/DefaultApi.md#stream_alerts) | **GET** /alerts/stream | Stream alert notifications *DefaultApi* | [**stream_run_logs**](docs/DefaultApi.md#stream_run_logs) | **GET** /apps/{name}/runs/{seq}/logs/stream | Stream run logs -*DefaultApi* | [**update_account_name**](docs/DefaultApi.md#update_account_name) | **PUT** /accounts/{name} | Update account name +*DefaultApi* | [**update_account**](docs/DefaultApi.md#update_account) | **PUT** /accounts/{name} | Update account *DefaultApi* | [**update_app**](docs/DefaultApi.md#update_app) | **PUT** /apps/{name} | Update app *DefaultApi* | [**update_catalog**](docs/DefaultApi.md#update_catalog) | **PUT** /catalogs/{name} | Update catalog *DefaultApi* | [**update_email_preferences**](docs/DefaultApi.md#update_email_preferences) | **PUT** /user/email-preferences | Update email preferences @@ -146,6 +150,8 @@ Class | Method | HTTP request | Description - [CreateEnvironmentResponse](docs/CreateEnvironmentResponse.md) - [CreatePasswordResetParams](docs/CreatePasswordResetParams.md) - [CreatePasswordResetResponse](docs/CreatePasswordResetResponse.md) + - [CreateSandboxSecretsParams](docs/CreateSandboxSecretsParams.md) + - [CreateSandboxSecretsResponse](docs/CreateSandboxSecretsResponse.md) - [CreateScheduleParams](docs/CreateScheduleParams.md) - [CreateScheduleResponse](docs/CreateScheduleResponse.md) - [CreateSecretParams](docs/CreateSecretParams.md) @@ -167,11 +173,15 @@ Class | Method | HTTP request | Description - [DeleteTeamInvitationResponse](docs/DeleteTeamInvitationResponse.md) - [DeleteTeamParams](docs/DeleteTeamParams.md) - [DeleteTeamResponse](docs/DeleteTeamResponse.md) + - [DeployAppRequest](docs/DeployAppRequest.md) - [DeployAppResponse](docs/DeployAppResponse.md) + - [DescribeAccountBody](docs/DescribeAccountBody.md) - [DescribeAppResponse](docs/DescribeAppResponse.md) - [DescribeAppVersionResponse](docs/DescribeAppVersionResponse.md) - [DescribeDeviceLoginSessionResponse](docs/DescribeDeviceLoginSessionResponse.md) - [DescribeEmailPreferencesBody](docs/DescribeEmailPreferencesBody.md) + - [DescribeRunGraphResponse](docs/DescribeRunGraphResponse.md) + - [DescribeRunLinks](docs/DescribeRunLinks.md) - [DescribeRunLogsResponse](docs/DescribeRunLogsResponse.md) - [DescribeRunResponse](docs/DescribeRunResponse.md) - [DescribeSecretsKeyResponse](docs/DescribeSecretsKeyResponse.md) @@ -181,9 +191,9 @@ Class | Method | HTTP request | Description - [Environment](docs/Environment.md) - [ErrorDetail](docs/ErrorDetail.md) - [ErrorModel](docs/ErrorModel.md) + - [EventAlert](docs/EventAlert.md) - [EventError](docs/EventError.md) - [EventLog](docs/EventLog.md) - - [EventRunFailureAlert](docs/EventRunFailureAlert.md) - [EventWarning](docs/EventWarning.md) - [ExportCatalogsParams](docs/ExportCatalogsParams.md) - [ExportCatalogsResponse](docs/ExportCatalogsResponse.md) @@ -203,7 +213,6 @@ Class | Method | HTTP request | Description - [InviteTeamMemberResponse](docs/InviteTeamMemberResponse.md) - [LeaveTeamResponse](docs/LeaveTeamResponse.md) - [ListAccountPlansResponse](docs/ListAccountPlansResponse.md) - - [ListAlerts200Response](docs/ListAlerts200Response.md) - [ListAlertsResponse](docs/ListAlertsResponse.md) - [ListApiKeysResponse](docs/ListApiKeysResponse.md) - [ListAppEnvironmentsResponse](docs/ListAppEnvironmentsResponse.md) @@ -213,6 +222,7 @@ Class | Method | HTTP request | Description - [ListCatalogsResponse](docs/ListCatalogsResponse.md) - [ListEnvironmentsResponse](docs/ListEnvironmentsResponse.md) - [ListMyTeamInvitationsResponse](docs/ListMyTeamInvitationsResponse.md) + - [ListRunnersResponse](docs/ListRunnersResponse.md) - [ListRunsResponse](docs/ListRunsResponse.md) - [ListSchedulesResponse](docs/ListSchedulesResponse.md) - [ListSecretEnvironmentsResponse](docs/ListSecretEnvironmentsResponse.md) @@ -230,14 +240,19 @@ Class | Method | HTTP request | Description - [ResendTeamInvitationParams](docs/ResendTeamInvitationParams.md) - [ResendTeamInvitationResponse](docs/ResendTeamInvitationResponse.md) - [Run](docs/Run.md) + - [RunAppInitiatorData](docs/RunAppInitiatorData.md) - [RunAppParams](docs/RunAppParams.md) - [RunAppResponse](docs/RunAppResponse.md) - [RunFailureAlert](docs/RunFailureAlert.md) + - [RunGraphNode](docs/RunGraphNode.md) + - [RunGraphRunId](docs/RunGraphRunId.md) + - [RunInitiator](docs/RunInitiator.md) - [RunLogLine](docs/RunLogLine.md) - [RunParameter](docs/RunParameter.md) - [RunResults](docs/RunResults.md) - [RunStatistics](docs/RunStatistics.md) - [RunTimeseriesPoint](docs/RunTimeseriesPoint.md) + - [Runner](docs/Runner.md) - [RunnerCredentials](docs/RunnerCredentials.md) - [Schedule](docs/Schedule.md) - [SearchRunsResponse](docs/SearchRunsResponse.md) @@ -251,8 +266,8 @@ Class | Method | HTTP request | Description - [TeamInvitation](docs/TeamInvitation.md) - [Token](docs/Token.md) - [UnverifiedAuthenticator](docs/UnverifiedAuthenticator.md) - - [UpdateAccountNameParams](docs/UpdateAccountNameParams.md) - - [UpdateAccountNameResponse](docs/UpdateAccountNameResponse.md) + - [UpdateAccountParams](docs/UpdateAccountParams.md) + - [UpdateAccountResponse](docs/UpdateAccountResponse.md) - [UpdateAppParams](docs/UpdateAppParams.md) - [UpdateAppResponse](docs/UpdateAppResponse.md) - [UpdateCatalogParams](docs/UpdateCatalogParams.md) diff --git a/crates/tower-api/src/apis/configuration.rs b/crates/tower-api/src/apis/configuration.rs index 25e48f5b..a38763e1 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 a9ff0ecf..3470fbfa 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -84,6 +84,12 @@ pub struct CreatePasswordResetParams { pub create_password_reset_params: models::CreatePasswordResetParams, } +/// struct for passing parameters to the method [`create_sandbox_secrets`] +#[derive(Clone, Debug)] +pub struct CreateSandboxSecretsParams { + pub create_sandbox_secrets_params: models::CreateSandboxSecretsParams, +} + /// struct for passing parameters to the method [`create_schedule`] #[derive(Clone, Debug)] pub struct CreateScheduleParams { @@ -183,12 +189,19 @@ pub struct DeleteTeamInvitationParams { pub struct DeployAppParams { /// The name of the app to deploy. pub name: String, - /// The encoding of the content. - pub content_encoding: Option, + /// Deploy app using either a tar file upload or GitHub source URL + pub deploy_app_request: models::DeployAppRequest, /// The SHA256 hash of the content, used to verify integrity. pub x_tower_checksum_sha256: Option, } +/// struct for passing parameters to the method [`describe_account`] +#[derive(Clone, Debug)] +pub struct DescribeAccountParams { + /// The name of the account to describe + pub name: String, +} + /// struct for passing parameters to the method [`describe_app`] #[derive(Clone, Debug)] pub struct DescribeAppParams { @@ -229,6 +242,15 @@ pub struct DescribeRunParams { pub seq: i64, } +/// struct for passing parameters to the method [`describe_run_graph`] +#[derive(Clone, Debug)] +pub struct DescribeRunGraphParams { + /// The name of the app. + pub name: String, + /// The number of the run to fetch. + pub seq: i64, +} + /// struct for passing parameters to the method [`describe_run_logs`] #[derive(Clone, Debug)] pub struct DescribeRunLogsParams { @@ -236,6 +258,8 @@ pub struct DescribeRunLogsParams { pub name: String, /// The sequence number of the run to get logs for. pub seq: i64, + /// Fetch logs from this timestamp onwards (inclusive). + pub start_at: Option, } /// struct for passing parameters to the method [`describe_secrets_key`] @@ -297,22 +321,31 @@ pub struct LeaveTeamParams { /// struct for passing parameters to the method [`list_alerts`] #[derive(Clone, Debug)] pub struct ListAlertsParams { + /// The page number to fetch. + pub page: Option, + /// The number of records to fetch on each page. + pub page_size: Option, /// Filter alerts by alert type pub alert_type: Option, /// Filter alerts created after or at this datetime (inclusive) pub start_at: Option, /// Filter alerts created before or at this datetime (inclusive) pub end_at: Option, - /// The page number to fetch. - pub page: Option, - /// The number of records to fetch on each page. - pub page_size: Option, /// Filter alerts by acknowledged status. pub acked: Option, /// Filter alerts by environment (e.g., production, staging) pub environment: Option, } +/// struct for passing parameters to the method [`list_api_keys`] +#[derive(Clone, Debug)] +pub struct ListApiKeysParams { + /// The page number to fetch. + pub page: Option, + /// The number of records to fetch on each page. + pub page_size: Option, +} + /// struct for passing parameters to the method [`list_app_environments`] #[derive(Clone, Debug)] pub struct ListAppEnvironmentsParams { @@ -330,12 +363,12 @@ pub struct ListAppVersionsParams { /// struct for passing parameters to the method [`list_apps`] #[derive(Clone, Debug)] pub struct ListAppsParams { - /// The search query to filter apps by. - pub query: Option, /// The page number to fetch. pub page: Option, /// The number of records to fetch on each page. pub page_size: Option, + /// The search query to filter apps by. + pub query: Option, /// Number of recent runs to fetch (-1 for all runs, defaults to 20) pub num_runs: Option, /// Sort order for the results. @@ -349,10 +382,19 @@ pub struct ListAppsParams { /// struct for passing parameters to the method [`list_catalogs`] #[derive(Clone, Debug)] pub struct ListCatalogsParams { + /// The page number to fetch. + pub page: Option, + /// The number of records to fetch on each page. + pub page_size: Option, /// The environment to filter by. pub environment: Option, /// Whether to fetch all catalogs across all environments or only for the current environment. pub all: Option, +} + +/// struct for passing parameters to the method [`list_environments`] +#[derive(Clone, Debug)] +pub struct ListEnvironmentsParams { /// The page number to fetch. pub page: Option, /// The number of records to fetch on each page. @@ -368,6 +410,15 @@ pub struct ListPlansParams { pub page_size: Option, } +/// struct for passing parameters to the method [`list_runners`] +#[derive(Clone, Debug)] +pub struct ListRunnersParams { + /// The page number to fetch. + pub page: Option, + /// The number of records to fetch on each page. + pub page_size: Option, +} + /// struct for passing parameters to the method [`list_runs`] #[derive(Clone, Debug)] pub struct ListRunsParams { @@ -377,7 +428,7 @@ pub struct ListRunsParams { pub page: Option, /// The number of records to fetch on each page. pub page_size: Option, - /// Filter runs by status(es) (comma separated for multiple). + /// Filter runs by status(es). Define multiple with a comma-separated list. Supplying none will return all statuses. pub status: Option>, /// Filter runs scheduled after or at this datetime (inclusive) pub start_at: Option, @@ -401,14 +452,14 @@ pub struct ListSchedulesParams { /// struct for passing parameters to the method [`list_secrets`] #[derive(Clone, Debug)] pub struct ListSecretsParams { - /// The environment to filter by. - pub environment: Option, - /// Whether to fetch all secrets or only the ones that are not marked as deleted. - pub all: Option, /// The page number to fetch. pub page: Option, /// The number of records to fetch on each page. pub page_size: Option, + /// The environment to filter by. + pub environment: Option, + /// Whether to fetch all secrets or only the ones that are not marked as deleted. + pub all: Option, } /// struct for passing parameters to the method [`list_team_invitations`] @@ -425,6 +476,15 @@ pub struct ListTeamMembersParams { pub name: String, } +/// struct for passing parameters to the method [`list_teams`] +#[derive(Clone, Debug)] +pub struct ListTeamsParams { + /// The page number to fetch. + pub page: Option, + /// The number of records to fetch on each page. + pub page_size: Option, +} + /// struct for passing parameters to the method [`refresh_session`] #[derive(Clone, Debug)] pub struct RefreshSessionParams { @@ -481,12 +541,12 @@ pub struct StreamRunLogsParams { pub seq: i64, } -/// struct for passing parameters to the method [`update_account_name`] +/// struct for passing parameters to the method [`update_account`] #[derive(Clone, Debug)] -pub struct UpdateAccountNameParams { +pub struct UpdateAccountParams { /// The name of the account to update pub name: String, - pub update_account_name_params: models::UpdateAccountNameParams, + pub update_account_params: models::UpdateAccountParams, } /// struct for passing parameters to the method [`update_app`] @@ -678,6 +738,14 @@ pub enum CreatePasswordResetSuccess { UnknownValue(serde_json::Value), } +/// struct for typed successes of method [`create_sandbox_secrets`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateSandboxSecretsSuccess { + Status200(models::CreateSandboxSecretsResponse), + UnknownValue(serde_json::Value), +} + /// struct for typed successes of method [`create_schedule`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -798,6 +866,14 @@ pub enum DeployAppSuccess { UnknownValue(serde_json::Value), } +/// struct for typed successes of method [`describe_account`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DescribeAccountSuccess { + Status200(models::DescribeAccountBody), + UnknownValue(serde_json::Value), +} + /// struct for typed successes of method [`describe_app`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -838,6 +914,14 @@ pub enum DescribeRunSuccess { UnknownValue(serde_json::Value), } +/// struct for typed successes of method [`describe_run_graph`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DescribeRunGraphSuccess { + Status200(models::DescribeRunGraphResponse), + UnknownValue(serde_json::Value), +} + /// struct for typed successes of method [`describe_run_logs`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -930,7 +1014,7 @@ pub enum LeaveTeamSuccess { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum ListAlertsSuccess { - Status200(models::ListAlerts200Response), + Status200(models::ListAlertsResponse), UnknownValue(serde_json::Value), } @@ -1006,6 +1090,14 @@ pub enum ListPlansSuccess { UnknownValue(serde_json::Value), } +/// struct for typed successes of method [`list_runners`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListRunnersSuccess { + Status200(models::ListRunnersResponse), + UnknownValue(serde_json::Value), +} + /// struct for typed successes of method [`list_runs`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -1126,11 +1218,11 @@ pub enum StreamRunLogsSuccess { UnknownValue(serde_json::Value), } -/// struct for typed successes of method [`update_account_name`] +/// struct for typed successes of method [`update_account`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum UpdateAccountNameSuccess { - Status200(models::UpdateAccountNameResponse), +pub enum UpdateAccountSuccess { + Status200(models::UpdateAccountResponse), UnknownValue(serde_json::Value), } @@ -1334,6 +1426,14 @@ pub enum CreatePasswordResetError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`create_sandbox_secrets`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateSandboxSecretsError { + DefaultResponse(models::ErrorModel), + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`create_schedule`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -1459,6 +1559,14 @@ pub enum DeployAppError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`describe_account`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DescribeAccountError { + DefaultResponse(models::ErrorModel), + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`describe_app`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -1500,6 +1608,15 @@ pub enum DescribeRunError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`describe_run_graph`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DescribeRunGraphError { + Status401(models::ErrorModel), + Status404(models::ErrorModel), + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`describe_run_logs`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -1668,6 +1785,14 @@ pub enum ListPlansError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`list_runners`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListRunnersError { + DefaultResponse(models::ErrorModel), + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`list_runs`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -1788,10 +1913,10 @@ pub enum StreamRunLogsError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`update_account_name`] +/// struct for typed errors of method [`update_account`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum UpdateAccountNameError { +pub enum UpdateAccountError { DefaultResponse(models::ErrorModel), UnknownValue(serde_json::Value), } @@ -2298,7 +2423,7 @@ pub async fn create_authenticator( configuration: &configuration::Configuration, params: CreateAuthenticatorParams, ) -> Result, Error> { - let uri_str = format!("{}/accounts/authenticator", configuration.base_path); + let uri_str = format!("{}/authenticators", configuration.base_path); let mut req_builder = configuration .client .request(reqwest::Method::POST, &uri_str); @@ -2533,6 +2658,56 @@ pub async fn create_password_reset( } } +/// Creates secrets with Tower-provided default values for the specified keys in the given environment. +pub async fn create_sandbox_secrets( + configuration: &configuration::Configuration, + params: CreateSandboxSecretsParams, +) -> Result, Error> { + let uri_str = format!("{}/sandbox/secrets", 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.create_sandbox_secrets_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, + })) + } +} + /// Create a new schedule for an app. pub async fn create_schedule( configuration: &configuration::Configuration, @@ -2940,7 +3115,7 @@ pub async fn delete_authenticator( configuration: &configuration::Configuration, params: DeleteAuthenticatorParams, ) -> Result, Error> { - let uri_str = format!("{}/accounts/authenticator", configuration.base_path); + let uri_str = format!("{}/authenticators", configuration.base_path); let mut req_builder = configuration .client .request(reqwest::Method::DELETE, &uri_str); @@ -3251,7 +3426,7 @@ pub async fn delete_team_invitation( } } -/// Deploy a new version of an app. Reads the request body, which is a TAR file (or a GZipped TAR file) and creates a new deployment for an app based on that file. +/// Deploy a new version of an app. Accepts either a TAR file upload (application/tar) or a JSON body with source_uri (application/json) for deploying from a GitHub repository. pub async fn deploy_app( configuration: &configuration::Configuration, params: DeployAppParams, @@ -3268,15 +3443,13 @@ pub async fn deploy_app( if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } - if let Some(param_value) = params.content_encoding { - req_builder = req_builder.header("Content-Encoding", param_value.to_string()); - } if let Some(param_value) = params.x_tower_checksum_sha256 { req_builder = req_builder.header("X-Tower-Checksum-SHA256", param_value.to_string()); } if let Some(ref token) = configuration.bearer_access_token { req_builder = req_builder.bearer_auth(token.to_owned()); }; + req_builder = req_builder.json(¶ms.deploy_app_request); let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -3310,6 +3483,57 @@ pub async fn deploy_app( } } +/// Get information about a specific account by name. +pub async fn describe_account( + configuration: &configuration::Configuration, + params: DescribeAccountParams, +) -> Result, Error> { + let uri_str = format!( + "{}/accounts/{name}", + configuration.base_path, + name = crate::apis::urlencode(params.name) + ); + 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()); + } + 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, + })) + } +} + /// Get all the runs for the current account. pub async fn describe_app( configuration: &configuration::Configuration, @@ -3539,6 +3763,9 @@ pub async fn describe_run( 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()); + }; if let Some(ref apikey) = configuration.api_key { let key = apikey.key.clone(); let value = match apikey.prefix { @@ -3547,6 +3774,55 @@ pub async fn describe_run( }; req_builder = req_builder.header("X-API-Key", value); }; + + 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, + })) + } +} + +/// Describe the graph that a run belongs to. +pub async fn describe_run_graph( + configuration: &configuration::Configuration, + params: DescribeRunGraphParams, +) -> Result, Error> { + let uri_str = format!( + "{}/apps/{name}/runs/{seq}/graph", + configuration.base_path, + name = crate::apis::urlencode(params.name), + seq = params.seq + ); + 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()); + } if let Some(ref token) = configuration.bearer_access_token { req_builder = req_builder.bearer_auth(token.to_owned()); }; @@ -3564,7 +3840,7 @@ pub async fn describe_run( if !status.is_client_error() && !status.is_server_error() { let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); + let entity: Option = serde_json::from_str(&content).ok(); Ok(ResponseContent { tower_trace_id, status, @@ -3573,7 +3849,7 @@ pub async fn describe_run( }) } else { let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); + let entity: Option = serde_json::from_str(&content).ok(); Err(Error::ResponseError(ResponseContent { tower_trace_id, status, @@ -3596,6 +3872,9 @@ pub async fn describe_run_logs( ); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + if let Some(ref param_value) = params.start_at { + req_builder = req_builder.query(&[("start_at", ¶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()); } @@ -3885,10 +4164,7 @@ pub async fn generate_app_statistics( pub async fn generate_authenticator( configuration: &configuration::Configuration, ) -> Result, Error> { - let uri_str = format!( - "{}/accounts/authenticator/generate", - configuration.base_path - ); + let uri_str = format!("{}/authenticators/generate", configuration.base_path); let mut req_builder = configuration .client .request(reqwest::Method::POST, &uri_str); @@ -4019,6 +4295,9 @@ pub async fn generate_runner_credentials( 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()); + }; if let Some(ref apikey) = configuration.api_key { let key = apikey.key.clone(); let value = match apikey.prefix { @@ -4027,9 +4306,6 @@ pub async fn generate_runner_credentials( }; req_builder = req_builder.header("X-API-Key", value); }; - 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?; @@ -4178,6 +4454,12 @@ pub async fn list_alerts( let uri_str = format!("{}/alerts", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + if let Some(ref param_value) = params.page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = params.page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } if let Some(ref param_value) = params.alert_type { req_builder = req_builder.query(&[("alert_type", ¶m_value.to_string())]); } @@ -4187,12 +4469,6 @@ pub async fn list_alerts( 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.page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = params.page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } if let Some(ref param_value) = params.acked { req_builder = req_builder.query(&[("acked", ¶m_value.to_string())]); } @@ -4241,10 +4517,17 @@ pub async fn list_alerts( /// List all the API keys associated with your current account. pub async fn list_api_keys( configuration: &configuration::Configuration, + params: ListApiKeysParams, ) -> Result, Error> { let uri_str = format!("{}/api-keys", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + if let Some(ref param_value) = params.page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = params.page_size { + req_builder = req_builder.query(&[("page_size", ¶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()); } @@ -4394,15 +4677,15 @@ pub async fn list_apps( let uri_str = format!("{}/apps", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - if let Some(ref param_value) = params.query { - req_builder = req_builder.query(&[("query", ¶m_value.to_string())]); - } if let Some(ref param_value) = params.page { req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); } if let Some(ref param_value) = params.page_size { req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); } + if let Some(ref param_value) = params.query { + req_builder = req_builder.query(&[("query", ¶m_value.to_string())]); + } if let Some(ref param_value) = params.num_runs { req_builder = req_builder.query(&[("num_runs", ¶m_value.to_string())]); } @@ -4418,6 +4701,9 @@ pub async fn list_apps( 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()); + }; if let Some(ref apikey) = configuration.api_key { let key = apikey.key.clone(); let value = match apikey.prefix { @@ -4426,9 +4712,6 @@ pub async fn list_apps( }; req_builder = req_builder.header("X-API-Key", value); }; - 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?; @@ -4466,7 +4749,7 @@ pub async fn list_apps( pub async fn list_authenticators( configuration: &configuration::Configuration, ) -> Result, Error> { - let uri_str = format!("{}/accounts/authenticator", configuration.base_path); + let uri_str = format!("{}/authenticators", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); if let Some(ref user_agent) = configuration.user_agent { @@ -4516,18 +4799,18 @@ pub async fn list_catalogs( let uri_str = format!("{}/catalogs", 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 param_value) = params.all { - req_builder = req_builder.query(&[("all", ¶m_value.to_string())]); - } if let Some(ref param_value) = params.page { req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); } if let Some(ref param_value) = params.page_size { req_builder = req_builder.query(&[("page_size", ¶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 param_value) = params.all { + req_builder = req_builder.query(&[("all", ¶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()); } @@ -4570,10 +4853,17 @@ pub async fn list_catalogs( /// List all environments in your account. pub async fn list_environments( configuration: &configuration::Configuration, + params: ListEnvironmentsParams, ) -> Result, Error> { let uri_str = format!("{}/environments", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + if let Some(ref param_value) = params.page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = params.page_size { + req_builder = req_builder.query(&[("page_size", ¶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()); } @@ -4712,6 +5002,67 @@ pub async fn list_plans( } } +/// Get all self-hosted runners for the current account. +pub async fn list_runners( + configuration: &configuration::Configuration, + params: ListRunnersParams, +) -> Result, Error> { + let uri_str = format!("{}/runners", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = params.page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = params.page_size { + req_builder = req_builder.query(&[("page_size", ¶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()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let value = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + req_builder = req_builder.header("X-API-Key", value); + }; + + 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, + })) + } +} + /// Generates a list of all the runs for a given app. The list is paginated based on the query string parameters passed in. pub async fn list_runs( configuration: &configuration::Configuration, @@ -4907,18 +5258,18 @@ pub async fn list_secrets( let uri_str = format!("{}/secrets", 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 param_value) = params.all { - req_builder = req_builder.query(&[("all", ¶m_value.to_string())]); - } if let Some(ref param_value) = params.page { req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); } if let Some(ref param_value) = params.page_size { req_builder = req_builder.query(&[("page_size", ¶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 param_value) = params.all { + req_builder = req_builder.query(&[("all", ¶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()); } @@ -5063,10 +5414,17 @@ pub async fn list_team_members( /// List all the teams that the user is a member of. pub async fn list_teams( configuration: &configuration::Configuration, + params: ListTeamsParams, ) -> Result, Error> { let uri_str = format!("{}/teams", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + if let Some(ref param_value) = params.page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = params.page_size { + req_builder = req_builder.query(&[("page_size", ¶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()); } @@ -5329,6 +5687,9 @@ pub async fn run_app( 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()); + }; if let Some(ref apikey) = configuration.api_key { let key = apikey.key.clone(); let value = match apikey.prefix { @@ -5337,9 +5698,6 @@ pub async fn run_app( }; req_builder = req_builder.header("X-API-Key", value); }; - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; req_builder = req_builder.json(¶ms.run_app_params); let req = req_builder.build()?; @@ -5553,11 +5911,11 @@ pub async fn stream_run_logs( } } -/// Update the name for an account -pub async fn update_account_name( +/// Update the properties of an account +pub async fn update_account( configuration: &configuration::Configuration, - params: UpdateAccountNameParams, -) -> Result, Error> { + params: UpdateAccountParams, +) -> Result, Error> { let uri_str = format!( "{}/accounts/{name}", configuration.base_path, @@ -5571,7 +5929,7 @@ pub async fn update_account_name( if let Some(ref token) = configuration.bearer_access_token { req_builder = req_builder.bearer_auth(token.to_owned()); }; - req_builder = req_builder.json(¶ms.update_account_name_params); + req_builder = req_builder.json(¶ms.update_account_params); let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -5586,7 +5944,7 @@ pub async fn update_account_name( if !status.is_client_error() && !status.is_server_error() { let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); + let entity: Option = serde_json::from_str(&content).ok(); Ok(ResponseContent { tower_trace_id, status, @@ -5595,7 +5953,7 @@ pub async fn update_account_name( }) } else { let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); + let entity: Option = serde_json::from_str(&content).ok(); Err(Error::ResponseError(ResponseContent { tower_trace_id, status, diff --git a/crates/tower-api/src/apis/feature_flags_api.rs b/crates/tower-api/src/apis/feature_flags_api.rs index 56dff37b..00a7e9e7 100644 --- a/crates/tower-api/src/apis/feature_flags_api.rs +++ b/crates/tower-api/src/apis/feature_flags_api.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/account.rs b/crates/tower-api/src/models/account.rs index 6b7f5337..06906b88 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -14,6 +14,9 @@ use serde_with::{serde_as, DefaultOnNull}; #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Account { + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "is_self_hosted_only")] + pub is_self_hosted_only: bool, #[serde_as(as = "DefaultOnNull")] #[serde(rename = "name")] pub name: String, @@ -23,7 +26,11 @@ pub struct Account { } impl Account { - pub fn new(name: String) -> Account { - Account { name, slug: None } + pub fn new(is_self_hosted_only: bool, name: String) -> Account { + Account { + is_self_hosted_only, + name, + slug: None, + } } } diff --git a/crates/tower-api/src/models/acknowledge_alert_response.rs b/crates/tower-api/src/models/acknowledge_alert_response.rs index 20e5d9a4..e70a02ed 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 222da762..2b52ac25 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 4521e884..8c964a11 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/api_key.rs b/crates/tower-api/src/models/api_key.rs index e29edbfb..cdc91380 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 c6ea8043..fbae834e 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -22,7 +22,10 @@ pub struct App { #[serde_as(as = "DefaultOnNull")] #[serde(rename = "health_status")] pub health_status: HealthStatus, - /// The last run of this app, null if none. + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "is_externally_accessible")] + pub is_externally_accessible: bool, + /// Deprecated: always null, previously latest run of this app. Use \"runs\" in app summary instead. #[serde(rename = "last_run", skip_serializing_if = "Option::is_none")] pub last_run: Option, /// The name of the app. @@ -52,6 +55,9 @@ pub struct App { /// The status of the app. #[serde(rename = "status", skip_serializing_if = "Option::is_none")] pub status: Option, + /// The subdomain that this app is accessible via. Must be externally accessible first. + #[serde(rename = "subdomain", skip_serializing_if = "Option::is_none")] + pub subdomain: Option, /// The current version of this app, null if none. #[serde(rename = "version", deserialize_with = "Option::deserialize")] pub version: Option, @@ -61,6 +67,7 @@ impl App { pub fn new( created_at: String, health_status: HealthStatus, + is_externally_accessible: bool, name: String, next_run_at: Option, owner: String, @@ -71,6 +78,7 @@ impl App { App { created_at, health_status, + is_externally_accessible, last_run: None, name, next_run_at, @@ -80,6 +88,7 @@ impl App { short_description, slug: None, status: None, + subdomain: None, version, } } diff --git a/crates/tower-api/src/models/app_statistics.rs b/crates/tower-api/src/models/app_statistics.rs index b4e4008c..b4f3f131 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 ee1cc89e..ec6a41d8 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 3852e1ae..211356b7 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/batch_schedule_params.rs b/crates/tower-api/src/models/batch_schedule_params.rs index f76fb38d..1c99c445 100644 --- a/crates/tower-api/src/models/batch_schedule_params.rs +++ b/crates/tower-api/src/models/batch_schedule_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/batch_schedule_response.rs b/crates/tower-api/src/models/batch_schedule_response.rs index ab4eb364..571c36aa 100644 --- a/crates/tower-api/src/models/batch_schedule_response.rs +++ b/crates/tower-api/src/models/batch_schedule_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 f0071958..5e475afb 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 11e02f87..e090ec17 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 c4cd6cf0..cb4d6b47 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 1bf3ab32..a6cd4d4e 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 03b695b0..50ebc2e4 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 71bd2634..94b59a10 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_account_params_flags_struct.rs b/crates/tower-api/src/models/create_account_params_flags_struct.rs index b175dbf2..7d57ef99 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 dac20931..f417802d 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 72d087a7..4d01b92f 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 b1919d4f..03865477 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 c0369dff..ea6f1d8e 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -33,6 +33,14 @@ pub struct CreateAppParams { /// The slug of the app. Legacy CLI will send it but we don't need it. #[serde(rename = "slug", skip_serializing_if = "Option::is_none")] pub slug: Option, + /// The subdomain this app is accessible under. Requires is_externally_accessible to be true. + #[serde( + rename = "subdomain", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub subdomain: Option>, } impl CreateAppParams { @@ -43,6 +51,7 @@ impl CreateAppParams { name, short_description: None, slug: None, + subdomain: None, } } } diff --git a/crates/tower-api/src/models/create_app_response.rs b/crates/tower-api/src/models/create_app_response.rs index 4e4bb0e4..d1b53281 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 d2a168a8..92a64066 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 978e2d56..d3498c96 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 4b6ed49a..41c699fc 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -58,6 +58,8 @@ pub enum Type { CloudflareR2Catalog, #[serde(rename = "lakekeeper")] Lakekeeper, + #[serde(rename = "tower-catalog")] + TowerCatalog, } impl Default for Type { @@ -77,6 +79,7 @@ impl<'de> Deserialize<'de> for Type { "apache-polaris" => Ok(Self::ApachePolaris), "cloudflare-r2-catalog" => Ok(Self::CloudflareR2Catalog), "lakekeeper" => Ok(Self::Lakekeeper), + "tower-catalog" => Ok(Self::TowerCatalog), _ => Err(serde::de::Error::unknown_variant( &s, &[ @@ -84,6 +87,7 @@ impl<'de> Deserialize<'de> for Type { "apache-polaris", "cloudflare-r2-catalog", "lakekeeper", + "tower-catalog", ], )), } diff --git a/crates/tower-api/src/models/create_catalog_response.rs b/crates/tower-api/src/models/create_catalog_response.rs index 0ee75a6c..e78b6c1c 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 8f796cd2..0ff492dd 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 948a7448..a3308694 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 d1a1e41a..ca42e761 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 d208130c..d4d13577 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 88e5ff15..ad2a0c8a 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_sandbox_secrets_params.rs b/crates/tower-api/src/models/create_sandbox_secrets_params.rs new file mode 100644 index 00000000..eb050208 --- /dev/null +++ b/crates/tower-api/src/models/create_sandbox_secrets_params.rs @@ -0,0 +1,38 @@ +/* + * Tower API + * + * REST API to interact with Tower Services. + * + * The version of the OpenAPI document: v0.9.9 + * Contact: hello@tower.dev + * Generated by: https://openapi-generator.tech + */ +use crate::models; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::{serde_as, DefaultOnNull}; + +#[serde_as] +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CreateSandboxSecretsParams { + /// A URL to the JSON Schema for this object. + #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] + pub schema: Option, + /// Environment to create secrets in + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "environment")] + pub environment: String, + /// List of secret keys to create with Tower defaults + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "secret_keys")] + pub secret_keys: Vec, +} + +impl CreateSandboxSecretsParams { + pub fn new(environment: String, secret_keys: Vec) -> CreateSandboxSecretsParams { + CreateSandboxSecretsParams { + schema: None, + environment, + secret_keys, + } + } +} diff --git a/crates/tower-api/src/models/create_sandbox_secrets_response.rs b/crates/tower-api/src/models/create_sandbox_secrets_response.rs new file mode 100644 index 00000000..935f7c9d --- /dev/null +++ b/crates/tower-api/src/models/create_sandbox_secrets_response.rs @@ -0,0 +1,33 @@ +/* + * Tower API + * + * REST API to interact with Tower Services. + * + * The version of the OpenAPI document: v0.9.9 + * Contact: hello@tower.dev + * Generated by: https://openapi-generator.tech + */ +use crate::models; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::{serde_as, DefaultOnNull}; + +#[serde_as] +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CreateSandboxSecretsResponse { + /// A URL to the JSON Schema for this object. + #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] + pub schema: Option, + /// List of secret keys that were created + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "created")] + pub created: Vec, +} + +impl CreateSandboxSecretsResponse { + pub fn new(created: Vec) -> CreateSandboxSecretsResponse { + CreateSandboxSecretsResponse { + schema: None, + created, + } + } +} diff --git a/crates/tower-api/src/models/create_schedule_params.rs b/crates/tower-api/src/models/create_schedule_params.rs index a72d0fa3..b620d28e 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 0c41aaae..92fee6ad 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 2b703a01..35956065 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 4780023e..c6494b3c 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 59eda6fa..efb51f48 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 d79394ee..9c4c3152 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 9e19a9af..1970cc56 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 36d6475a..ec418164 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 69d4df48..7bd607a9 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 2415dd79..51b6d859 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 b315d6c7..cf1fd834 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 fb590334..a6d9ccf3 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 6d716e54..5635919b 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 ca0b4928..944b6837 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_schedule_params.rs b/crates/tower-api/src/models/delete_schedule_params.rs index fa6c84eb..0d074624 100644 --- a/crates/tower-api/src/models/delete_schedule_params.rs +++ b/crates/tower-api/src/models/delete_schedule_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_schedule_response.rs b/crates/tower-api/src/models/delete_schedule_response.rs index 0598af68..3ecd5e64 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_secret_response.rs b/crates/tower-api/src/models/delete_secret_response.rs index ad740486..dffbc1c5 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 e7488d97..a0d5a420 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 ca053de1..7de39efe 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 e3f3e7f2..c0395b64 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 797d4f9e..d150916a 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/deploy_app_request.rs b/crates/tower-api/src/models/deploy_app_request.rs new file mode 100644 index 00000000..3f429622 --- /dev/null +++ b/crates/tower-api/src/models/deploy_app_request.rs @@ -0,0 +1,27 @@ +/* + * Tower API + * + * REST API to interact with Tower Services. + * + * The version of the OpenAPI document: v0.9.9 + * Contact: hello@tower.dev + * Generated by: https://openapi-generator.tech + */ +use crate::models; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::{serde_as, DefaultOnNull}; + +#[serde_as] +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DeployAppRequest { + /// GitHub repository URL for deploying from source + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "source_uri")] + pub source_uri: String, +} + +impl DeployAppRequest { + pub fn new(source_uri: String) -> DeployAppRequest { + DeployAppRequest { source_uri } + } +} diff --git a/crates/tower-api/src/models/deploy_app_response.rs b/crates/tower-api/src/models/deploy_app_response.rs index cc9676e8..5959eb39 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_account_body.rs b/crates/tower-api/src/models/describe_account_body.rs new file mode 100644 index 00000000..7f7fbbb4 --- /dev/null +++ b/crates/tower-api/src/models/describe_account_body.rs @@ -0,0 +1,32 @@ +/* + * Tower API + * + * REST API to interact with Tower Services. + * + * The version of the OpenAPI document: v0.9.9 + * Contact: hello@tower.dev + * Generated by: https://openapi-generator.tech + */ +use crate::models; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::{serde_as, DefaultOnNull}; + +#[serde_as] +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DescribeAccountBody { + /// A URL to the JSON Schema for this object. + #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] + pub schema: Option, + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "account")] + pub account: models::Account, +} + +impl DescribeAccountBody { + pub fn new(account: models::Account) -> DescribeAccountBody { + DescribeAccountBody { + schema: None, + account, + } + } +} diff --git a/crates/tower-api/src/models/describe_app_response.rs b/crates/tower-api/src/models/describe_app_response.rs index cde653ec..fd68b992 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 a59337d9..ca0a932c 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 090bbe99..944361be 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_email_preferences_body.rs b/crates/tower-api/src/models/describe_email_preferences_body.rs index bc3cfd77..0d5d9652 100644 --- a/crates/tower-api/src/models/describe_email_preferences_body.rs +++ b/crates/tower-api/src/models/describe_email_preferences_body.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_run_graph_response.rs b/crates/tower-api/src/models/describe_run_graph_response.rs new file mode 100644 index 00000000..9799c145 --- /dev/null +++ b/crates/tower-api/src/models/describe_run_graph_response.rs @@ -0,0 +1,29 @@ +/* + * Tower API + * + * REST API to interact with Tower Services. + * + * The version of the OpenAPI document: v0.9.9 + * Contact: hello@tower.dev + * Generated by: https://openapi-generator.tech + */ +use crate::models; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::{serde_as, DefaultOnNull}; + +#[serde_as] +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DescribeRunGraphResponse { + /// A URL to the JSON Schema for this object. + #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] + pub schema: Option, + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "runs")] + pub runs: Vec, +} + +impl DescribeRunGraphResponse { + pub fn new(runs: Vec) -> DescribeRunGraphResponse { + DescribeRunGraphResponse { schema: None, runs } + } +} diff --git a/crates/tower-api/src/models/describe_run_links.rs b/crates/tower-api/src/models/describe_run_links.rs new file mode 100644 index 00000000..f6a0fe10 --- /dev/null +++ b/crates/tower-api/src/models/describe_run_links.rs @@ -0,0 +1,37 @@ +/* + * Tower API + * + * REST API to interact with Tower Services. + * + * The version of the OpenAPI document: v0.9.9 + * Contact: hello@tower.dev + * Generated by: https://openapi-generator.tech + */ +use crate::models; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::{serde_as, DefaultOnNull}; + +#[serde_as] +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DescribeRunLinks { + /// The URL of the next run, if any. + #[serde(rename = "next", deserialize_with = "Option::deserialize")] + pub next: Option, + /// The URL of the previous run, if any. + #[serde(rename = "prev", deserialize_with = "Option::deserialize")] + pub prev: Option, + /// The URL of this run. + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "self")] + pub param_self: String, +} + +impl DescribeRunLinks { + pub fn new(next: Option, prev: Option, param_self: String) -> DescribeRunLinks { + DescribeRunLinks { + next, + prev, + param_self, + } + } +} 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 f3200373..2370e71f 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 54f67f39..94967167 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -14,6 +14,9 @@ use serde_with::{serde_as, DefaultOnNull}; #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct DescribeRunResponse { + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "$links")] + pub dollar_links: models::DescribeRunLinks, /// A URL to the JSON Schema for this object. #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] pub schema: Option, @@ -23,7 +26,11 @@ pub struct DescribeRunResponse { } impl DescribeRunResponse { - pub fn new(run: models::Run) -> DescribeRunResponse { - DescribeRunResponse { schema: None, run } + pub fn new(dollar_links: models::DescribeRunLinks, run: models::Run) -> DescribeRunResponse { + DescribeRunResponse { + dollar_links, + schema: None, + run, + } } } 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 c43d0b11..4777f2d6 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 19d79610..577ae74f 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/email_subscriptions.rs b/crates/tower-api/src/models/email_subscriptions.rs index 0d3f6743..dd34a85f 100644 --- a/crates/tower-api/src/models/email_subscriptions.rs +++ b/crates/tower-api/src/models/email_subscriptions.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 22b126e5..181190d3 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 a83fb12e..c3ee117e 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 b63f714a..53ffc1da 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 ebc608e3..7e604826 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/event_alert.rs b/crates/tower-api/src/models/event_alert.rs new file mode 100644 index 00000000..9e5d32f5 --- /dev/null +++ b/crates/tower-api/src/models/event_alert.rs @@ -0,0 +1,66 @@ +/* + * Tower API + * + * REST API to interact with Tower Services. + * + * The version of the OpenAPI document: v0.9.9 + * Contact: hello@tower.dev + * Generated by: https://openapi-generator.tech + */ +use crate::models; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::{serde_as, DefaultOnNull}; + +#[serde_as] +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct EventAlert { + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "data")] + pub data: models::Alert, + /// The event name. + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "event")] + pub event: Event, + /// The event ID. + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + /// The retry time in milliseconds. + #[serde(rename = "retry", skip_serializing_if = "Option::is_none")] + pub retry: Option, +} + +impl EventAlert { + pub fn new(data: models::Alert, event: Event) -> EventAlert { + EventAlert { + data, + event, + id: None, + retry: None, + } + } +} +/// The event name. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize)] +pub enum Event { + #[serde(rename = "alert")] + Alert, +} + +impl Default for Event { + fn default() -> Event { + Self::Alert + } +} + +impl<'de> Deserialize<'de> for Event { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + match s.to_lowercase().as_str() { + "alert" => Ok(Self::Alert), + _ => Err(serde::de::Error::unknown_variant(&s, &["alert"])), + } + } +} diff --git a/crates/tower-api/src/models/event_error.rs b/crates/tower-api/src/models/event_error.rs index 71ac1216..bc5b2ec7 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 c822c485..0d7fed77 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 a61f477f..6f8b4dac 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 0530f0d8..09886430 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 8f35ceab..bd312a8a 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 0591fe9d..9f44a7c6 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 9c8adc73..171a9169 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 a6ba3829..768ce29a 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 d9f21232..91a37eb6 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 c6601217..e7a6c212 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 02d9104c..5eab8b83 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 cdcbe69f..c49af8ba 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 00920f10..8b8063b6 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 0b50ea13..fcbff0b9 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 422e39f8..2ebf3a2f 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 a9dc0d61..014ccf89 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/get_feature_flag_response_body.rs b/crates/tower-api/src/models/get_feature_flag_response_body.rs index 9774704b..6784096f 100644 --- a/crates/tower-api/src/models/get_feature_flag_response_body.rs +++ b/crates/tower-api/src/models/get_feature_flag_response_body.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/invite_team_member_params.rs b/crates/tower-api/src/models/invite_team_member_params.rs index 5b9ca993..86b8f52b 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 7f320d16..8b5fa769 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 76a4cec8..433b1f2c 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 0beed455..a69f5d66 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 d94bd2ef..99594fdf 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 eba8f071..6d939c0e 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -21,13 +21,18 @@ pub struct ListApiKeysResponse { #[serde_as(as = "DefaultOnNull")] #[serde(rename = "api_keys")] pub api_keys: Vec, + /// Pagination information + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "pages")] + pub pages: models::Pagination, } impl ListApiKeysResponse { - pub fn new(api_keys: Vec) -> ListApiKeysResponse { + pub fn new(api_keys: Vec, pages: models::Pagination) -> ListApiKeysResponse { ListApiKeysResponse { schema: None, api_keys, + pages, } } } 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 b240abc2..e5d1a793 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 9e0f903e..b83ed0b7 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 6d98e44f..e19d6bf1 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 56f35db6..2bf1f7cf 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 d517cfbc..c6c18c4f 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 ec5c0ad2..5bcd03ac 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -20,13 +20,20 @@ pub struct ListEnvironmentsResponse { #[serde_as(as = "DefaultOnNull")] #[serde(rename = "environments")] pub environments: Vec, + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "pages")] + pub pages: models::Pagination, } impl ListEnvironmentsResponse { - pub fn new(environments: Vec) -> ListEnvironmentsResponse { + pub fn new( + environments: Vec, + pages: models::Pagination, + ) -> ListEnvironmentsResponse { ListEnvironmentsResponse { schema: None, environments, + pages, } } } 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 fcb9e413..e2b366af 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_runners_response.rs b/crates/tower-api/src/models/list_runners_response.rs new file mode 100644 index 00000000..905e4730 --- /dev/null +++ b/crates/tower-api/src/models/list_runners_response.rs @@ -0,0 +1,37 @@ +/* + * Tower API + * + * REST API to interact with Tower Services. + * + * The version of the OpenAPI document: v0.9.9 + * Contact: hello@tower.dev + * Generated by: https://openapi-generator.tech + */ +use crate::models; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::{serde_as, DefaultOnNull}; + +#[serde_as] +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ListRunnersResponse { + /// A URL to the JSON Schema for this object. + #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] + pub schema: Option, + /// Pagination information + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "pages")] + pub pages: models::Pagination, + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "runners")] + pub runners: Vec, +} + +impl ListRunnersResponse { + pub fn new(pages: models::Pagination, runners: Vec) -> ListRunnersResponse { + ListRunnersResponse { + schema: None, + pages, + runners, + } + } +} diff --git a/crates/tower-api/src/models/list_runs_response.rs b/crates/tower-api/src/models/list_runs_response.rs index 84bff645..d1e921af 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 cae6633c..9da945c6 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 1066a7ea..d623627f 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 eb6f965c..170cf52d 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 ffe0700b..841819b8 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 a319e48b..8a2c1760 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 c585a90b..077402f7 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -17,6 +17,10 @@ pub struct ListTeamsResponse { /// A URL to the JSON Schema for this object. #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] pub schema: Option, + /// Pagination information + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "pages")] + pub pages: models::Pagination, /// List of teams #[serde_as(as = "DefaultOnNull")] #[serde(rename = "teams")] @@ -24,9 +28,10 @@ pub struct ListTeamsResponse { } impl ListTeamsResponse { - pub fn new(teams: Vec) -> ListTeamsResponse { + pub fn new(pages: models::Pagination, teams: Vec) -> ListTeamsResponse { ListTeamsResponse { schema: None, + pages, teams, } } diff --git a/crates/tower-api/src/models/mod.rs b/crates/tower-api/src/models/mod.rs index a2c34884..9ce820b5 100644 --- a/crates/tower-api/src/models/mod.rs +++ b/crates/tower-api/src/models/mod.rs @@ -62,6 +62,10 @@ pub mod create_password_reset_params; pub use self::create_password_reset_params::CreatePasswordResetParams; pub mod create_password_reset_response; pub use self::create_password_reset_response::CreatePasswordResetResponse; +pub mod create_sandbox_secrets_params; +pub use self::create_sandbox_secrets_params::CreateSandboxSecretsParams; +pub mod create_sandbox_secrets_response; +pub use self::create_sandbox_secrets_response::CreateSandboxSecretsResponse; pub mod create_schedule_params; pub use self::create_schedule_params::CreateScheduleParams; pub mod create_schedule_response; @@ -104,8 +108,12 @@ pub mod delete_team_params; pub use self::delete_team_params::DeleteTeamParams; pub mod delete_team_response; pub use self::delete_team_response::DeleteTeamResponse; +pub mod deploy_app_request; +pub use self::deploy_app_request::DeployAppRequest; pub mod deploy_app_response; pub use self::deploy_app_response::DeployAppResponse; +pub mod describe_account_body; +pub use self::describe_account_body::DescribeAccountBody; pub mod describe_app_response; pub use self::describe_app_response::DescribeAppResponse; pub mod describe_app_version_response; @@ -114,6 +122,10 @@ pub mod describe_device_login_session_response; pub use self::describe_device_login_session_response::DescribeDeviceLoginSessionResponse; pub mod describe_email_preferences_body; pub use self::describe_email_preferences_body::DescribeEmailPreferencesBody; +pub mod describe_run_graph_response; +pub use self::describe_run_graph_response::DescribeRunGraphResponse; +pub mod describe_run_links; +pub use self::describe_run_links::DescribeRunLinks; pub mod describe_run_logs_response; pub use self::describe_run_logs_response::DescribeRunLogsResponse; pub mod describe_run_response; @@ -132,12 +144,12 @@ pub mod error_detail; pub use self::error_detail::ErrorDetail; pub mod error_model; pub use self::error_model::ErrorModel; +pub mod event_alert; +pub use self::event_alert::EventAlert; pub mod event_error; pub use self::event_error::EventError; pub mod event_log; pub use self::event_log::EventLog; -pub mod event_run_failure_alert; -pub use self::event_run_failure_alert::EventRunFailureAlert; pub mod event_warning; pub use self::event_warning::EventWarning; pub mod export_catalogs_params; @@ -176,8 +188,6 @@ pub mod leave_team_response; pub use self::leave_team_response::LeaveTeamResponse; pub mod list_account_plans_response; pub use self::list_account_plans_response::ListAccountPlansResponse; -pub mod list_alerts_200_response; -pub use self::list_alerts_200_response::ListAlerts200Response; pub mod list_alerts_response; pub use self::list_alerts_response::ListAlertsResponse; pub mod list_api_keys_response; @@ -196,6 +206,8 @@ pub mod list_environments_response; pub use self::list_environments_response::ListEnvironmentsResponse; pub mod list_my_team_invitations_response; pub use self::list_my_team_invitations_response::ListMyTeamInvitationsResponse; +pub mod list_runners_response; +pub use self::list_runners_response::ListRunnersResponse; pub mod list_runs_response; pub use self::list_runs_response::ListRunsResponse; pub mod list_schedules_response; @@ -230,12 +242,20 @@ pub mod resend_team_invitation_response; pub use self::resend_team_invitation_response::ResendTeamInvitationResponse; pub mod run; pub use self::run::Run; +pub mod run_app_initiator_data; +pub use self::run_app_initiator_data::RunAppInitiatorData; pub mod run_app_params; pub use self::run_app_params::RunAppParams; pub mod run_app_response; pub use self::run_app_response::RunAppResponse; pub mod run_failure_alert; pub use self::run_failure_alert::RunFailureAlert; +pub mod run_graph_node; +pub use self::run_graph_node::RunGraphNode; +pub mod run_graph_run_id; +pub use self::run_graph_run_id::RunGraphRunId; +pub mod run_initiator; +pub use self::run_initiator::RunInitiator; pub mod run_log_line; pub use self::run_log_line::RunLogLine; pub mod run_parameter; @@ -246,6 +266,8 @@ pub mod run_statistics; pub use self::run_statistics::RunStatistics; pub mod run_timeseries_point; pub use self::run_timeseries_point::RunTimeseriesPoint; +pub mod runner; +pub use self::runner::Runner; pub mod runner_credentials; pub use self::runner_credentials::RunnerCredentials; pub mod schedule; @@ -272,10 +294,10 @@ pub mod token; pub use self::token::Token; pub mod unverified_authenticator; pub use self::unverified_authenticator::UnverifiedAuthenticator; -pub mod update_account_name_params; -pub use self::update_account_name_params::UpdateAccountNameParams; -pub mod update_account_name_response; -pub use self::update_account_name_response::UpdateAccountNameResponse; +pub mod update_account_params; +pub use self::update_account_params::UpdateAccountParams; +pub mod update_account_response; +pub use self::update_account_response::UpdateAccountResponse; pub mod update_app_params; pub use self::update_app_params::UpdateAppParams; pub mod update_app_response; diff --git a/crates/tower-api/src/models/pagination.rs b/crates/tower-api/src/models/pagination.rs index 1717c089..6f8c6486 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 ebc47f0f..7f20d38e 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 197dd540..3567c5fc 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/refresh_session_params.rs b/crates/tower-api/src/models/refresh_session_params.rs index 0791d02c..e8674654 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 d6d8f18d..9ced4515 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 5a1c0ffd..e4814097 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 daa94788..921f0c73 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 d59ed9fa..88a909a5 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 06695f2b..a8e04a9f 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 a5ad63d9..666ab074 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -14,7 +14,7 @@ use serde_with::{serde_as, DefaultOnNull}; #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Run { - /// Link to the run in the Tower UI + /// $link is deprecated. Individual responses include links. #[serde_as(as = "DefaultOnNull")] #[serde(rename = "$link")] pub dollar_link: String, @@ -40,9 +40,17 @@ pub struct Run { /// Exit code of the run, if the run is completed. Null if there is no exit code #[serde(rename = "exit_code", deserialize_with = "Option::deserialize")] pub exit_code: Option, - /// If app is externally accessible, then you can access this run with this hostname + /// hostname is deprecated, use subdomain #[serde(rename = "hostname", skip_serializing_if = "Option::is_none")] pub hostname: Option, + /// Run initiator information + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "initiator")] + pub initiator: models::RunInitiator, + /// Whether this run was triggered by a schedule (true) or on-demand (false). Historical records default to false. + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "is_scheduled")] + pub is_scheduled: bool, #[serde_as(as = "DefaultOnNull")] #[serde(rename = "number")] pub number: i64, @@ -64,6 +72,14 @@ pub struct Run { #[serde_as(as = "DefaultOnNull")] #[serde(rename = "status_group")] pub status_group: StatusGroup, + /// If app is externally accessible, then you can access this run with this hostname. + #[serde( + rename = "subdomain", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub subdomain: Option>, } impl Run { @@ -76,6 +92,8 @@ impl Run { ended_at: Option, environment: String, exit_code: Option, + initiator: models::RunInitiator, + is_scheduled: bool, number: i64, parameters: Vec, run_id: String, @@ -95,6 +113,8 @@ impl Run { environment, exit_code, hostname: None, + initiator, + is_scheduled, number, parameters, run_id, @@ -102,6 +122,7 @@ impl Run { started_at, status, status_group, + subdomain: None, } } } diff --git a/crates/tower-api/src/models/run_app_initiator_data.rs b/crates/tower-api/src/models/run_app_initiator_data.rs new file mode 100644 index 00000000..44ed3b83 --- /dev/null +++ b/crates/tower-api/src/models/run_app_initiator_data.rs @@ -0,0 +1,61 @@ +/* + * Tower API + * + * REST API to interact with Tower Services. + * + * The version of the OpenAPI document: v0.9.9 + * Contact: hello@tower.dev + * Generated by: https://openapi-generator.tech + */ +use crate::models; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::{serde_as, DefaultOnNull}; + +#[serde_as] +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RunAppInitiatorData { + /// The type of the initiator for this run. + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "type")] + pub r#type: Type, +} + +impl RunAppInitiatorData { + pub fn new(r#type: Type) -> RunAppInitiatorData { + RunAppInitiatorData { r#type } + } +} +/// The type of the initiator for this run. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize)] +pub enum Type { + #[serde(rename = "tower_run")] + TowerRun, + #[serde(rename = "tower_cli")] + TowerCli, + #[serde(rename = "tower_ui")] + TowerUi, +} + +impl Default for Type { + fn default() -> Type { + Self::TowerRun + } +} + +impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + match s.to_lowercase().as_str() { + "tower_run" => Ok(Self::TowerRun), + "tower_cli" => Ok(Self::TowerCli), + "tower_ui" => Ok(Self::TowerUi), + _ => Err(serde::de::Error::unknown_variant( + &s, + &["tower_run", "tower_cli", "tower_ui"], + )), + } + } +} diff --git a/crates/tower-api/src/models/run_app_params.rs b/crates/tower-api/src/models/run_app_params.rs index ad6cdcbb..69c9f822 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -21,6 +21,9 @@ pub struct RunAppParams { #[serde_as(as = "DefaultOnNull")] #[serde(rename = "environment")] pub environment: String, + /// Initiator information for this run + #[serde(rename = "initiator", skip_serializing_if = "Option::is_none")] + pub initiator: Option, /// The parameters to pass into this app. #[serde_as(as = "DefaultOnNull")] #[serde(rename = "parameters")] @@ -43,6 +46,7 @@ impl RunAppParams { RunAppParams { schema: None, environment, + initiator: None, parameters, parent_run_id: None, } diff --git a/crates/tower-api/src/models/run_app_response.rs b/crates/tower-api/src/models/run_app_response.rs index 361e325b..45a26d6d 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 36316f9b..9dfd6b45 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_graph_node.rs b/crates/tower-api/src/models/run_graph_node.rs new file mode 100644 index 00000000..df1f3804 --- /dev/null +++ b/crates/tower-api/src/models/run_graph_node.rs @@ -0,0 +1,29 @@ +/* + * Tower API + * + * REST API to interact with Tower Services. + * + * The version of the OpenAPI document: v0.9.9 + * Contact: hello@tower.dev + * Generated by: https://openapi-generator.tech + */ +use crate::models; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::{serde_as, DefaultOnNull}; + +#[serde_as] +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RunGraphNode { + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "id")] + pub id: models::RunGraphRunId, + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "parent_id")] + pub parent_id: models::RunGraphRunId, +} + +impl RunGraphNode { + pub fn new(id: models::RunGraphRunId, parent_id: models::RunGraphRunId) -> RunGraphNode { + RunGraphNode { id, parent_id } + } +} diff --git a/crates/tower-api/src/models/run_graph_run_id.rs b/crates/tower-api/src/models/run_graph_run_id.rs new file mode 100644 index 00000000..c9f629b1 --- /dev/null +++ b/crates/tower-api/src/models/run_graph_run_id.rs @@ -0,0 +1,29 @@ +/* + * Tower API + * + * REST API to interact with Tower Services. + * + * The version of the OpenAPI document: v0.9.9 + * Contact: hello@tower.dev + * Generated by: https://openapi-generator.tech + */ +use crate::models; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::{serde_as, DefaultOnNull}; + +#[serde_as] +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RunGraphRunId { + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "app_name")] + pub app_name: String, + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "number")] + pub number: i64, +} + +impl RunGraphRunId { + pub fn new(app_name: String, number: i64) -> RunGraphRunId { + RunGraphRunId { app_name, number } + } +} diff --git a/crates/tower-api/src/models/run_initiator.rs b/crates/tower-api/src/models/run_initiator.rs new file mode 100644 index 00000000..1e8625cb --- /dev/null +++ b/crates/tower-api/src/models/run_initiator.rs @@ -0,0 +1,26 @@ +/* + * Tower API + * + * REST API to interact with Tower Services. + * + * The version of the OpenAPI document: v0.9.9 + * Contact: hello@tower.dev + * Generated by: https://openapi-generator.tech + */ +use crate::models; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::{serde_as, DefaultOnNull}; + +#[serde_as] +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RunInitiator { + /// The type of initiator for this run + #[serde(rename = "type", deserialize_with = "Option::deserialize")] + pub r#type: Option, +} + +impl RunInitiator { + pub fn new(r#type: Option) -> RunInitiator { + RunInitiator { r#type } + } +} diff --git a/crates/tower-api/src/models/run_log_line.rs b/crates/tower-api/src/models/run_log_line.rs index dae45683..5821fd05 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_parameter.rs b/crates/tower-api/src/models/run_parameter.rs index 1009f769..9d724d7f 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 bc2cf269..4f400db2 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 0b5d1dff..88f3f946 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 7f8ba26c..1f99b06c 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/runner.rs b/crates/tower-api/src/models/runner.rs new file mode 100644 index 00000000..e894100a --- /dev/null +++ b/crates/tower-api/src/models/runner.rs @@ -0,0 +1,61 @@ +/* + * Tower API + * + * REST API to interact with Tower Services. + * + * The version of the OpenAPI document: v0.9.9 + * Contact: hello@tower.dev + * Generated by: https://openapi-generator.tech + */ +use crate::models; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::{serde_as, DefaultOnNull}; + +#[serde_as] +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Runner { + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "active_runs")] + pub active_runs: Vec, + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "created_at")] + pub created_at: String, + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "id")] + pub id: String, + #[serde( + rename = "last_health_check_at", + skip_serializing_if = "Option::is_none" + )] + pub last_health_check_at: Option, + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "max_concurrent_apps")] + pub max_concurrent_apps: i64, + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "num_runs")] + pub num_runs: i64, + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "status")] + pub status: String, +} + +impl Runner { + pub fn new( + active_runs: Vec, + created_at: String, + id: String, + max_concurrent_apps: i64, + num_runs: i64, + status: String, + ) -> Runner { + Runner { + active_runs, + created_at, + id, + last_health_check_at: None, + max_concurrent_apps, + num_runs, + status, + } + } +} diff --git a/crates/tower-api/src/models/runner_credentials.rs b/crates/tower-api/src/models/runner_credentials.rs index f91a1a89..0efff3f1 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 05fb637b..ead43bd7 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/search_runs_response.rs b/crates/tower-api/src/models/search_runs_response.rs index b2c997e5..66b96b8f 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 1350d6d4..fb31ea0a 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 ed2f10e0..f925e1f4 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 5b5f4e0a..aafdf443 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 d0ed5d3d..c6fd93ff 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/stream_alerts_200_response_inner.rs b/crates/tower-api/src/models/stream_alerts_200_response_inner.rs index ff0c4687..39372a4d 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -15,25 +15,25 @@ use serde_with::{serde_as, DefaultOnNull}; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(untagged)] pub enum StreamAlerts200ResponseInner { + EventAlert(models::EventAlert), EventError(models::EventError), - EventRunFailureAlert(models::EventRunFailureAlert), } impl Default for StreamAlerts200ResponseInner { fn default() -> Self { - Self::EventError(Default::default()) + Self::EventAlert(Default::default()) } } /// The event name. #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize)] pub enum Event { - #[serde(rename = "run_failure_alert")] - RunFailureAlert, + #[serde(rename = "error")] + Error, } impl Default for Event { fn default() -> Event { - Self::RunFailureAlert + Self::Error } } @@ -44,11 +44,8 @@ impl<'de> Deserialize<'de> for Event { { let s = String::deserialize(deserializer)?; match s.to_lowercase().as_str() { - "run_failure_alert" => Ok(Self::RunFailureAlert), - _ => Err(serde::de::Error::unknown_variant( - &s, - &["run_failure_alert"], - )), + "error" => Ok(Self::Error), + _ => Err(serde::de::Error::unknown_variant(&s, &["error"])), } } } 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 641f6434..e56428d2 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 6d363c5f..185e066d 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 6547cbc9..48118b7d 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 d85a953b..9b1f56b0 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 4fafaf1a..be1b001c 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_account_params.rs b/crates/tower-api/src/models/update_account_params.rs new file mode 100644 index 00000000..c5e1e967 --- /dev/null +++ b/crates/tower-api/src/models/update_account_params.rs @@ -0,0 +1,39 @@ +/* + * Tower API + * + * REST API to interact with Tower Services. + * + * The version of the OpenAPI document: v0.9.9 + * Contact: hello@tower.dev + * Generated by: https://openapi-generator.tech + */ +use crate::models; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::{serde_as, DefaultOnNull}; + +#[serde_as] +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UpdateAccountParams { + /// A URL to the JSON Schema for this object. + #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] + pub schema: Option, + /// Whether the account is for self-hosted use only + #[serde( + rename = "is_self_hosted_only", + skip_serializing_if = "Option::is_none" + )] + pub is_self_hosted_only: Option, + /// The new name for the account, if any + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +impl UpdateAccountParams { + pub fn new() -> UpdateAccountParams { + UpdateAccountParams { + schema: None, + is_self_hosted_only: None, + name: None, + } + } +} diff --git a/crates/tower-api/src/models/update_account_response.rs b/crates/tower-api/src/models/update_account_response.rs new file mode 100644 index 00000000..53e8f2db --- /dev/null +++ b/crates/tower-api/src/models/update_account_response.rs @@ -0,0 +1,32 @@ +/* + * Tower API + * + * REST API to interact with Tower Services. + * + * The version of the OpenAPI document: v0.9.9 + * Contact: hello@tower.dev + * Generated by: https://openapi-generator.tech + */ +use crate::models; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::{serde_as, DefaultOnNull}; + +#[serde_as] +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UpdateAccountResponse { + /// A URL to the JSON Schema for this object. + #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] + pub schema: Option, + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "account")] + pub account: models::Account, +} + +impl UpdateAccountResponse { + pub fn new(account: models::Account) -> UpdateAccountResponse { + UpdateAccountResponse { + schema: None, + account, + } + } +} diff --git a/crates/tower-api/src/models/update_app_params.rs b/crates/tower-api/src/models/update_app_params.rs index 89275717..0c59fc2a 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -18,9 +18,13 @@ pub struct UpdateAppParams { #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] pub schema: Option, /// New description for the App - #[serde_as(as = "DefaultOnNull")] - #[serde(rename = "description")] - pub description: String, + #[serde( + rename = "description", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub description: 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", @@ -30,18 +34,31 @@ pub struct UpdateAppParams { )] pub is_externally_accessible: Option>, /// New status for the App - #[serde_as(as = "DefaultOnNull")] - #[serde(rename = "status")] - pub status: String, + #[serde( + rename = "status", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub status: Option>, + /// The subdomain this app is accessible under. Requires is_externally_accessible to be true. + #[serde( + rename = "subdomain", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub subdomain: Option>, } impl UpdateAppParams { - pub fn new(description: String, status: String) -> UpdateAppParams { + pub fn new() -> UpdateAppParams { UpdateAppParams { schema: None, - description, + description: None, is_externally_accessible: None, - status, + status: None, + subdomain: None, } } } diff --git a/crates/tower-api/src/models/update_app_response.rs b/crates/tower-api/src/models/update_app_response.rs index 4603c27c..e4c0f004 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 5a5ee66f..6f3792f0 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 38578894..e646522b 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_email_preferences_body.rs b/crates/tower-api/src/models/update_email_preferences_body.rs index f0fccc8a..580312ea 100644 --- a/crates/tower-api/src/models/update_email_preferences_body.rs +++ b/crates/tower-api/src/models/update_email_preferences_body.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 3f0985f6..9bfc2f01 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 0d080878..d2765a6c 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 87160ad2..b76dbcd3 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 06d6f548..aa2ccfed 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 2fb943b7..f965275e 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 5bd1c944..f8b59dfa 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 29b8b3c0..ad640788 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 91fc2083..538ae542 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 75e28478..24424de7 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_schedule_response.rs b/crates/tower-api/src/models/update_schedule_response.rs index c72607ab..910f5676 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 d539fbe8..3584bdd8 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 30da973c..8b8703ec 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 a0372cc6..c5677f4d 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_team_response.rs b/crates/tower-api/src/models/update_team_response.rs index 72eb6c51..1b8c3074 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 1e3f8a48..168c7784 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 489a5297..bb26f7a0 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.8.0 + * The version of the OpenAPI document: v0.9.9 * 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 298863fd..dc4b710e 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/verified_authenticator.rs b/crates/tower-api/src/models/verified_authenticator.rs index feec28ad..789f620b 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.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/verify_email_params.rs b/crates/tower-api/src/models/verify_email_params.rs index 2e30cd87..5b4f1edd 100644 --- a/crates/tower-api/src/models/verify_email_params.rs +++ b/crates/tower-api/src/models/verify_email_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/verify_email_response.rs b/crates/tower-api/src/models/verify_email_response.rs index 652dfc48..2beda4f9 100644 --- a/crates/tower-api/src/models/verify_email_response.rs +++ b/crates/tower-api/src/models/verify_email_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.8.0 + * The version of the OpenAPI document: v0.9.9 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-cmd/src/api.rs b/crates/tower-cmd/src/api.rs index f00963cc..7bc900d4 100644 --- a/crates/tower-cmd/src/api.rs +++ b/crates/tower-cmd/src/api.rs @@ -76,6 +76,7 @@ pub async fn create_app( short_description: Some(description.to_string()), slug: None, is_externally_accessible: None, + subdomain: None, }, }; @@ -130,6 +131,7 @@ pub async fn describe_run_logs( let params = tower_api::apis::default_api::DescribeRunLogsParams { name: name.to_string(), seq, + start_at: None }; unwrap_api_response(tower_api::apis::default_api::describe_run_logs( @@ -153,6 +155,7 @@ pub async fn run_app( environment: env.to_string(), parameters: params, parent_run_id: None, + initiator: None, }, }; @@ -735,7 +738,12 @@ pub async fn list_environments( Error, > { let api_config = &config.into(); - unwrap_api_response(tower_api::apis::default_api::list_environments(api_config)).await + let params = tower_api::apis::default_api::ListEnvironmentsParams { + page: Some(0), + page_size: Some(1000), + }; + + unwrap_api_response(tower_api::apis::default_api::list_environments(api_config, params)).await } pub async fn create_environment( diff --git a/crates/tower-cmd/src/util/apps.rs b/crates/tower-cmd/src/util/apps.rs index fe141308..494d650e 100644 --- a/crates/tower-cmd/src/util/apps.rs +++ b/crates/tower-cmd/src/util/apps.rs @@ -74,7 +74,8 @@ 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 + is_externally_accessible: None, + subdomain: None }, }, ) diff --git a/src/tower/_client.py b/src/tower/_client.py index 81a48637..02124280 100644 --- a/src/tower/_client.py +++ b/src/tower/_client.py @@ -20,6 +20,7 @@ from .tower_api_client.models import ( DescribeRunResponse, Run, + RunAppInitiatorData, RunAppParams, RunAppParamsParameters, RunAppResponse, diff --git a/src/tower/tower_api_client/api/default/create_authenticator.py b/src/tower/tower_api_client/api/default/create_authenticator.py index 9e78dc51..030ef3ed 100644 --- a/src/tower/tower_api_client/api/default/create_authenticator.py +++ b/src/tower/tower_api_client/api/default/create_authenticator.py @@ -18,7 +18,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/accounts/authenticator", + "url": "/authenticators", } _body = body.to_dict() diff --git a/src/tower/tower_api_client/api/default/create_sandbox_secrets.py b/src/tower/tower_api_client/api/default/create_sandbox_secrets.py new file mode 100644 index 00000000..a5668293 --- /dev/null +++ b/src/tower/tower_api_client/api/default/create_sandbox_secrets.py @@ -0,0 +1,168 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.create_sandbox_secrets_params import CreateSandboxSecretsParams +from ...models.create_sandbox_secrets_response import CreateSandboxSecretsResponse +from ...types import Response + + +def _get_kwargs( + *, + body: CreateSandboxSecretsParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/sandbox/secrets", + } + + _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[CreateSandboxSecretsResponse]: + if response.status_code == 200: + response_200 = CreateSandboxSecretsResponse.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[CreateSandboxSecretsResponse]: + 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: CreateSandboxSecretsParams, +) -> Response[CreateSandboxSecretsResponse]: + """Create Tower-provided sandbox secrets + + Creates secrets with Tower-provided default values for the specified keys in the given environment. + + Args: + body (CreateSandboxSecretsParams): + + 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[CreateSandboxSecretsResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: CreateSandboxSecretsParams, +) -> Optional[CreateSandboxSecretsResponse]: + """Create Tower-provided sandbox secrets + + Creates secrets with Tower-provided default values for the specified keys in the given environment. + + Args: + body (CreateSandboxSecretsParams): + + 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: + CreateSandboxSecretsResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: CreateSandboxSecretsParams, +) -> Response[CreateSandboxSecretsResponse]: + """Create Tower-provided sandbox secrets + + Creates secrets with Tower-provided default values for the specified keys in the given environment. + + Args: + body (CreateSandboxSecretsParams): + + 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[CreateSandboxSecretsResponse] + """ + + 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: CreateSandboxSecretsParams, +) -> Optional[CreateSandboxSecretsResponse]: + """Create Tower-provided sandbox secrets + + Creates secrets with Tower-provided default values for the specified keys in the given environment. + + Args: + body (CreateSandboxSecretsParams): + + 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: + CreateSandboxSecretsResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/delete_authenticator.py b/src/tower/tower_api_client/api/default/delete_authenticator.py index bdde7b42..df504b6e 100644 --- a/src/tower/tower_api_client/api/default/delete_authenticator.py +++ b/src/tower/tower_api_client/api/default/delete_authenticator.py @@ -18,7 +18,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "delete", - "url": "/accounts/authenticator", + "url": "/authenticators", } _body = body.to_dict() 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 ac82ce58..d67fca3c 100644 --- a/src/tower/tower_api_client/api/default/deploy_app.py +++ b/src/tower/tower_api_client/api/default/deploy_app.py @@ -5,21 +5,22 @@ from ... import errors from ...client import AuthenticatedClient, Client +from ...models.deploy_app_json_body import DeployAppJsonBody from ...models.deploy_app_response import DeployAppResponse from ...models.error_model import ErrorModel -from ...types import UNSET, Response, Unset +from ...types import UNSET, File, Response, Unset def _get_kwargs( name: str, *, - content_encoding: Union[Unset, str] = UNSET, + body: Union[ + DeployAppJsonBody, + File, + ], 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 @@ -30,6 +31,17 @@ def _get_kwargs( ), } + if isinstance(body, DeployAppJsonBody): + _json_body = body.to_dict() + + _kwargs["json"] = _json_body + headers["Content-Type"] = "application/json" + if isinstance(body, File): + _content_body = body.payload + + _kwargs["content"] = _content_body + headers["Content-Type"] = "application/octet-stream" + _kwargs["headers"] = headers return _kwargs @@ -74,19 +86,25 @@ def sync_detailed( name: str, *, client: AuthenticatedClient, - content_encoding: Union[Unset, str] = UNSET, + body: Union[ + DeployAppJsonBody, + File, + ], x_tower_checksum_sha256: Union[Unset, str] = UNSET, ) -> Response[Union[DeployAppResponse, ErrorModel]]: """Deploy app - Deploy a new version of an app. Reads the request body, which is a TAR file (or a GZipped TAR file) - and creates a new deployment for an app based on that file. + Deploy a new version of an app. Accepts either a TAR file upload (application/tar) or a JSON body + with source_uri (application/json) for deploying from a GitHub repository. 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. + body (DeployAppJsonBody): Example: {'source_uri': 'https://github.com/tower/tower- + examples/tree/main/01-hello-world'}. + body (File): A .tar or .tar.gz file containing the code to deploy and MANIFEST Example: + . Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -98,7 +116,7 @@ def sync_detailed( kwargs = _get_kwargs( name=name, - content_encoding=content_encoding, + body=body, x_tower_checksum_sha256=x_tower_checksum_sha256, ) @@ -113,19 +131,25 @@ def sync( name: str, *, client: AuthenticatedClient, - content_encoding: Union[Unset, str] = UNSET, + body: Union[ + DeployAppJsonBody, + File, + ], x_tower_checksum_sha256: Union[Unset, str] = UNSET, ) -> Optional[Union[DeployAppResponse, ErrorModel]]: """Deploy app - Deploy a new version of an app. Reads the request body, which is a TAR file (or a GZipped TAR file) - and creates a new deployment for an app based on that file. + Deploy a new version of an app. Accepts either a TAR file upload (application/tar) or a JSON body + with source_uri (application/json) for deploying from a GitHub repository. 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. + body (DeployAppJsonBody): Example: {'source_uri': 'https://github.com/tower/tower- + examples/tree/main/01-hello-world'}. + body (File): A .tar or .tar.gz file containing the code to deploy and MANIFEST Example: + . Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -138,7 +162,7 @@ def sync( return sync_detailed( name=name, client=client, - content_encoding=content_encoding, + body=body, x_tower_checksum_sha256=x_tower_checksum_sha256, ).parsed @@ -147,19 +171,25 @@ async def asyncio_detailed( name: str, *, client: AuthenticatedClient, - content_encoding: Union[Unset, str] = UNSET, + body: Union[ + DeployAppJsonBody, + File, + ], x_tower_checksum_sha256: Union[Unset, str] = UNSET, ) -> Response[Union[DeployAppResponse, ErrorModel]]: """Deploy app - Deploy a new version of an app. Reads the request body, which is a TAR file (or a GZipped TAR file) - and creates a new deployment for an app based on that file. + Deploy a new version of an app. Accepts either a TAR file upload (application/tar) or a JSON body + with source_uri (application/json) for deploying from a GitHub repository. 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. + body (DeployAppJsonBody): Example: {'source_uri': 'https://github.com/tower/tower- + examples/tree/main/01-hello-world'}. + body (File): A .tar or .tar.gz file containing the code to deploy and MANIFEST Example: + . Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -171,7 +201,7 @@ async def asyncio_detailed( kwargs = _get_kwargs( name=name, - content_encoding=content_encoding, + body=body, x_tower_checksum_sha256=x_tower_checksum_sha256, ) @@ -184,19 +214,25 @@ async def asyncio( name: str, *, client: AuthenticatedClient, - content_encoding: Union[Unset, str] = UNSET, + body: Union[ + DeployAppJsonBody, + File, + ], x_tower_checksum_sha256: Union[Unset, str] = UNSET, ) -> Optional[Union[DeployAppResponse, ErrorModel]]: """Deploy app - Deploy a new version of an app. Reads the request body, which is a TAR file (or a GZipped TAR file) - and creates a new deployment for an app based on that file. + Deploy a new version of an app. Accepts either a TAR file upload (application/tar) or a JSON body + with source_uri (application/json) for deploying from a GitHub repository. 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. + body (DeployAppJsonBody): Example: {'source_uri': 'https://github.com/tower/tower- + examples/tree/main/01-hello-world'}. + body (File): A .tar or .tar.gz file containing the code to deploy and MANIFEST Example: + . Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -210,7 +246,7 @@ async def asyncio( await asyncio_detailed( name=name, client=client, - content_encoding=content_encoding, + body=body, x_tower_checksum_sha256=x_tower_checksum_sha256, ) ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_account.py b/src/tower/tower_api_client/api/default/describe_account.py new file mode 100644 index 00000000..a223552a --- /dev/null +++ b/src/tower/tower_api_client/api/default/describe_account.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.describe_account_body import DescribeAccountBody +from ...types import Response + + +def _get_kwargs( + name: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/accounts/{name}".format( + name=name, + ), + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[DescribeAccountBody]: + if response.status_code == 200: + response_200 = DescribeAccountBody.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[DescribeAccountBody]: + 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, +) -> Response[DescribeAccountBody]: + """Describe account + + Get information about a specific account by name. + + Args: + name (str): The name of the account to describe + + 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[DescribeAccountBody] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, +) -> Optional[DescribeAccountBody]: + """Describe account + + Get information about a specific account by name. + + Args: + name (str): The name of the account to describe + + 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: + DescribeAccountBody + """ + + return sync_detailed( + name=name, + client=client, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[DescribeAccountBody]: + """Describe account + + Get information about a specific account by name. + + Args: + name (str): The name of the account to describe + + 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[DescribeAccountBody] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, +) -> Optional[DescribeAccountBody]: + """Describe account + + Get information about a specific account by name. + + Args: + name (str): The name of the account to describe + + 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: + DescribeAccountBody + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_run_graph.py b/src/tower/tower_api_client/api/default/describe_run_graph.py new file mode 100644 index 00000000..b1756a29 --- /dev/null +++ b/src/tower/tower_api_client/api/default/describe_run_graph.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.describe_run_graph_response import DescribeRunGraphResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + name: str, + seq: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/apps/{name}/runs/{seq}/graph".format( + name=name, + seq=seq, + ), + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[DescribeRunGraphResponse, ErrorModel]]: + if response.status_code == 200: + response_200 = DescribeRunGraphResponse.from_dict(response.json()) + + return response_200 + if response.status_code == 401: + response_401 = ErrorModel.from_dict(response.json()) + + return response_401 + if response.status_code == 404: + response_404 = ErrorModel.from_dict(response.json()) + + return response_404 + 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[Union[DescribeRunGraphResponse, ErrorModel]]: + 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, + seq: int, + *, + client: AuthenticatedClient, +) -> Response[Union[DescribeRunGraphResponse, ErrorModel]]: + """Describe run graph + + Describe the graph that a run belongs to. + + Args: + name (str): The name of the app. + seq (int): The number of the run to fetch. + + 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[Union[DescribeRunGraphResponse, ErrorModel]] + """ + + kwargs = _get_kwargs( + name=name, + seq=seq, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + seq: int, + *, + client: AuthenticatedClient, +) -> Optional[Union[DescribeRunGraphResponse, ErrorModel]]: + """Describe run graph + + Describe the graph that a run belongs to. + + Args: + name (str): The name of the app. + seq (int): The number of the run to fetch. + + 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: + Union[DescribeRunGraphResponse, ErrorModel] + """ + + return sync_detailed( + name=name, + seq=seq, + client=client, + ).parsed + + +async def asyncio_detailed( + name: str, + seq: int, + *, + client: AuthenticatedClient, +) -> Response[Union[DescribeRunGraphResponse, ErrorModel]]: + """Describe run graph + + Describe the graph that a run belongs to. + + Args: + name (str): The name of the app. + seq (int): The number of the run to fetch. + + 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[Union[DescribeRunGraphResponse, ErrorModel]] + """ + + kwargs = _get_kwargs( + name=name, + seq=seq, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + seq: int, + *, + client: AuthenticatedClient, +) -> Optional[Union[DescribeRunGraphResponse, ErrorModel]]: + """Describe run graph + + Describe the graph that a run belongs to. + + Args: + name (str): The name of the app. + seq (int): The number of the run to fetch. + + 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: + Union[DescribeRunGraphResponse, ErrorModel] + """ + + return ( + await asyncio_detailed( + name=name, + seq=seq, + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_run_logs.py b/src/tower/tower_api_client/api/default/describe_run_logs.py index 1e1d81e3..059188db 100644 --- a/src/tower/tower_api_client/api/default/describe_run_logs.py +++ b/src/tower/tower_api_client/api/default/describe_run_logs.py @@ -1,3 +1,4 @@ +import datetime from http import HTTPStatus from typing import Any, Optional, Union @@ -6,19 +7,31 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.describe_run_logs_response import DescribeRunLogsResponse -from ...types import Response +from ...types import UNSET, Response, Unset def _get_kwargs( name: str, seq: int, + *, + start_at: Union[Unset, datetime.datetime] = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} + + json_start_at: Union[Unset, str] = UNSET + if not isinstance(start_at, Unset): + json_start_at = start_at.isoformat() + params["start_at"] = json_start_at + + 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": "/apps/{name}/runs/{seq}/logs".format( name=name, seq=seq, ), + "params": params, } return _kwargs @@ -53,6 +66,7 @@ def sync_detailed( seq: int, *, client: AuthenticatedClient, + start_at: Union[Unset, datetime.datetime] = UNSET, ) -> Response[DescribeRunLogsResponse]: """Describe run logs @@ -61,6 +75,8 @@ def sync_detailed( Args: name (str): The name of the app to get logs for. seq (int): The sequence number of the run to get logs for. + start_at (Union[Unset, datetime.datetime]): Fetch logs from this timestamp onwards + (inclusive). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -73,6 +89,7 @@ def sync_detailed( kwargs = _get_kwargs( name=name, seq=seq, + start_at=start_at, ) response = client.get_httpx_client().request( @@ -87,6 +104,7 @@ def sync( seq: int, *, client: AuthenticatedClient, + start_at: Union[Unset, datetime.datetime] = UNSET, ) -> Optional[DescribeRunLogsResponse]: """Describe run logs @@ -95,6 +113,8 @@ def sync( Args: name (str): The name of the app to get logs for. seq (int): The sequence number of the run to get logs for. + start_at (Union[Unset, datetime.datetime]): Fetch logs from this timestamp onwards + (inclusive). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -108,6 +128,7 @@ def sync( name=name, seq=seq, client=client, + start_at=start_at, ).parsed @@ -116,6 +137,7 @@ async def asyncio_detailed( seq: int, *, client: AuthenticatedClient, + start_at: Union[Unset, datetime.datetime] = UNSET, ) -> Response[DescribeRunLogsResponse]: """Describe run logs @@ -124,6 +146,8 @@ async def asyncio_detailed( Args: name (str): The name of the app to get logs for. seq (int): The sequence number of the run to get logs for. + start_at (Union[Unset, datetime.datetime]): Fetch logs from this timestamp onwards + (inclusive). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -136,6 +160,7 @@ async def asyncio_detailed( kwargs = _get_kwargs( name=name, seq=seq, + start_at=start_at, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -148,6 +173,7 @@ async def asyncio( seq: int, *, client: AuthenticatedClient, + start_at: Union[Unset, datetime.datetime] = UNSET, ) -> Optional[DescribeRunLogsResponse]: """Describe run logs @@ -156,6 +182,8 @@ async def asyncio( Args: name (str): The name of the app to get logs for. seq (int): The sequence number of the run to get logs for. + start_at (Union[Unset, datetime.datetime]): Fetch logs from this timestamp onwards + (inclusive). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -170,5 +198,6 @@ async def asyncio( name=name, seq=seq, client=client, + start_at=start_at, ) ).parsed diff --git a/src/tower/tower_api_client/api/default/generate_authenticator.py b/src/tower/tower_api_client/api/default/generate_authenticator.py index 0eb780b2..62e898c2 100644 --- a/src/tower/tower_api_client/api/default/generate_authenticator.py +++ b/src/tower/tower_api_client/api/default/generate_authenticator.py @@ -12,7 +12,7 @@ def _get_kwargs() -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "post", - "url": "/accounts/authenticator/generate", + "url": "/authenticators/generate", } return _kwargs 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 a69576b3..adaf37bf 100644 --- a/src/tower/tower_api_client/api/default/list_alerts.py +++ b/src/tower/tower_api_client/api/default/list_alerts.py @@ -12,16 +12,20 @@ def _get_kwargs( *, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, alert_type: Union[Unset, str] = UNSET, start_at: Union[Unset, datetime.datetime] = UNSET, end_at: Union[Unset, datetime.datetime] = UNSET, - 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] = {} + params["page"] = page + + params["page_size"] = page_size + params["alert_type"] = alert_type json_start_at: Union[Unset, str] = UNSET @@ -34,10 +38,6 @@ def _get_kwargs( json_end_at = end_at.isoformat() params["end_at"] = json_end_at - params["page"] = page - - params["page_size"] = page_size - params["acked"] = acked params["environment"] = environment @@ -80,11 +80,11 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, alert_type: Union[Unset, str] = UNSET, start_at: Union[Unset, datetime.datetime] = UNSET, end_at: Union[Unset, datetime.datetime] = UNSET, - page: Union[Unset, int] = UNSET, - page_size: Union[Unset, int] = UNSET, acked: Union[Unset, str] = UNSET, environment: Union[Unset, str] = UNSET, ) -> Response[ListAlertsResponse]: @@ -93,13 +93,13 @@ def sync_detailed( List alerts for the current account with optional filtering 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. alert_type (Union[Unset, str]): Filter alerts by alert type start_at (Union[Unset, datetime.datetime]): Filter alerts created after or at this datetime (inclusive) end_at (Union[Unset, datetime.datetime]): Filter alerts created before or at this datetime (inclusive) - 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) @@ -112,11 +112,11 @@ def sync_detailed( """ kwargs = _get_kwargs( + page=page, + page_size=page_size, alert_type=alert_type, start_at=start_at, end_at=end_at, - page=page, - page_size=page_size, acked=acked, environment=environment, ) @@ -131,11 +131,11 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, alert_type: Union[Unset, str] = UNSET, start_at: Union[Unset, datetime.datetime] = UNSET, end_at: Union[Unset, datetime.datetime] = UNSET, - page: Union[Unset, int] = UNSET, - page_size: Union[Unset, int] = UNSET, acked: Union[Unset, str] = UNSET, environment: Union[Unset, str] = UNSET, ) -> Optional[ListAlertsResponse]: @@ -144,13 +144,13 @@ def sync( List alerts for the current account with optional filtering 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. alert_type (Union[Unset, str]): Filter alerts by alert type start_at (Union[Unset, datetime.datetime]): Filter alerts created after or at this datetime (inclusive) end_at (Union[Unset, datetime.datetime]): Filter alerts created before or at this datetime (inclusive) - 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) @@ -164,11 +164,11 @@ def sync( return sync_detailed( client=client, + page=page, + page_size=page_size, alert_type=alert_type, start_at=start_at, end_at=end_at, - page=page, - page_size=page_size, acked=acked, environment=environment, ).parsed @@ -177,11 +177,11 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, alert_type: Union[Unset, str] = UNSET, start_at: Union[Unset, datetime.datetime] = UNSET, end_at: Union[Unset, datetime.datetime] = UNSET, - page: Union[Unset, int] = UNSET, - page_size: Union[Unset, int] = UNSET, acked: Union[Unset, str] = UNSET, environment: Union[Unset, str] = UNSET, ) -> Response[ListAlertsResponse]: @@ -190,13 +190,13 @@ async def asyncio_detailed( List alerts for the current account with optional filtering 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. alert_type (Union[Unset, str]): Filter alerts by alert type start_at (Union[Unset, datetime.datetime]): Filter alerts created after or at this datetime (inclusive) end_at (Union[Unset, datetime.datetime]): Filter alerts created before or at this datetime (inclusive) - 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) @@ -209,11 +209,11 @@ async def asyncio_detailed( """ kwargs = _get_kwargs( + page=page, + page_size=page_size, alert_type=alert_type, start_at=start_at, end_at=end_at, - page=page, - page_size=page_size, acked=acked, environment=environment, ) @@ -226,11 +226,11 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, alert_type: Union[Unset, str] = UNSET, start_at: Union[Unset, datetime.datetime] = UNSET, end_at: Union[Unset, datetime.datetime] = UNSET, - page: Union[Unset, int] = UNSET, - page_size: Union[Unset, int] = UNSET, acked: Union[Unset, str] = UNSET, environment: Union[Unset, str] = UNSET, ) -> Optional[ListAlertsResponse]: @@ -239,13 +239,13 @@ async def asyncio( List alerts for the current account with optional filtering 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. alert_type (Union[Unset, str]): Filter alerts by alert type start_at (Union[Unset, datetime.datetime]): Filter alerts created after or at this datetime (inclusive) end_at (Union[Unset, datetime.datetime]): Filter alerts created before or at this datetime (inclusive) - 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) @@ -260,11 +260,11 @@ async def asyncio( return ( await asyncio_detailed( client=client, + page=page, + page_size=page_size, alert_type=alert_type, start_at=start_at, end_at=end_at, - page=page, - page_size=page_size, acked=acked, environment=environment, ) diff --git a/src/tower/tower_api_client/api/default/list_api_keys.py b/src/tower/tower_api_client/api/default/list_api_keys.py index 6329c24d..a0619c30 100644 --- a/src/tower/tower_api_client/api/default/list_api_keys.py +++ b/src/tower/tower_api_client/api/default/list_api_keys.py @@ -6,13 +6,26 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.list_api_keys_response import ListAPIKeysResponse -from ...types import Response +from ...types import UNSET, Response, Unset -def _get_kwargs() -> dict[str, Any]: +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": "/api-keys", + "params": params, } return _kwargs @@ -45,11 +58,17 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, ) -> Response[ListAPIKeysResponse]: """List API keys List all the API keys associated with your 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. @@ -58,7 +77,10 @@ def sync_detailed( Response[ListAPIKeysResponse] """ - kwargs = _get_kwargs() + kwargs = _get_kwargs( + page=page, + page_size=page_size, + ) response = client.get_httpx_client().request( **kwargs, @@ -70,11 +92,17 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, ) -> Optional[ListAPIKeysResponse]: """List API keys List all the API keys associated with your 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. @@ -85,17 +113,25 @@ def sync( 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[ListAPIKeysResponse]: """List API keys List all the API keys associated with your 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. @@ -104,7 +140,10 @@ async def asyncio_detailed( Response[ListAPIKeysResponse] """ - kwargs = _get_kwargs() + kwargs = _get_kwargs( + page=page, + page_size=page_size, + ) response = await client.get_async_httpx_client().request(**kwargs) @@ -114,11 +153,17 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, ) -> Optional[ListAPIKeysResponse]: """List API keys List all the API keys associated with your 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. @@ -130,5 +175,7 @@ async def asyncio( return ( await asyncio_detailed( client=client, + page=page, + page_size=page_size, ) ).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 360d563c..66997769 100644 --- a/src/tower/tower_api_client/api/default/list_apps.py +++ b/src/tower/tower_api_client/api/default/list_apps.py @@ -13,9 +13,9 @@ def _get_kwargs( *, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, query: Union[Unset, str] = UNSET, - page: Union[Unset, int] = UNSET, - page_size: Union[Unset, int] = UNSET, num_runs: Union[Unset, int] = 20, sort: Union[Unset, ListAppsSort] = ListAppsSort.CREATED_AT, filter_: Union[Unset, ListAppsFilter] = UNSET, @@ -23,12 +23,12 @@ def _get_kwargs( ) -> dict[str, Any]: params: dict[str, Any] = {} - params["query"] = query - params["page"] = page params["page_size"] = page_size + params["query"] = query + params["num_runs"] = num_runs json_sort: Union[Unset, str] = UNSET @@ -83,9 +83,9 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, query: Union[Unset, str] = UNSET, - page: Union[Unset, int] = UNSET, - page_size: Union[Unset, int] = UNSET, num_runs: Union[Unset, int] = 20, sort: Union[Unset, ListAppsSort] = ListAppsSort.CREATED_AT, filter_: Union[Unset, ListAppsFilter] = UNSET, @@ -96,9 +96,9 @@ def sync_detailed( Get all the apps 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. query (Union[Unset, str]): The search query to filter apps by. - page (Union[Unset, int]): The page number to fetch. - page_size (Union[Unset, int]): The number of records to fetch on each page. num_runs (Union[Unset, int]): Number of recent runs to fetch (-1 for all runs, defaults to 20) Default: 20. sort (Union[Unset, ListAppsSort]): Sort order for the results. Default: @@ -116,9 +116,9 @@ def sync_detailed( """ kwargs = _get_kwargs( - query=query, page=page, page_size=page_size, + query=query, num_runs=num_runs, sort=sort, filter_=filter_, @@ -135,9 +135,9 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, query: Union[Unset, str] = UNSET, - page: Union[Unset, int] = UNSET, - page_size: Union[Unset, int] = UNSET, num_runs: Union[Unset, int] = 20, sort: Union[Unset, ListAppsSort] = ListAppsSort.CREATED_AT, filter_: Union[Unset, ListAppsFilter] = UNSET, @@ -148,9 +148,9 @@ def sync( Get all the apps 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. query (Union[Unset, str]): The search query to filter apps by. - page (Union[Unset, int]): The page number to fetch. - page_size (Union[Unset, int]): The number of records to fetch on each page. num_runs (Union[Unset, int]): Number of recent runs to fetch (-1 for all runs, defaults to 20) Default: 20. sort (Union[Unset, ListAppsSort]): Sort order for the results. Default: @@ -169,9 +169,9 @@ def sync( return sync_detailed( client=client, - query=query, page=page, page_size=page_size, + query=query, num_runs=num_runs, sort=sort, filter_=filter_, @@ -182,9 +182,9 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, query: Union[Unset, str] = UNSET, - page: Union[Unset, int] = UNSET, - page_size: Union[Unset, int] = UNSET, num_runs: Union[Unset, int] = 20, sort: Union[Unset, ListAppsSort] = ListAppsSort.CREATED_AT, filter_: Union[Unset, ListAppsFilter] = UNSET, @@ -195,9 +195,9 @@ async def asyncio_detailed( Get all the apps 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. query (Union[Unset, str]): The search query to filter apps by. - page (Union[Unset, int]): The page number to fetch. - page_size (Union[Unset, int]): The number of records to fetch on each page. num_runs (Union[Unset, int]): Number of recent runs to fetch (-1 for all runs, defaults to 20) Default: 20. sort (Union[Unset, ListAppsSort]): Sort order for the results. Default: @@ -215,9 +215,9 @@ async def asyncio_detailed( """ kwargs = _get_kwargs( - query=query, page=page, page_size=page_size, + query=query, num_runs=num_runs, sort=sort, filter_=filter_, @@ -232,9 +232,9 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, query: Union[Unset, str] = UNSET, - page: Union[Unset, int] = UNSET, - page_size: Union[Unset, int] = UNSET, num_runs: Union[Unset, int] = 20, sort: Union[Unset, ListAppsSort] = ListAppsSort.CREATED_AT, filter_: Union[Unset, ListAppsFilter] = UNSET, @@ -245,9 +245,9 @@ async def asyncio( Get all the apps 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. query (Union[Unset, str]): The search query to filter apps by. - page (Union[Unset, int]): The page number to fetch. - page_size (Union[Unset, int]): The number of records to fetch on each page. num_runs (Union[Unset, int]): Number of recent runs to fetch (-1 for all runs, defaults to 20) Default: 20. sort (Union[Unset, ListAppsSort]): Sort order for the results. Default: @@ -267,9 +267,9 @@ async def asyncio( return ( await asyncio_detailed( client=client, - query=query, page=page, page_size=page_size, + query=query, num_runs=num_runs, sort=sort, filter_=filter_, diff --git a/src/tower/tower_api_client/api/default/list_authenticators.py b/src/tower/tower_api_client/api/default/list_authenticators.py index b4df89bf..cd2115c2 100644 --- a/src/tower/tower_api_client/api/default/list_authenticators.py +++ b/src/tower/tower_api_client/api/default/list_authenticators.py @@ -12,7 +12,7 @@ def _get_kwargs() -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": "/accounts/authenticator", + "url": "/authenticators", } return _kwargs diff --git a/src/tower/tower_api_client/api/default/list_catalogs.py b/src/tower/tower_api_client/api/default/list_catalogs.py index 33395140..0f6f00b9 100644 --- a/src/tower/tower_api_client/api/default/list_catalogs.py +++ b/src/tower/tower_api_client/api/default/list_catalogs.py @@ -11,21 +11,21 @@ def _get_kwargs( *, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, environment: Union[Unset, str] = UNSET, all_: Union[Unset, bool] = UNSET, - page: Union[Unset, int] = UNSET, - page_size: Union[Unset, int] = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - params["environment"] = environment - - params["all"] = all_ - params["page"] = page params["page_size"] = page_size + params["environment"] = environment + + params["all"] = all_ + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} _kwargs: dict[str, Any] = { @@ -64,21 +64,21 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, environment: Union[Unset, str] = UNSET, all_: Union[Unset, bool] = UNSET, - page: Union[Unset, int] = UNSET, - page_size: Union[Unset, int] = UNSET, ) -> Response[ListCatalogsResponse]: """List catalogs Lists all the catalogs associated with your 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. environment (Union[Unset, str]): The environment to filter by. all_ (Union[Unset, bool]): Whether to fetch all catalogs across all environments or only for the current environment. - page (Union[Unset, int]): The page number to fetch. - page_size (Union[Unset, int]): The number of records to fetch on each page. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -89,10 +89,10 @@ def sync_detailed( """ kwargs = _get_kwargs( - environment=environment, - all_=all_, page=page, page_size=page_size, + environment=environment, + all_=all_, ) response = client.get_httpx_client().request( @@ -105,21 +105,21 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, environment: Union[Unset, str] = UNSET, all_: Union[Unset, bool] = UNSET, - page: Union[Unset, int] = UNSET, - page_size: Union[Unset, int] = UNSET, ) -> Optional[ListCatalogsResponse]: """List catalogs Lists all the catalogs associated with your 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. environment (Union[Unset, str]): The environment to filter by. all_ (Union[Unset, bool]): Whether to fetch all catalogs across all environments or only for the current environment. - page (Union[Unset, int]): The page number to fetch. - page_size (Union[Unset, int]): The number of records to fetch on each page. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -131,31 +131,31 @@ def sync( return sync_detailed( client=client, - environment=environment, - all_=all_, page=page, page_size=page_size, + environment=environment, + all_=all_, ).parsed async def asyncio_detailed( *, client: AuthenticatedClient, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, environment: Union[Unset, str] = UNSET, all_: Union[Unset, bool] = UNSET, - page: Union[Unset, int] = UNSET, - page_size: Union[Unset, int] = UNSET, ) -> Response[ListCatalogsResponse]: """List catalogs Lists all the catalogs associated with your 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. environment (Union[Unset, str]): The environment to filter by. all_ (Union[Unset, bool]): Whether to fetch all catalogs across all environments or only for the current environment. - page (Union[Unset, int]): The page number to fetch. - page_size (Union[Unset, int]): The number of records to fetch on each page. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -166,10 +166,10 @@ async def asyncio_detailed( """ kwargs = _get_kwargs( - environment=environment, - all_=all_, page=page, page_size=page_size, + environment=environment, + all_=all_, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -180,21 +180,21 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, environment: Union[Unset, str] = UNSET, all_: Union[Unset, bool] = UNSET, - page: Union[Unset, int] = UNSET, - page_size: Union[Unset, int] = UNSET, ) -> Optional[ListCatalogsResponse]: """List catalogs Lists all the catalogs associated with your 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. environment (Union[Unset, str]): The environment to filter by. all_ (Union[Unset, bool]): Whether to fetch all catalogs across all environments or only for the current environment. - page (Union[Unset, int]): The page number to fetch. - page_size (Union[Unset, int]): The number of records to fetch on each page. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -207,9 +207,9 @@ async def asyncio( return ( await asyncio_detailed( client=client, - environment=environment, - all_=all_, page=page, page_size=page_size, + environment=environment, + all_=all_, ) ).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 index a8c81ccb..3c949b62 100644 --- a/src/tower/tower_api_client/api/default/list_environments.py +++ b/src/tower/tower_api_client/api/default/list_environments.py @@ -6,13 +6,26 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.list_environments_response import ListEnvironmentsResponse -from ...types import Response +from ...types import UNSET, Response, Unset -def _get_kwargs() -> dict[str, Any]: +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": "/environments", + "params": params, } return _kwargs @@ -45,11 +58,17 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, ) -> Response[ListEnvironmentsResponse]: """List environments List all environments in your 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. @@ -58,7 +77,10 @@ def sync_detailed( Response[ListEnvironmentsResponse] """ - kwargs = _get_kwargs() + kwargs = _get_kwargs( + page=page, + page_size=page_size, + ) response = client.get_httpx_client().request( **kwargs, @@ -70,11 +92,17 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, ) -> Optional[ListEnvironmentsResponse]: """List environments List all environments in your 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. @@ -85,17 +113,25 @@ def sync( 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[ListEnvironmentsResponse]: """List environments List all environments in your 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. @@ -104,7 +140,10 @@ async def asyncio_detailed( Response[ListEnvironmentsResponse] """ - kwargs = _get_kwargs() + kwargs = _get_kwargs( + page=page, + page_size=page_size, + ) response = await client.get_async_httpx_client().request(**kwargs) @@ -114,11 +153,17 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, ) -> Optional[ListEnvironmentsResponse]: """List environments List all environments in your 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. @@ -130,5 +175,7 @@ async def asyncio( return ( await asyncio_detailed( client=client, + page=page, + page_size=page_size, ) ).parsed diff --git a/src/tower/tower_api_client/api/default/list_runners.py b/src/tower/tower_api_client/api/default/list_runners.py new file mode 100644 index 00000000..b8fd45f8 --- /dev/null +++ b/src/tower/tower_api_client/api/default/list_runners.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_runners_response import ListRunnersResponse +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": "/runners", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ListRunnersResponse]: + if response.status_code == 200: + response_200 = ListRunnersResponse.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[ListRunnersResponse]: + 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[ListRunnersResponse]: + """List runners + + Get all self-hosted runners 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[ListRunnersResponse] + """ + + 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[ListRunnersResponse]: + """List runners + + Get all self-hosted runners 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: + ListRunnersResponse + """ + + 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[ListRunnersResponse]: + """List runners + + Get all self-hosted runners 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[ListRunnersResponse] + """ + + 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[ListRunnersResponse]: + """List runners + + Get all self-hosted runners 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: + ListRunnersResponse + """ + + 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 0399ca87..c5fae05b 100644 --- a/src/tower/tower_api_client/api/default/list_runs.py +++ b/src/tower/tower_api_client/api/default/list_runs.py @@ -105,8 +105,8 @@ def sync_detailed( name (str): The name of the app to fetch runs for. 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. - status (Union[Unset, list[ListRunsStatusItem]]): Filter runs by status(es) (comma - separated for multiple). + status (Union[Unset, list[ListRunsStatusItem]]): Filter runs by status(es). Define + multiple with a comma-separated list. Supplying none will return all statuses. start_at (Union[Unset, datetime.datetime]): Filter runs scheduled after or at this datetime (inclusive) end_at (Union[Unset, datetime.datetime]): Filter runs scheduled before or at this datetime @@ -159,8 +159,8 @@ def sync( name (str): The name of the app to fetch runs for. 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. - status (Union[Unset, list[ListRunsStatusItem]]): Filter runs by status(es) (comma - separated for multiple). + status (Union[Unset, list[ListRunsStatusItem]]): Filter runs by status(es). Define + multiple with a comma-separated list. Supplying none will return all statuses. start_at (Union[Unset, datetime.datetime]): Filter runs scheduled after or at this datetime (inclusive) end_at (Union[Unset, datetime.datetime]): Filter runs scheduled before or at this datetime @@ -208,8 +208,8 @@ async def asyncio_detailed( name (str): The name of the app to fetch runs for. 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. - status (Union[Unset, list[ListRunsStatusItem]]): Filter runs by status(es) (comma - separated for multiple). + status (Union[Unset, list[ListRunsStatusItem]]): Filter runs by status(es). Define + multiple with a comma-separated list. Supplying none will return all statuses. start_at (Union[Unset, datetime.datetime]): Filter runs scheduled after or at this datetime (inclusive) end_at (Union[Unset, datetime.datetime]): Filter runs scheduled before or at this datetime @@ -260,8 +260,8 @@ async def asyncio( name (str): The name of the app to fetch runs for. 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. - status (Union[Unset, list[ListRunsStatusItem]]): Filter runs by status(es) (comma - separated for multiple). + status (Union[Unset, list[ListRunsStatusItem]]): Filter runs by status(es). Define + multiple with a comma-separated list. Supplying none will return all statuses. start_at (Union[Unset, datetime.datetime]): Filter runs scheduled after or at this datetime (inclusive) end_at (Union[Unset, datetime.datetime]): Filter runs scheduled before or at this datetime diff --git a/src/tower/tower_api_client/api/default/list_schedules.py b/src/tower/tower_api_client/api/default/list_schedules.py index f9c8288e..8eecc7f1 100644 --- a/src/tower/tower_api_client/api/default/list_schedules.py +++ b/src/tower/tower_api_client/api/default/list_schedules.py @@ -11,8 +11,8 @@ def _get_kwargs( *, - page: Union[Unset, int] = UNSET, - page_size: Union[Unset, int] = UNSET, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, environment: Union[Unset, str] = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -61,8 +61,8 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - page: Union[Unset, int] = UNSET, - page_size: Union[Unset, int] = UNSET, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, environment: Union[Unset, str] = UNSET, ) -> Response[ListSchedulesResponse]: """List schedules @@ -70,8 +70,8 @@ def sync_detailed( List all schedules for an app. Args: - page (Union[Unset, int]): The page number to fetch. - page_size (Union[Unset, int]): The number of records to fetch on each page. + 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. environment (Union[Unset, str]): Filter schedules by environment. If not provided, all environments will be included. @@ -99,8 +99,8 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - page: Union[Unset, int] = UNSET, - page_size: Union[Unset, int] = UNSET, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, environment: Union[Unset, str] = UNSET, ) -> Optional[ListSchedulesResponse]: """List schedules @@ -108,8 +108,8 @@ def sync( List all schedules for an app. Args: - page (Union[Unset, int]): The page number to fetch. - page_size (Union[Unset, int]): The number of records to fetch on each page. + 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. environment (Union[Unset, str]): Filter schedules by environment. If not provided, all environments will be included. @@ -132,8 +132,8 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - page: Union[Unset, int] = UNSET, - page_size: Union[Unset, int] = UNSET, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, environment: Union[Unset, str] = UNSET, ) -> Response[ListSchedulesResponse]: """List schedules @@ -141,8 +141,8 @@ async def asyncio_detailed( List all schedules for an app. Args: - page (Union[Unset, int]): The page number to fetch. - page_size (Union[Unset, int]): The number of records to fetch on each page. + 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. environment (Union[Unset, str]): Filter schedules by environment. If not provided, all environments will be included. @@ -168,8 +168,8 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - page: Union[Unset, int] = UNSET, - page_size: Union[Unset, int] = UNSET, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, environment: Union[Unset, str] = UNSET, ) -> Optional[ListSchedulesResponse]: """List schedules @@ -177,8 +177,8 @@ async def asyncio( List all schedules for an app. Args: - page (Union[Unset, int]): The page number to fetch. - page_size (Union[Unset, int]): The number of records to fetch on each page. + 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. environment (Union[Unset, str]): Filter schedules by environment. If not provided, all environments will be included. diff --git a/src/tower/tower_api_client/api/default/list_secrets.py b/src/tower/tower_api_client/api/default/list_secrets.py index 559f5f78..131a0023 100644 --- a/src/tower/tower_api_client/api/default/list_secrets.py +++ b/src/tower/tower_api_client/api/default/list_secrets.py @@ -11,21 +11,21 @@ def _get_kwargs( *, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, environment: Union[Unset, str] = UNSET, all_: Union[Unset, bool] = UNSET, - page: Union[Unset, int] = UNSET, - page_size: Union[Unset, int] = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - params["environment"] = environment - - params["all"] = all_ - params["page"] = page params["page_size"] = page_size + params["environment"] = environment + + params["all"] = all_ + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} _kwargs: dict[str, Any] = { @@ -64,21 +64,21 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, environment: Union[Unset, str] = UNSET, all_: Union[Unset, bool] = UNSET, - page: Union[Unset, int] = UNSET, - page_size: Union[Unset, int] = UNSET, ) -> Response[ListSecretsResponse]: """List secrets Lists all the secrets associated with your 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. environment (Union[Unset, str]): The environment to filter by. all_ (Union[Unset, bool]): Whether to fetch all secrets or only the ones that are not marked as deleted. - page (Union[Unset, int]): The page number to fetch. - page_size (Union[Unset, int]): The number of records to fetch on each page. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -89,10 +89,10 @@ def sync_detailed( """ kwargs = _get_kwargs( - environment=environment, - all_=all_, page=page, page_size=page_size, + environment=environment, + all_=all_, ) response = client.get_httpx_client().request( @@ -105,21 +105,21 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, environment: Union[Unset, str] = UNSET, all_: Union[Unset, bool] = UNSET, - page: Union[Unset, int] = UNSET, - page_size: Union[Unset, int] = UNSET, ) -> Optional[ListSecretsResponse]: """List secrets Lists all the secrets associated with your 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. environment (Union[Unset, str]): The environment to filter by. all_ (Union[Unset, bool]): Whether to fetch all secrets or only the ones that are not marked as deleted. - page (Union[Unset, int]): The page number to fetch. - page_size (Union[Unset, int]): The number of records to fetch on each page. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -131,31 +131,31 @@ def sync( return sync_detailed( client=client, - environment=environment, - all_=all_, page=page, page_size=page_size, + environment=environment, + all_=all_, ).parsed async def asyncio_detailed( *, client: AuthenticatedClient, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, environment: Union[Unset, str] = UNSET, all_: Union[Unset, bool] = UNSET, - page: Union[Unset, int] = UNSET, - page_size: Union[Unset, int] = UNSET, ) -> Response[ListSecretsResponse]: """List secrets Lists all the secrets associated with your 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. environment (Union[Unset, str]): The environment to filter by. all_ (Union[Unset, bool]): Whether to fetch all secrets or only the ones that are not marked as deleted. - page (Union[Unset, int]): The page number to fetch. - page_size (Union[Unset, int]): The number of records to fetch on each page. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -166,10 +166,10 @@ async def asyncio_detailed( """ kwargs = _get_kwargs( - environment=environment, - all_=all_, page=page, page_size=page_size, + environment=environment, + all_=all_, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -180,21 +180,21 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, environment: Union[Unset, str] = UNSET, all_: Union[Unset, bool] = UNSET, - page: Union[Unset, int] = UNSET, - page_size: Union[Unset, int] = UNSET, ) -> Optional[ListSecretsResponse]: """List secrets Lists all the secrets associated with your 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. environment (Union[Unset, str]): The environment to filter by. all_ (Union[Unset, bool]): Whether to fetch all secrets or only the ones that are not marked as deleted. - page (Union[Unset, int]): The page number to fetch. - page_size (Union[Unset, int]): The number of records to fetch on each page. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -207,9 +207,9 @@ async def asyncio( return ( await asyncio_detailed( client=client, - environment=environment, - all_=all_, page=page, page_size=page_size, + environment=environment, + all_=all_, ) ).parsed diff --git a/src/tower/tower_api_client/api/default/list_teams.py b/src/tower/tower_api_client/api/default/list_teams.py index 2c15389b..899a7a37 100644 --- a/src/tower/tower_api_client/api/default/list_teams.py +++ b/src/tower/tower_api_client/api/default/list_teams.py @@ -6,13 +6,26 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.list_teams_response import ListTeamsResponse -from ...types import Response +from ...types import UNSET, Response, Unset -def _get_kwargs() -> dict[str, Any]: +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": "/teams", + "params": params, } return _kwargs @@ -45,11 +58,17 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, ) -> Response[ListTeamsResponse]: """List teams List all the teams that the user is a member of. + 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. @@ -58,7 +77,10 @@ def sync_detailed( Response[ListTeamsResponse] """ - kwargs = _get_kwargs() + kwargs = _get_kwargs( + page=page, + page_size=page_size, + ) response = client.get_httpx_client().request( **kwargs, @@ -70,11 +92,17 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, ) -> Optional[ListTeamsResponse]: """List teams List all the teams that the user is a member of. + 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. @@ -85,17 +113,25 @@ def sync( 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[ListTeamsResponse]: """List teams List all the teams that the user is a member of. + 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. @@ -104,7 +140,10 @@ async def asyncio_detailed( Response[ListTeamsResponse] """ - kwargs = _get_kwargs() + kwargs = _get_kwargs( + page=page, + page_size=page_size, + ) response = await client.get_async_httpx_client().request(**kwargs) @@ -114,11 +153,17 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, + page: Union[Unset, int] = 1, + page_size: Union[Unset, int] = 20, ) -> Optional[ListTeamsResponse]: """List teams List all the teams that the user is a member of. + 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. @@ -130,5 +175,7 @@ async def asyncio( return ( await asyncio_detailed( client=client, + page=page, + page_size=page_size, ) ).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 113b0aa0..ea91aca0 100644 --- a/src/tower/tower_api_client/api/default/stream_alerts.py +++ b/src/tower/tower_api_client/api/default/stream_alerts.py @@ -5,10 +5,8 @@ from ... import errors from ...client import AuthenticatedClient, Client +from ...models.stream_alerts_event_alert import StreamAlertsEventAlert from ...models.stream_alerts_event_error import StreamAlertsEventError -from ...models.stream_alerts_event_run_failure_alert import ( - StreamAlertsEventRunFailureAlert, -) from ...types import Response @@ -23,9 +21,7 @@ def _get_kwargs() -> dict[str, Any]: def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ - list[Union["StreamAlertsEventError", "StreamAlertsEventRunFailureAlert"]] -]: +) -> Optional[list[Union["StreamAlertsEventAlert", "StreamAlertsEventError"]]]: if response.status_code == 200: response_200 = [] _response_200 = response.text @@ -33,20 +29,18 @@ def _parse_response( def _parse_response_200_item( data: object, - ) -> Union["StreamAlertsEventError", "StreamAlertsEventRunFailureAlert"]: + ) -> Union["StreamAlertsEventAlert", "StreamAlertsEventError"]: try: if not isinstance(data, dict): raise TypeError() - response_200_item_type_0 = StreamAlertsEventError.from_dict(data) + response_200_item_type_0 = StreamAlertsEventAlert.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 = StreamAlertsEventRunFailureAlert.from_dict( - data - ) + response_200_item_type_1 = StreamAlertsEventError.from_dict(data) return response_200_item_type_1 @@ -63,9 +57,7 @@ def _parse_response_200_item( def _build_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ - list[Union["StreamAlertsEventError", "StreamAlertsEventRunFailureAlert"]] -]: +) -> Response[list[Union["StreamAlertsEventAlert", "StreamAlertsEventError"]]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -77,9 +69,7 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, -) -> Response[ - list[Union["StreamAlertsEventError", "StreamAlertsEventRunFailureAlert"]] -]: +) -> Response[list[Union["StreamAlertsEventAlert", "StreamAlertsEventError"]]]: """Stream alert notifications Streams alert notifications in real-time @@ -89,7 +79,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[list[Union['StreamAlertsEventError', 'StreamAlertsEventRunFailureAlert']]] + Response[list[Union['StreamAlertsEventAlert', 'StreamAlertsEventError']]] """ kwargs = _get_kwargs() @@ -104,9 +94,7 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, -) -> Optional[ - list[Union["StreamAlertsEventError", "StreamAlertsEventRunFailureAlert"]] -]: +) -> Optional[list[Union["StreamAlertsEventAlert", "StreamAlertsEventError"]]]: """Stream alert notifications Streams alert notifications in real-time @@ -116,7 +104,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - list[Union['StreamAlertsEventError', 'StreamAlertsEventRunFailureAlert']] + list[Union['StreamAlertsEventAlert', 'StreamAlertsEventError']] """ return sync_detailed( @@ -127,9 +115,7 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, -) -> Response[ - list[Union["StreamAlertsEventError", "StreamAlertsEventRunFailureAlert"]] -]: +) -> Response[list[Union["StreamAlertsEventAlert", "StreamAlertsEventError"]]]: """Stream alert notifications Streams alert notifications in real-time @@ -139,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[list[Union['StreamAlertsEventError', 'StreamAlertsEventRunFailureAlert']]] + Response[list[Union['StreamAlertsEventAlert', 'StreamAlertsEventError']]] """ kwargs = _get_kwargs() @@ -152,9 +138,7 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, -) -> Optional[ - list[Union["StreamAlertsEventError", "StreamAlertsEventRunFailureAlert"]] -]: +) -> Optional[list[Union["StreamAlertsEventAlert", "StreamAlertsEventError"]]]: """Stream alert notifications Streams alert notifications in real-time @@ -164,7 +148,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - list[Union['StreamAlertsEventError', 'StreamAlertsEventRunFailureAlert']] + list[Union['StreamAlertsEventAlert', 'StreamAlertsEventError']] """ return ( diff --git a/src/tower/tower_api_client/api/default/update_account_name.py b/src/tower/tower_api_client/api/default/update_account.py similarity index 73% rename from src/tower/tower_api_client/api/default/update_account_name.py rename to src/tower/tower_api_client/api/default/update_account.py index 47ea3048..84cd843a 100644 --- a/src/tower/tower_api_client/api/default/update_account_name.py +++ b/src/tower/tower_api_client/api/default/update_account.py @@ -5,15 +5,15 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.update_account_name_params import UpdateAccountNameParams -from ...models.update_account_name_response import UpdateAccountNameResponse +from ...models.update_account_params import UpdateAccountParams +from ...models.update_account_response import UpdateAccountResponse from ...types import Response def _get_kwargs( name: str, *, - body: UpdateAccountNameParams, + body: UpdateAccountParams, ) -> dict[str, Any]: headers: dict[str, Any] = {} @@ -35,9 +35,9 @@ def _get_kwargs( def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[UpdateAccountNameResponse]: +) -> Optional[UpdateAccountResponse]: if response.status_code == 200: - response_200 = UpdateAccountNameResponse.from_dict(response.json()) + response_200 = UpdateAccountResponse.from_dict(response.json()) return response_200 if client.raise_on_unexpected_status: @@ -48,7 +48,7 @@ def _parse_response( def _build_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[UpdateAccountNameResponse]: +) -> Response[UpdateAccountResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -61,22 +61,22 @@ def sync_detailed( name: str, *, client: AuthenticatedClient, - body: UpdateAccountNameParams, -) -> Response[UpdateAccountNameResponse]: - """Update account name + body: UpdateAccountParams, +) -> Response[UpdateAccountResponse]: + """Update account - Update the name for an account + Update the properties of an account Args: name (str): The name of the account to update - body (UpdateAccountNameParams): + body (UpdateAccountParams): 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[UpdateAccountNameResponse] + Response[UpdateAccountResponse] """ kwargs = _get_kwargs( @@ -95,22 +95,22 @@ def sync( name: str, *, client: AuthenticatedClient, - body: UpdateAccountNameParams, -) -> Optional[UpdateAccountNameResponse]: - """Update account name + body: UpdateAccountParams, +) -> Optional[UpdateAccountResponse]: + """Update account - Update the name for an account + Update the properties of an account Args: name (str): The name of the account to update - body (UpdateAccountNameParams): + body (UpdateAccountParams): 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: - UpdateAccountNameResponse + UpdateAccountResponse """ return sync_detailed( @@ -124,22 +124,22 @@ async def asyncio_detailed( name: str, *, client: AuthenticatedClient, - body: UpdateAccountNameParams, -) -> Response[UpdateAccountNameResponse]: - """Update account name + body: UpdateAccountParams, +) -> Response[UpdateAccountResponse]: + """Update account - Update the name for an account + Update the properties of an account Args: name (str): The name of the account to update - body (UpdateAccountNameParams): + body (UpdateAccountParams): 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[UpdateAccountNameResponse] + Response[UpdateAccountResponse] """ kwargs = _get_kwargs( @@ -156,22 +156,22 @@ async def asyncio( name: str, *, client: AuthenticatedClient, - body: UpdateAccountNameParams, -) -> Optional[UpdateAccountNameResponse]: - """Update account name + body: UpdateAccountParams, +) -> Optional[UpdateAccountResponse]: + """Update account - Update the name for an account + Update the properties of an account Args: name (str): The name of the account to update - body (UpdateAccountNameParams): + body (UpdateAccountParams): 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: - UpdateAccountNameResponse + UpdateAccountResponse """ return ( diff --git a/src/tower/tower_api_client/models/__init__.py b/src/tower/tower_api_client/models/__init__.py index df3dd6ab..7dc82d77 100644 --- a/src/tower/tower_api_client/models/__init__.py +++ b/src/tower/tower_api_client/models/__init__.py @@ -35,6 +35,8 @@ from .create_environment_response import CreateEnvironmentResponse from .create_password_reset_params import CreatePasswordResetParams from .create_password_reset_response import CreatePasswordResetResponse +from .create_sandbox_secrets_params import CreateSandboxSecretsParams +from .create_sandbox_secrets_response import CreateSandboxSecretsResponse from .create_schedule_params import CreateScheduleParams from .create_schedule_params_status import CreateScheduleParamsStatus from .create_schedule_response import CreateScheduleResponse @@ -57,11 +59,15 @@ from .delete_team_invitation_response import DeleteTeamInvitationResponse from .delete_team_params import DeleteTeamParams from .delete_team_response import DeleteTeamResponse +from .deploy_app_json_body import DeployAppJsonBody from .deploy_app_response import DeployAppResponse +from .describe_account_body import DescribeAccountBody from .describe_app_response import DescribeAppResponse from .describe_app_version_response import DescribeAppVersionResponse from .describe_device_login_session_response import DescribeDeviceLoginSessionResponse from .describe_email_preferences_body import DescribeEmailPreferencesBody +from .describe_run_graph_response import DescribeRunGraphResponse +from .describe_run_links import DescribeRunLinks from .describe_run_logs_response import DescribeRunLogsResponse from .describe_run_response import DescribeRunResponse from .describe_secrets_key_response import DescribeSecretsKeyResponse @@ -104,6 +110,7 @@ from .list_catalogs_response import ListCatalogsResponse from .list_environments_response import ListEnvironmentsResponse from .list_my_team_invitations_response import ListMyTeamInvitationsResponse +from .list_runners_response import ListRunnersResponse from .list_runs_response import ListRunsResponse from .list_runs_status_item import ListRunsStatusItem from .list_schedules_response import ListSchedulesResponse @@ -122,10 +129,15 @@ from .resend_team_invitation_params import ResendTeamInvitationParams from .resend_team_invitation_response import ResendTeamInvitationResponse from .run import Run +from .run_app_initiator_data import RunAppInitiatorData +from .run_app_initiator_data_type import RunAppInitiatorDataType from .run_app_params import RunAppParams from .run_app_params_parameters import RunAppParamsParameters from .run_app_response import RunAppResponse from .run_failure_alert import RunFailureAlert +from .run_graph_node import RunGraphNode +from .run_graph_run_id import RunGraphRunID +from .run_initiator import RunInitiator from .run_log_line import RunLogLine from .run_log_line_channel import RunLogLineChannel from .run_parameter import RunParameter @@ -134,6 +146,7 @@ from .run_status import RunStatus from .run_status_group import RunStatusGroup from .run_timeseries_point import RunTimeseriesPoint +from .runner import Runner from .runner_credentials import RunnerCredentials from .schedule import Schedule from .schedule_status import ScheduleStatus @@ -144,16 +157,16 @@ from .sse_warning import SSEWarning from .statistics_settings import StatisticsSettings from .statistics_settings_interval import StatisticsSettingsInterval +from .stream_alerts_event_alert import StreamAlertsEventAlert 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 from .unverified_authenticator import UnverifiedAuthenticator -from .update_account_name_params import UpdateAccountNameParams -from .update_account_name_response import UpdateAccountNameResponse +from .update_account_params import UpdateAccountParams +from .update_account_response import UpdateAccountResponse from .update_app_params import UpdateAppParams from .update_app_response import UpdateAppResponse from .update_catalog_params import UpdateCatalogParams @@ -217,6 +230,8 @@ "CreateEnvironmentResponse", "CreatePasswordResetParams", "CreatePasswordResetResponse", + "CreateSandboxSecretsParams", + "CreateSandboxSecretsResponse", "CreateScheduleParams", "CreateScheduleParamsStatus", "CreateScheduleResponse", @@ -239,11 +254,15 @@ "DeleteTeamInvitationResponse", "DeleteTeamParams", "DeleteTeamResponse", + "DeployAppJsonBody", "DeployAppResponse", + "DescribeAccountBody", "DescribeAppResponse", "DescribeAppVersionResponse", "DescribeDeviceLoginSessionResponse", "DescribeEmailPreferencesBody", + "DescribeRunGraphResponse", + "DescribeRunLinks", "DescribeRunLogsResponse", "DescribeRunResponse", "DescribeSecretsKeyResponse", @@ -284,6 +303,7 @@ "ListCatalogsResponse", "ListEnvironmentsResponse", "ListMyTeamInvitationsResponse", + "ListRunnersResponse", "ListRunsResponse", "ListRunsStatusItem", "ListSchedulesResponse", @@ -302,12 +322,18 @@ "ResendTeamInvitationParams", "ResendTeamInvitationResponse", "Run", + "RunAppInitiatorData", + "RunAppInitiatorDataType", "RunAppParams", "RunAppParamsParameters", "RunAppResponse", "RunFailureAlert", + "RunGraphNode", + "RunGraphRunID", + "RunInitiator", "RunLogLine", "RunLogLineChannel", + "Runner", "RunnerCredentials", "RunParameter", "RunResults", @@ -324,16 +350,16 @@ "SSEWarning", "StatisticsSettings", "StatisticsSettingsInterval", + "StreamAlertsEventAlert", "StreamAlertsEventError", - "StreamAlertsEventRunFailureAlert", "StreamRunLogsEventLog", "StreamRunLogsEventWarning", "Team", "TeamInvitation", "Token", "UnverifiedAuthenticator", - "UpdateAccountNameParams", - "UpdateAccountNameResponse", + "UpdateAccountParams", + "UpdateAccountResponse", "UpdateAppParams", "UpdateAppResponse", "UpdateCatalogParams", diff --git a/src/tower/tower_api_client/models/account.py b/src/tower/tower_api_client/models/account.py index 76e81498..da6b9be3 100644 --- a/src/tower/tower_api_client/models/account.py +++ b/src/tower/tower_api_client/models/account.py @@ -12,14 +12,18 @@ class Account: """ Attributes: + is_self_hosted_only (bool): name (str): slug (Union[Unset, str]): This property is deprecated. Please use name instead. """ + is_self_hosted_only: bool name: str slug: Union[Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: + is_self_hosted_only = self.is_self_hosted_only + name = self.name slug = self.slug @@ -27,6 +31,7 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update( { + "is_self_hosted_only": is_self_hosted_only, "name": name, } ) @@ -38,11 +43,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) + is_self_hosted_only = d.pop("is_self_hosted_only") + name = d.pop("name") slug = d.pop("slug", UNSET) account = cls( + is_self_hosted_only=is_self_hosted_only, name=name, slug=slug, ) diff --git a/src/tower/tower_api_client/models/app.py b/src/tower/tower_api_client/models/app.py index 7a3a88b9..10220a64 100644 --- a/src/tower/tower_api_client/models/app.py +++ b/src/tower/tower_api_client/models/app.py @@ -23,6 +23,7 @@ class App: Attributes: created_at (datetime.datetime): The date and time this app was created. health_status (AppHealthStatus): This property is deprecated. It will always be 'healthy'. + is_externally_accessible (bool): 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. @@ -34,10 +35,13 @@ class App: run_results (Union[Unset, RunResults]): slug (Union[Unset, str]): This property is deprecated. Please use name instead. status (Union[Unset, AppStatus]): The status of the app. + subdomain (Union[Unset, str]): The subdomain that this app is accessible via. Must be externally accessible + first. """ created_at: datetime.datetime health_status: AppHealthStatus + is_externally_accessible: bool name: str next_run_at: Union[None, datetime.datetime] owner: str @@ -48,12 +52,15 @@ class App: run_results: Union[Unset, "RunResults"] = UNSET slug: Union[Unset, str] = UNSET status: Union[Unset, AppStatus] = UNSET + subdomain: Union[Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: created_at = self.created_at.isoformat() health_status = self.health_status.value + is_externally_accessible = self.is_externally_accessible + name = self.name next_run_at: Union[None, str] @@ -86,11 +93,14 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.status, Unset): status = self.status.value + subdomain = self.subdomain + field_dict: dict[str, Any] = {} field_dict.update( { "created_at": created_at, "health_status": health_status, + "is_externally_accessible": is_externally_accessible, "name": name, "next_run_at": next_run_at, "owner": owner, @@ -107,6 +117,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["slug"] = slug if status is not UNSET: field_dict["status"] = status + if subdomain is not UNSET: + field_dict["subdomain"] = subdomain return field_dict @@ -120,6 +132,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: health_status = AppHealthStatus(d.pop("health_status")) + is_externally_accessible = d.pop("is_externally_accessible") + name = d.pop("name") def _parse_next_run_at(data: object) -> Union[None, datetime.datetime]: @@ -178,9 +192,12 @@ def _parse_version(data: object) -> Union[None, str]: else: status = AppStatus(_status) + subdomain = d.pop("subdomain", UNSET) + app = cls( created_at=created_at, health_status=health_status, + is_externally_accessible=is_externally_accessible, name=name, next_run_at=next_run_at, owner=owner, @@ -191,6 +208,7 @@ def _parse_version(data: object) -> Union[None, str]: run_results=run_results, slug=slug, status=status, + subdomain=subdomain, ) return app 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 d917fbc9..3e7f7918 100644 --- a/src/tower/tower_api_client/models/create_app_params.py +++ b/src/tower/tower_api_client/models/create_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 @@ -19,6 +19,8 @@ class CreateAppParams: 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. + subdomain (Union[None, Unset, str]): The subdomain this app is accessible under. Requires + is_externally_accessible to be true. """ name: str @@ -26,6 +28,7 @@ class CreateAppParams: is_externally_accessible: Union[Unset, bool] = False short_description: Union[Unset, str] = UNSET slug: Union[Unset, str] = UNSET + subdomain: Union[None, Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name @@ -38,6 +41,12 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug + subdomain: Union[None, Unset, str] + if isinstance(self.subdomain, Unset): + subdomain = UNSET + else: + subdomain = self.subdomain + field_dict: dict[str, Any] = {} field_dict.update( { @@ -52,6 +61,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["short_description"] = short_description if slug is not UNSET: field_dict["slug"] = slug + if subdomain is not UNSET: + field_dict["subdomain"] = subdomain return field_dict @@ -68,12 +79,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) + def _parse_subdomain(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) + + subdomain = _parse_subdomain(d.pop("subdomain", UNSET)) + create_app_params = cls( name=name, schema=schema, is_externally_accessible=is_externally_accessible, short_description=short_description, slug=slug, + subdomain=subdomain, ) return create_app_params diff --git a/src/tower/tower_api_client/models/create_catalog_params_type.py b/src/tower/tower_api_client/models/create_catalog_params_type.py index 1834d9ee..4c186f02 100644 --- a/src/tower/tower_api_client/models/create_catalog_params_type.py +++ b/src/tower/tower_api_client/models/create_catalog_params_type.py @@ -6,6 +6,7 @@ class CreateCatalogParamsType(str, Enum): CLOUDFLARE_R2_CATALOG = "cloudflare-r2-catalog" LAKEKEEPER = "lakekeeper" SNOWFLAKE_OPEN_CATALOG = "snowflake-open-catalog" + TOWER_CATALOG = "tower-catalog" def __str__(self) -> str: return str(self.value) diff --git a/src/tower/tower_api_client/models/create_sandbox_secrets_params.py b/src/tower/tower_api_client/models/create_sandbox_secrets_params.py new file mode 100644 index 00000000..3f9837f0 --- /dev/null +++ b/src/tower/tower_api_client/models/create_sandbox_secrets_params.py @@ -0,0 +1,59 @@ +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="CreateSandboxSecretsParams") + + +@_attrs_define +class CreateSandboxSecretsParams: + """ + Attributes: + environment (str): Environment to create secrets in + secret_keys (list[str]): List of secret keys to create with Tower defaults + schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CreateSandboxSecretsParams.json. + """ + + environment: str + secret_keys: list[str] + schema: Union[Unset, str] = UNSET + + def to_dict(self) -> dict[str, Any]: + environment = self.environment + + secret_keys = self.secret_keys + + schema = self.schema + + field_dict: dict[str, Any] = {} + field_dict.update( + { + "environment": environment, + "secret_keys": secret_keys, + } + ) + 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) + environment = d.pop("environment") + + secret_keys = cast(list[str], d.pop("secret_keys")) + + schema = d.pop("$schema", UNSET) + + create_sandbox_secrets_params = cls( + environment=environment, + secret_keys=secret_keys, + schema=schema, + ) + + return create_sandbox_secrets_params diff --git a/src/tower/tower_api_client/models/update_account_name_params.py b/src/tower/tower_api_client/models/create_sandbox_secrets_response.py similarity index 58% rename from src/tower/tower_api_client/models/update_account_name_params.py rename to src/tower/tower_api_client/models/create_sandbox_secrets_response.py index dc418452..03e1084c 100644 --- a/src/tower/tower_api_client/models/update_account_name_params.py +++ b/src/tower/tower_api_client/models/create_sandbox_secrets_response.py @@ -1,34 +1,34 @@ 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 from ..types import UNSET, Unset -T = TypeVar("T", bound="UpdateAccountNameParams") +T = TypeVar("T", bound="CreateSandboxSecretsResponse") @_attrs_define -class UpdateAccountNameParams: +class CreateSandboxSecretsResponse: """ Attributes: - name (str): The new name for the account + created (list[str]): List of secret keys that were created schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdateAccountNameParams.json. + https://api.tower.dev/v1/schemas/CreateSandboxSecretsResponse.json. """ - name: str + created: list[str] schema: Union[Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name + created = self.created schema = self.schema field_dict: dict[str, Any] = {} field_dict.update( { - "name": name, + "created": created, } ) if schema is not UNSET: @@ -39,13 +39,13 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - name = d.pop("name") + created = cast(list[str], d.pop("created")) schema = d.pop("$schema", UNSET) - update_account_name_params = cls( - name=name, + create_sandbox_secrets_response = cls( + created=created, schema=schema, ) - return update_account_name_params + return create_sandbox_secrets_response diff --git a/src/tower/tower_api_client/models/deploy_app_json_body.py b/src/tower/tower_api_client/models/deploy_app_json_body.py new file mode 100644 index 00000000..f2d8fd93 --- /dev/null +++ b/src/tower/tower_api_client/models/deploy_app_json_body.py @@ -0,0 +1,62 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="DeployAppJsonBody") + + +@_attrs_define +class DeployAppJsonBody: + """ + Example: + {'source_uri': 'https://github.com/tower/tower-examples/tree/main/01-hello-world'} + + Attributes: + source_uri (str): GitHub repository URL for deploying from source + """ + + source_uri: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + source_uri = self.source_uri + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "source_uri": source_uri, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + source_uri = d.pop("source_uri") + + deploy_app_json_body = cls( + source_uri=source_uri, + ) + + deploy_app_json_body.additional_properties = d + return deploy_app_json_body + + @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_account_name_response.py b/src/tower/tower_api_client/models/describe_account_body.py similarity index 81% rename from src/tower/tower_api_client/models/update_account_name_response.py rename to src/tower/tower_api_client/models/describe_account_body.py index 993a27bb..2f849f74 100644 --- a/src/tower/tower_api_client/models/update_account_name_response.py +++ b/src/tower/tower_api_client/models/describe_account_body.py @@ -9,16 +9,16 @@ from ..models.account import Account -T = TypeVar("T", bound="UpdateAccountNameResponse") +T = TypeVar("T", bound="DescribeAccountBody") @_attrs_define -class UpdateAccountNameResponse: +class DescribeAccountBody: """ Attributes: account (Account): schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdateAccountNameResponse.json. + https://api.tower.dev/v1/schemas/DescribeAccountBody.json. """ account: "Account" @@ -49,9 +49,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: schema = d.pop("$schema", UNSET) - update_account_name_response = cls( + describe_account_body = cls( account=account, schema=schema, ) - return update_account_name_response + return describe_account_body diff --git a/src/tower/tower_api_client/models/describe_run_graph_response.py b/src/tower/tower_api_client/models/describe_run_graph_response.py new file mode 100644 index 00000000..ed131b61 --- /dev/null +++ b/src/tower/tower_api_client/models/describe_run_graph_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.run_graph_node import RunGraphNode + + +T = TypeVar("T", bound="DescribeRunGraphResponse") + + +@_attrs_define +class DescribeRunGraphResponse: + """ + Attributes: + runs (list['RunGraphNode']): + schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DescribeRunGraphResponse.json. + """ + + runs: list["RunGraphNode"] + schema: Union[Unset, str] = UNSET + + def to_dict(self) -> dict[str, Any]: + runs = [] + for runs_item_data in self.runs: + runs_item = runs_item_data.to_dict() + runs.append(runs_item) + + schema = self.schema + + field_dict: dict[str, Any] = {} + field_dict.update( + { + "runs": runs, + } + ) + 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.run_graph_node import RunGraphNode + + d = dict(src_dict) + runs = [] + _runs = d.pop("runs") + for runs_item_data in _runs: + runs_item = RunGraphNode.from_dict(runs_item_data) + + runs.append(runs_item) + + schema = d.pop("$schema", UNSET) + + describe_run_graph_response = cls( + runs=runs, + schema=schema, + ) + + return describe_run_graph_response diff --git a/src/tower/tower_api_client/models/describe_run_links.py b/src/tower/tower_api_client/models/describe_run_links.py new file mode 100644 index 00000000..03f717fb --- /dev/null +++ b/src/tower/tower_api_client/models/describe_run_links.py @@ -0,0 +1,68 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="DescribeRunLinks") + + +@_attrs_define +class DescribeRunLinks: + """ + Attributes: + next_ (Union[None, str]): The URL of the next run, if any. + prev (Union[None, str]): The URL of the previous run, if any. + self_ (str): The URL of this run. + """ + + next_: Union[None, str] + prev: Union[None, str] + self_: str + + def to_dict(self) -> dict[str, Any]: + next_: Union[None, str] + next_ = self.next_ + + prev: Union[None, str] + prev = self.prev + + self_ = self.self_ + + field_dict: dict[str, Any] = {} + field_dict.update( + { + "next": next_, + "prev": prev, + "self": self_, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + + def _parse_next_(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + next_ = _parse_next_(d.pop("next")) + + def _parse_prev(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + prev = _parse_prev(d.pop("prev")) + + self_ = d.pop("self") + + describe_run_links = cls( + next_=next_, + prev=prev, + self_=self_, + ) + + return describe_run_links diff --git a/src/tower/tower_api_client/models/describe_run_response.py b/src/tower/tower_api_client/models/describe_run_response.py index 3ce6c9ae..d1275df3 100644 --- a/src/tower/tower_api_client/models/describe_run_response.py +++ b/src/tower/tower_api_client/models/describe_run_response.py @@ -6,6 +6,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: + from ..models.describe_run_links import DescribeRunLinks from ..models.run import Run @@ -16,15 +17,19 @@ class DescribeRunResponse: """ Attributes: + links (DescribeRunLinks): run (Run): schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/DescribeRunResponse.json. """ + links: "DescribeRunLinks" run: "Run" schema: Union[Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: + links = self.links.to_dict() + run = self.run.to_dict() schema = self.schema @@ -32,6 +37,7 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update( { + "$links": links, "run": run, } ) @@ -42,14 +48,18 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.describe_run_links import DescribeRunLinks from ..models.run import Run d = dict(src_dict) + links = DescribeRunLinks.from_dict(d.pop("$links")) + run = Run.from_dict(d.pop("run")) schema = d.pop("$schema", UNSET) describe_run_response = cls( + links=links, run=run, schema=schema, ) diff --git a/src/tower/tower_api_client/models/generate_run_statistics_status_item.py b/src/tower/tower_api_client/models/generate_run_statistics_status_item.py index c58ff1dd..bde1a4d3 100644 --- a/src/tower/tower_api_client/models/generate_run_statistics_status_item.py +++ b/src/tower/tower_api_client/models/generate_run_statistics_status_item.py @@ -8,7 +8,6 @@ class GenerateRunStatisticsStatusItem(str, Enum): EXITED = "exited" PENDING = "pending" RUNNING = "running" - SCHEDULED = "scheduled" def __str__(self) -> str: return str(self.value) diff --git a/src/tower/tower_api_client/models/list_api_keys_response.py b/src/tower/tower_api_client/models/list_api_keys_response.py index 7d532900..33793d88 100644 --- a/src/tower/tower_api_client/models/list_api_keys_response.py +++ b/src/tower/tower_api_client/models/list_api_keys_response.py @@ -7,6 +7,7 @@ if TYPE_CHECKING: from ..models.api_key import APIKey + from ..models.pagination import Pagination T = TypeVar("T", bound="ListAPIKeysResponse") @@ -17,11 +18,13 @@ class ListAPIKeysResponse: """ Attributes: api_keys (list['APIKey']): List of API keys + pages (Pagination): schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/ListAPIKeysResponse.json. """ api_keys: list["APIKey"] + pages: "Pagination" schema: Union[Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: @@ -30,12 +33,15 @@ def to_dict(self) -> dict[str, Any]: api_keys_item = api_keys_item_data.to_dict() api_keys.append(api_keys_item) + pages = self.pages.to_dict() + schema = self.schema field_dict: dict[str, Any] = {} field_dict.update( { "api_keys": api_keys, + "pages": pages, } ) if schema is not UNSET: @@ -46,6 +52,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.api_key import APIKey + from ..models.pagination import Pagination d = dict(src_dict) api_keys = [] @@ -55,10 +62,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: api_keys.append(api_keys_item) + pages = Pagination.from_dict(d.pop("pages")) + schema = d.pop("$schema", UNSET) list_api_keys_response = cls( api_keys=api_keys, + pages=pages, schema=schema, ) diff --git a/src/tower/tower_api_client/models/list_apps_filter.py b/src/tower/tower_api_client/models/list_apps_filter.py index 39818a47..0caee18d 100644 --- a/src/tower/tower_api_client/models/list_apps_filter.py +++ b/src/tower/tower_api_client/models/list_apps_filter.py @@ -3,6 +3,7 @@ class ListAppsFilter(str, Enum): DISABLED = "disabled" + HEALTHY = "healthy" RUNNING = "running" WITHWARNING = "withWarning" diff --git a/src/tower/tower_api_client/models/list_environments_response.py b/src/tower/tower_api_client/models/list_environments_response.py index fd1b8cee..dd9c7922 100644 --- a/src/tower/tower_api_client/models/list_environments_response.py +++ b/src/tower/tower_api_client/models/list_environments_response.py @@ -7,6 +7,7 @@ if TYPE_CHECKING: from ..models.environment import Environment + from ..models.pagination import Pagination T = TypeVar("T", bound="ListEnvironmentsResponse") @@ -17,11 +18,13 @@ class ListEnvironmentsResponse: """ Attributes: environments (list['Environment']): + pages (Pagination): 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"] + pages: "Pagination" schema: Union[Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: @@ -30,12 +33,15 @@ def to_dict(self) -> dict[str, Any]: environments_item = environments_item_data.to_dict() environments.append(environments_item) + pages = self.pages.to_dict() + schema = self.schema field_dict: dict[str, Any] = {} field_dict.update( { "environments": environments, + "pages": pages, } ) if schema is not UNSET: @@ -46,6 +52,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.environment import Environment + from ..models.pagination import Pagination d = dict(src_dict) environments = [] @@ -55,10 +62,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: environments.append(environments_item) + pages = Pagination.from_dict(d.pop("pages")) + schema = d.pop("$schema", UNSET) list_environments_response = cls( environments=environments, + pages=pages, schema=schema, ) diff --git a/src/tower/tower_api_client/models/list_runners_response.py b/src/tower/tower_api_client/models/list_runners_response.py new file mode 100644 index 00000000..6ad1da7b --- /dev/null +++ b/src/tower/tower_api_client/models/list_runners_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.runner import Runner + + +T = TypeVar("T", bound="ListRunnersResponse") + + +@_attrs_define +class ListRunnersResponse: + """ + Attributes: + pages (Pagination): + runners (list['Runner']): + schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ListRunnersResponse.json. + """ + + pages: "Pagination" + runners: list["Runner"] + schema: Union[Unset, str] = UNSET + + def to_dict(self) -> dict[str, Any]: + pages = self.pages.to_dict() + + runners = [] + for runners_item_data in self.runners: + runners_item = runners_item_data.to_dict() + runners.append(runners_item) + + schema = self.schema + + field_dict: dict[str, Any] = {} + field_dict.update( + { + "pages": pages, + "runners": runners, + } + ) + 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.runner import Runner + + d = dict(src_dict) + pages = Pagination.from_dict(d.pop("pages")) + + runners = [] + _runners = d.pop("runners") + for runners_item_data in _runners: + runners_item = Runner.from_dict(runners_item_data) + + runners.append(runners_item) + + schema = d.pop("$schema", UNSET) + + list_runners_response = cls( + pages=pages, + runners=runners, + schema=schema, + ) + + return list_runners_response diff --git a/src/tower/tower_api_client/models/list_runs_status_item.py b/src/tower/tower_api_client/models/list_runs_status_item.py index 4b0802b2..c33e30d8 100644 --- a/src/tower/tower_api_client/models/list_runs_status_item.py +++ b/src/tower/tower_api_client/models/list_runs_status_item.py @@ -8,7 +8,6 @@ class ListRunsStatusItem(str, Enum): EXITED = "exited" PENDING = "pending" RUNNING = "running" - SCHEDULED = "scheduled" def __str__(self) -> str: return str(self.value) diff --git a/src/tower/tower_api_client/models/list_teams_response.py b/src/tower/tower_api_client/models/list_teams_response.py index 7adea820..26893d49 100644 --- a/src/tower/tower_api_client/models/list_teams_response.py +++ b/src/tower/tower_api_client/models/list_teams_response.py @@ -6,6 +6,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: + from ..models.pagination import Pagination from ..models.team import Team @@ -16,15 +17,19 @@ class ListTeamsResponse: """ Attributes: + pages (Pagination): teams (list['Team']): List of teams schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/ListTeamsResponse.json. """ + pages: "Pagination" teams: list["Team"] schema: Union[Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: + pages = self.pages.to_dict() + teams = [] for teams_item_data in self.teams: teams_item = teams_item_data.to_dict() @@ -35,6 +40,7 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update( { + "pages": pages, "teams": teams, } ) @@ -45,9 +51,12 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.pagination import Pagination from ..models.team import Team d = dict(src_dict) + pages = Pagination.from_dict(d.pop("pages")) + teams = [] _teams = d.pop("teams") for teams_item_data in _teams: @@ -58,6 +67,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: schema = d.pop("$schema", UNSET) list_teams_response = cls( + pages=pages, teams=teams, schema=schema, ) diff --git a/src/tower/tower_api_client/models/run.py b/src/tower/tower_api_client/models/run.py index 5d39d8a0..45b2da2b 100644 --- a/src/tower/tower_api_client/models/run.py +++ b/src/tower/tower_api_client/models/run.py @@ -10,6 +10,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: + from ..models.run_initiator import RunInitiator from ..models.run_parameter import RunParameter @@ -20,7 +21,7 @@ class Run: """ Attributes: - link (str): Link to the run in the Tower UI + link (str): $link is deprecated. Individual responses include links. app_name (str): app_version (str): cancelled_at (Union[None, datetime.datetime]): @@ -28,6 +29,9 @@ class Run: ended_at (Union[None, datetime.datetime]): environment (str): exit_code (Union[None, int]): Exit code of the run, if the run is completed. Null if there is no exit code + initiator (RunInitiator): + is_scheduled (bool): Whether this run was triggered by a schedule (true) or on-demand (false). Historical + records default to false. number (int): parameters (list['RunParameter']): Parameters used to invoke this run. run_id (str): @@ -36,7 +40,9 @@ class Run: status (RunStatus): status_group (RunStatusGroup): app_slug (Union[Unset, str]): This property is deprecated. Please use app_name instead. - hostname (Union[Unset, str]): If app is externally accessible, then you can access this run with this hostname + hostname (Union[Unset, str]): hostname is deprecated, use subdomain + subdomain (Union[None, Unset, str]): If app is externally accessible, then you can access this run with this + hostname. """ link: str @@ -47,6 +53,8 @@ class Run: ended_at: Union[None, datetime.datetime] environment: str exit_code: Union[None, int] + initiator: "RunInitiator" + is_scheduled: bool number: int parameters: list["RunParameter"] run_id: str @@ -56,6 +64,7 @@ class Run: status_group: RunStatusGroup app_slug: Union[Unset, str] = UNSET hostname: Union[Unset, str] = UNSET + subdomain: Union[None, Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: link = self.link @@ -83,6 +92,10 @@ def to_dict(self) -> dict[str, Any]: exit_code: Union[None, int] exit_code = self.exit_code + initiator = self.initiator.to_dict() + + is_scheduled = self.is_scheduled + number = self.number parameters = [] @@ -108,6 +121,12 @@ def to_dict(self) -> dict[str, Any]: hostname = self.hostname + subdomain: Union[None, Unset, str] + if isinstance(self.subdomain, Unset): + subdomain = UNSET + else: + subdomain = self.subdomain + field_dict: dict[str, Any] = {} field_dict.update( { @@ -119,6 +138,8 @@ def to_dict(self) -> dict[str, Any]: "ended_at": ended_at, "environment": environment, "exit_code": exit_code, + "initiator": initiator, + "is_scheduled": is_scheduled, "number": number, "parameters": parameters, "run_id": run_id, @@ -132,11 +153,14 @@ def to_dict(self) -> dict[str, Any]: field_dict["app_slug"] = app_slug if hostname is not UNSET: field_dict["hostname"] = hostname + if subdomain is not UNSET: + field_dict["subdomain"] = subdomain return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.run_initiator import RunInitiator from ..models.run_parameter import RunParameter d = dict(src_dict) @@ -187,6 +211,10 @@ def _parse_exit_code(data: object) -> Union[None, int]: exit_code = _parse_exit_code(d.pop("exit_code")) + initiator = RunInitiator.from_dict(d.pop("initiator")) + + is_scheduled = d.pop("is_scheduled") + number = d.pop("number") parameters = [] @@ -223,6 +251,15 @@ def _parse_started_at(data: object) -> Union[None, datetime.datetime]: hostname = d.pop("hostname", UNSET) + def _parse_subdomain(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) + + subdomain = _parse_subdomain(d.pop("subdomain", UNSET)) + run = cls( link=link, app_name=app_name, @@ -232,6 +269,8 @@ def _parse_started_at(data: object) -> Union[None, datetime.datetime]: ended_at=ended_at, environment=environment, exit_code=exit_code, + initiator=initiator, + is_scheduled=is_scheduled, number=number, parameters=parameters, run_id=run_id, @@ -241,6 +280,7 @@ def _parse_started_at(data: object) -> Union[None, datetime.datetime]: status_group=status_group, app_slug=app_slug, hostname=hostname, + subdomain=subdomain, ) return run diff --git a/src/tower/tower_api_client/models/run_app_initiator_data.py b/src/tower/tower_api_client/models/run_app_initiator_data.py new file mode 100644 index 00000000..88ec5051 --- /dev/null +++ b/src/tower/tower_api_client/models/run_app_initiator_data.py @@ -0,0 +1,41 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.run_app_initiator_data_type import RunAppInitiatorDataType + +T = TypeVar("T", bound="RunAppInitiatorData") + + +@_attrs_define +class RunAppInitiatorData: + """ + Attributes: + type_ (RunAppInitiatorDataType): The type of the initiator for this run. + """ + + type_: RunAppInitiatorDataType + + def to_dict(self) -> dict[str, Any]: + type_ = self.type_.value + + field_dict: dict[str, Any] = {} + field_dict.update( + { + "type": type_, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + type_ = RunAppInitiatorDataType(d.pop("type")) + + run_app_initiator_data = cls( + type_=type_, + ) + + return run_app_initiator_data diff --git a/src/tower/tower_api_client/models/run_app_initiator_data_type.py b/src/tower/tower_api_client/models/run_app_initiator_data_type.py new file mode 100644 index 00000000..eb4a1b8b --- /dev/null +++ b/src/tower/tower_api_client/models/run_app_initiator_data_type.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class RunAppInitiatorDataType(str, Enum): + TOWER_CLI = "tower_cli" + TOWER_RUN = "tower_run" + TOWER_UI = "tower_ui" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/run_app_params.py b/src/tower/tower_api_client/models/run_app_params.py index e73c1339..7f5bc203 100644 --- a/src/tower/tower_api_client/models/run_app_params.py +++ b/src/tower/tower_api_client/models/run_app_params.py @@ -6,6 +6,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: + from ..models.run_app_initiator_data import RunAppInitiatorData from ..models.run_app_params_parameters import RunAppParamsParameters @@ -20,6 +21,7 @@ class RunAppParams: parameters (RunAppParamsParameters): The parameters to pass into this app. schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/RunAppParams.json. + initiator (Union[Unset, RunAppInitiatorData]): parent_run_id (Union[None, Unset, str]): The ID of the run that invoked this run, if relevant. Should be null, if none. """ @@ -27,6 +29,7 @@ class RunAppParams: environment: str parameters: "RunAppParamsParameters" schema: Union[Unset, str] = UNSET + initiator: Union[Unset, "RunAppInitiatorData"] = UNSET parent_run_id: Union[None, Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: @@ -36,6 +39,10 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema + initiator: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.initiator, Unset): + initiator = self.initiator.to_dict() + parent_run_id: Union[None, Unset, str] if isinstance(self.parent_run_id, Unset): parent_run_id = UNSET @@ -51,6 +58,8 @@ def to_dict(self) -> dict[str, Any]: ) if schema is not UNSET: field_dict["$schema"] = schema + if initiator is not UNSET: + field_dict["initiator"] = initiator if parent_run_id is not UNSET: field_dict["parent_run_id"] = parent_run_id @@ -58,6 +67,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.run_app_initiator_data import RunAppInitiatorData from ..models.run_app_params_parameters import RunAppParamsParameters d = dict(src_dict) @@ -67,6 +77,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: schema = d.pop("$schema", UNSET) + _initiator = d.pop("initiator", UNSET) + initiator: Union[Unset, RunAppInitiatorData] + if isinstance(_initiator, Unset): + initiator = UNSET + else: + initiator = RunAppInitiatorData.from_dict(_initiator) + def _parse_parent_run_id(data: object) -> Union[None, Unset, str]: if data is None: return data @@ -80,6 +97,7 @@ def _parse_parent_run_id(data: object) -> Union[None, Unset, str]: environment=environment, parameters=parameters, schema=schema, + initiator=initiator, parent_run_id=parent_run_id, ) diff --git a/src/tower/tower_api_client/models/run_graph_node.py b/src/tower/tower_api_client/models/run_graph_node.py new file mode 100644 index 00000000..d70142c0 --- /dev/null +++ b/src/tower/tower_api_client/models/run_graph_node.py @@ -0,0 +1,53 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +if TYPE_CHECKING: + from ..models.run_graph_run_id import RunGraphRunID + + +T = TypeVar("T", bound="RunGraphNode") + + +@_attrs_define +class RunGraphNode: + """ + Attributes: + id (RunGraphRunID): + parent_id (RunGraphRunID): + """ + + id: "RunGraphRunID" + parent_id: "RunGraphRunID" + + def to_dict(self) -> dict[str, Any]: + id = self.id.to_dict() + + parent_id = self.parent_id.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update( + { + "id": id, + "parent_id": parent_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.run_graph_run_id import RunGraphRunID + + d = dict(src_dict) + id = RunGraphRunID.from_dict(d.pop("id")) + + parent_id = RunGraphRunID.from_dict(d.pop("parent_id")) + + run_graph_node = cls( + id=id, + parent_id=parent_id, + ) + + return run_graph_node diff --git a/src/tower/tower_api_client/models/run_graph_run_id.py b/src/tower/tower_api_client/models/run_graph_run_id.py new file mode 100644 index 00000000..ceb06e25 --- /dev/null +++ b/src/tower/tower_api_client/models/run_graph_run_id.py @@ -0,0 +1,47 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="RunGraphRunID") + + +@_attrs_define +class RunGraphRunID: + """ + Attributes: + app_name (str): + number (int): + """ + + app_name: str + number: int + + def to_dict(self) -> dict[str, Any]: + app_name = self.app_name + + number = self.number + + field_dict: dict[str, Any] = {} + field_dict.update( + { + "app_name": app_name, + "number": number, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + app_name = d.pop("app_name") + + number = d.pop("number") + + run_graph_run_id = cls( + app_name=app_name, + number=number, + ) + + return run_graph_run_id diff --git a/src/tower/tower_api_client/models/run_initiator.py b/src/tower/tower_api_client/models/run_initiator.py new file mode 100644 index 00000000..90d49167 --- /dev/null +++ b/src/tower/tower_api_client/models/run_initiator.py @@ -0,0 +1,46 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="RunInitiator") + + +@_attrs_define +class RunInitiator: + """ + Attributes: + type_ (Union[None, str]): The type of initiator for this run + """ + + type_: Union[None, str] + + def to_dict(self) -> dict[str, Any]: + type_: Union[None, str] + type_ = self.type_ + + field_dict: dict[str, Any] = {} + field_dict.update( + { + "type": type_, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + + def _parse_type_(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + type_ = _parse_type_(d.pop("type")) + + run_initiator = cls( + type_=type_, + ) + + return run_initiator diff --git a/src/tower/tower_api_client/models/runner.py b/src/tower/tower_api_client/models/runner.py new file mode 100644 index 00000000..c90bffa7 --- /dev/null +++ b/src/tower/tower_api_client/models/runner.py @@ -0,0 +1,104 @@ +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.run import Run + + +T = TypeVar("T", bound="Runner") + + +@_attrs_define +class Runner: + """ + Attributes: + active_runs (list['Run']): + created_at (str): + id (str): + max_concurrent_apps (int): + num_runs (int): + status (str): + last_health_check_at (Union[Unset, str]): + """ + + active_runs: list["Run"] + created_at: str + id: str + max_concurrent_apps: int + num_runs: int + status: str + last_health_check_at: Union[Unset, str] = UNSET + + def to_dict(self) -> dict[str, Any]: + active_runs = [] + for active_runs_item_data in self.active_runs: + active_runs_item = active_runs_item_data.to_dict() + active_runs.append(active_runs_item) + + created_at = self.created_at + + id = self.id + + max_concurrent_apps = self.max_concurrent_apps + + num_runs = self.num_runs + + status = self.status + + last_health_check_at = self.last_health_check_at + + field_dict: dict[str, Any] = {} + field_dict.update( + { + "active_runs": active_runs, + "created_at": created_at, + "id": id, + "max_concurrent_apps": max_concurrent_apps, + "num_runs": num_runs, + "status": status, + } + ) + if last_health_check_at is not UNSET: + field_dict["last_health_check_at"] = last_health_check_at + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.run import Run + + d = dict(src_dict) + active_runs = [] + _active_runs = d.pop("active_runs") + for active_runs_item_data in _active_runs: + active_runs_item = Run.from_dict(active_runs_item_data) + + active_runs.append(active_runs_item) + + created_at = d.pop("created_at") + + id = d.pop("id") + + max_concurrent_apps = d.pop("max_concurrent_apps") + + num_runs = d.pop("num_runs") + + status = d.pop("status") + + last_health_check_at = d.pop("last_health_check_at", UNSET) + + runner = cls( + active_runs=active_runs, + created_at=created_at, + id=id, + max_concurrent_apps=max_concurrent_apps, + num_runs=num_runs, + status=status, + last_health_check_at=last_health_check_at, + ) + + return runner diff --git a/src/tower/tower_api_client/models/search_runs_status_item.py b/src/tower/tower_api_client/models/search_runs_status_item.py index c03d8394..1a6b09a4 100644 --- a/src/tower/tower_api_client/models/search_runs_status_item.py +++ b/src/tower/tower_api_client/models/search_runs_status_item.py @@ -8,7 +8,6 @@ class SearchRunsStatusItem(str, Enum): EXITED = "exited" PENDING = "pending" RUNNING = "running" - SCHEDULED = "scheduled" def __str__(self) -> str: return str(self.value) 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_alert.py similarity index 69% rename from src/tower/tower_api_client/models/stream_alerts_event_run_failure_alert.py rename to src/tower/tower_api_client/models/stream_alerts_event_alert.py index c69cfe80..2267a8e7 100644 --- a/src/tower/tower_api_client/models/stream_alerts_event_run_failure_alert.py +++ b/src/tower/tower_api_client/models/stream_alerts_event_alert.py @@ -14,24 +14,24 @@ from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.run_failure_alert import RunFailureAlert + from ..models.alert import Alert -T = TypeVar("T", bound="StreamAlertsEventRunFailureAlert") +T = TypeVar("T", bound="StreamAlertsEventAlert") @_attrs_define -class StreamAlertsEventRunFailureAlert: +class StreamAlertsEventAlert: """ Attributes: - data (RunFailureAlert): - event (Literal['run_failure_alert']): The event name. + data (Alert): + event (Literal['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"] + data: "Alert" + event: Literal["alert"] id: Union[Unset, int] = UNSET retry: Union[Unset, int] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -62,30 +62,28 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.run_failure_alert import RunFailureAlert + from ..models.alert import Alert d = dict(src_dict) - data = RunFailureAlert.from_dict(d.pop("data")) + data = Alert.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}'" - ) + event = cast(Literal["alert"], d.pop("event")) + if event != "alert": + raise ValueError(f"event must match const 'alert', got '{event}'") id = d.pop("id", UNSET) retry = d.pop("retry", UNSET) - stream_alerts_event_run_failure_alert = cls( + stream_alerts_event_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 + stream_alerts_event_alert.additional_properties = d + return stream_alerts_event_alert @property def additional_keys(self) -> list[str]: diff --git a/src/tower/tower_api_client/models/update_account_params.py b/src/tower/tower_api_client/models/update_account_params.py new file mode 100644 index 00000000..23fcac84 --- /dev/null +++ b/src/tower/tower_api_client/models/update_account_params.py @@ -0,0 +1,58 @@ +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="UpdateAccountParams") + + +@_attrs_define +class UpdateAccountParams: + """ + Attributes: + schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateAccountParams.json. + is_self_hosted_only (Union[Unset, bool]): Whether the account is for self-hosted use only + name (Union[Unset, str]): The new name for the account, if any + """ + + schema: Union[Unset, str] = UNSET + is_self_hosted_only: Union[Unset, bool] = UNSET + name: Union[Unset, str] = UNSET + + def to_dict(self) -> dict[str, Any]: + schema = self.schema + + is_self_hosted_only = self.is_self_hosted_only + + name = self.name + + field_dict: dict[str, Any] = {} + field_dict.update({}) + if schema is not UNSET: + field_dict["$schema"] = schema + if is_self_hosted_only is not UNSET: + field_dict["is_self_hosted_only"] = is_self_hosted_only + if name is not UNSET: + field_dict["name"] = name + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + schema = d.pop("$schema", UNSET) + + is_self_hosted_only = d.pop("is_self_hosted_only", UNSET) + + name = d.pop("name", UNSET) + + update_account_params = cls( + schema=schema, + is_self_hosted_only=is_self_hosted_only, + name=name, + ) + + return update_account_params diff --git a/src/tower/tower_api_client/models/update_account_response.py b/src/tower/tower_api_client/models/update_account_response.py new file mode 100644 index 00000000..7c7addf3 --- /dev/null +++ b/src/tower/tower_api_client/models/update_account_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.account import Account + + +T = TypeVar("T", bound="UpdateAccountResponse") + + +@_attrs_define +class UpdateAccountResponse: + """ + Attributes: + account (Account): + schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateAccountResponse.json. + """ + + account: "Account" + schema: Union[Unset, str] = UNSET + + def to_dict(self) -> dict[str, Any]: + account = self.account.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + field_dict.update( + { + "account": account, + } + ) + 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.account import Account + + d = dict(src_dict) + account = Account.from_dict(d.pop("account")) + + schema = d.pop("$schema", UNSET) + + update_account_response = cls( + account=account, + schema=schema, + ) + + return update_account_response 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 70758672..4e0c0ab7 100644 --- a/src/tower/tower_api_client/models/update_app_params.py +++ b/src/tower/tower_api_client/models/update_app_params.py @@ -12,54 +12,77 @@ class UpdateAppParams: """ Attributes: - description (str): New description for the App - 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. + description (Union[None, Unset, str]): New description for the App 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. + status (Union[None, Unset, str]): New status for the App + subdomain (Union[None, Unset, str]): The subdomain this app is accessible under. Requires + is_externally_accessible to be true. """ - description: str - status: str schema: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET is_externally_accessible: Union[None, Unset, bool] = UNSET + status: Union[None, Unset, str] = UNSET + subdomain: Union[None, Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: - description = self.description - - status = self.status - schema = self.schema + description: Union[None, Unset, str] + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + 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 + status: Union[None, Unset, str] + if isinstance(self.status, Unset): + status = UNSET + else: + status = self.status + + subdomain: Union[None, Unset, str] + if isinstance(self.subdomain, Unset): + subdomain = UNSET + else: + subdomain = self.subdomain + field_dict: dict[str, Any] = {} - field_dict.update( - { - "description": description, - "status": status, - } - ) + field_dict.update({}) if schema is not UNSET: field_dict["$schema"] = schema + if description is not UNSET: + field_dict["description"] = description if is_externally_accessible is not UNSET: field_dict["is_externally_accessible"] = is_externally_accessible + if status is not UNSET: + field_dict["status"] = status + if subdomain is not UNSET: + field_dict["subdomain"] = subdomain return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - description = d.pop("description") + schema = d.pop("$schema", UNSET) - status = d.pop("status") + def _parse_description(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) - schema = d.pop("$schema", UNSET) + description = _parse_description(d.pop("description", UNSET)) def _parse_is_externally_accessible(data: object) -> Union[None, Unset, bool]: if data is None: @@ -72,11 +95,30 @@ def _parse_is_externally_accessible(data: object) -> Union[None, Unset, bool]: d.pop("is_externally_accessible", UNSET) ) + def _parse_status(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) + + status = _parse_status(d.pop("status", UNSET)) + + def _parse_subdomain(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) + + subdomain = _parse_subdomain(d.pop("subdomain", UNSET)) + update_app_params = cls( - description=description, - status=status, schema=schema, + description=description, is_externally_accessible=is_externally_accessible, + status=status, + subdomain=subdomain, ) return update_app_params diff --git a/tests/integration/features/steps/cli_steps.py b/tests/integration/features/steps/cli_steps.py index 9ad612f6..eee67012 100644 --- a/tests/integration/features/steps/cli_steps.py +++ b/tests/integration/features/steps/cli_steps.py @@ -8,6 +8,7 @@ import shlex from pathlib import Path from behave import given, when, then +from dirty_equals import IsStr, IsPartialDict @step('I run "{command}" via CLI') @@ -235,8 +236,6 @@ def step_table_should_show_columns(context, column_list): @step("the output should be valid JSON") def step_output_should_be_valid_json(context): """Verify output is valid JSON""" - import json - try: json.loads(context.cli_output) except json.JSONDecodeError as e: @@ -248,8 +247,6 @@ def step_output_should_be_valid_json(context): @step("the JSON should contain app information") def step_json_should_contain_app_info(context): """Verify JSON contains app-related information""" - import json - data = json.loads(context.cli_output) assert ( "app" in data or "name" in data @@ -259,8 +256,6 @@ def step_json_should_contain_app_info(context): @step("the JSON should contain runs array") def step_json_should_contain_runs_array(context): """Verify JSON contains runs array""" - import json - data = json.loads(context.cli_output) assert "runs" in data and isinstance( data["runs"], list @@ -270,36 +265,19 @@ def step_json_should_contain_runs_array(context): @step("the JSON should contain the created app information") def step_json_should_contain_created_app_info(context): """Verify JSON contains created app information""" - import json - from dirty_equals import IsStr, IsDict, IsInt - data = json.loads(context.cli_output) - # Expected structure for apps create with --json - expected = { - "result": "success", - "message": IsStr(), - "data": { - "app": { - "name": IsStr(), - "short_description": IsStr(), - "owner": IsStr(), - "health_status": IsStr(), - "created_at": IsStr(), - "version": None, - "schedule": None, - "next_run_at": None, - "run_results": { - "cancelled": IsInt(), - "crashed": IsInt(), - "errored": IsInt(), - "exited": IsInt(), - "pending": IsInt(), - "running": IsInt(), - }, - } - }, - } + expected = IsPartialDict( + result="success", + message=IsStr(), + data=IsPartialDict( + app=IsPartialDict( + name=IsStr(), + owner=IsStr(), + created_at=IsStr(), + ) + ), + ) assert data == expected, f"Expected created app information structure, got: {data}" @@ -307,8 +285,6 @@ def step_json_should_contain_created_app_info(context): @step('the app name should be "{expected_name}"') def step_app_name_should_be(context, expected_name): """Verify app name matches expected value""" - import json - data = json.loads(context.cli_output) # Extract app name from response structure if "app" in data and "name" in data["app"]: diff --git a/tests/mock-api-server/main.py b/tests/mock-api-server/main.py index 68ef3f9e..cf949e70 100644 --- a/tests/mock-api-server/main.py +++ b/tests/mock-api-server/main.py @@ -67,6 +67,8 @@ async def log_requests(request: Request, call_next): "pending": 0, "running": 0, }, + "subdomain": None, + "is_externally_accessible": False, } # Pre-deploy the test-app so it can be used for validation tests mock_deployed_apps.add("predeployed-test-app") @@ -131,14 +133,12 @@ async def create_app(app_data: Dict[str, Any]): return {"app": mock_apps_db[app_name]} new_app = { - "name": app_name, - "owner": "mock_owner", - "short_description": app_data.get("short_description", ""), - "version": None, - "schedule": None, "created_at": datetime.datetime.now().isoformat(), - "next_run_at": None, "health_status": "healthy", + "is_externally_accessible": True, + "name": app_name, + "next_run_at": None, + "owner": "mock_owner", "run_results": { "cancelled": 0, "crashed": 0, @@ -147,6 +147,11 @@ async def create_app(app_data: Dict[str, Any]): "pending": 0, "running": 0, }, + "schedule": None, + "short_description": app_data.get("short_description", ""), + "status": "active", + "subdomain": "", + "version": None, } mock_apps_db[app_name] = new_app return {"app": new_app} @@ -239,6 +244,11 @@ async def run_app(name: str, run_params: Dict[str, Any]): "started_at": datetime.datetime.now().isoformat(), "ended_at": None, "app_version": mock_apps_db[name].get("version", "1.0.0"), + "subdomain": None, + "is_scheduled": True, + "initiator": { + "type": "tower_cli", + }, } mock_runs_db[run_id] = new_run return {"run": new_run} @@ -270,7 +280,14 @@ async def describe_run(name: str, seq: int): run_data["exit_code"] = 0 run_data["ended_at"] = now_time.isoformat() - return {"run": run_data} + return { + "run": run_data, + "$links": { + "next": None, + "prev": None, + "self": run_data.get("$link"), + }, + } raise HTTPException( status_code=404, detail=f"Run sequence {seq} not found for app '{name}'" diff --git a/tests/tower/test_client.py b/tests/tower/test_client.py index 9e54b9c4..1d06c3e9 100644 --- a/tests/tower/test_client.py +++ b/tests/tower/test_client.py @@ -3,7 +3,7 @@ from datetime import datetime from typing import List, Dict, Any, Optional -from tower.tower_api_client.models import Run +from tower.tower_api_client.models import Run, RunInitiator from tower.exceptions import RunFailedError @@ -55,7 +55,14 @@ def _create_run_response( "exit_code": None, "status_group": status_group, "parameters": parameters, - } + "initiator": {"type": "tower_cli"}, + "is_scheduled": False, + }, + "$links": { + "next": None, + "prev": None, + "self": f"https://api.example.com/v1/apps/my-app/runs/{number}", + }, } return _create_run_response @@ -93,6 +100,12 @@ def _create_run( status=status, status_group=status_group, parameters=parameters, + initiator=RunInitiator.from_dict( + { + "type": "tower_cli", + } + ), + is_scheduled=False, ) return _create_run From a6ec0e17a34ea2a65f3c6c9c093dfda07066f42d Mon Sep 17 00:00:00 2001 From: Ben Lovell Date: Fri, 12 Dec 2025 15:20:05 +0100 Subject: [PATCH 2/6] fix: enable Ctrl-C in local runs (#140) --- crates/tower-cmd/src/run.rs | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/crates/tower-cmd/src/run.rs b/crates/tower-cmd/src/run.rs index 7bee38d5..f40517d0 100644 --- a/crates/tower-cmd/src/run.rs +++ b/crates/tower-cmd/src/run.rs @@ -8,9 +8,11 @@ use tower_package::{Package, PackageSpec}; use tower_runtime::{local::LocalApp, App, AppLauncher, OutputReceiver, Status}; use tower_telemetry::{debug, Context}; +use std::sync::Arc; use tokio::sync::{ mpsc::{unbounded_channel, Receiver as MpscReceiver}, oneshot::{self, Receiver as OneshotReceiver}, + Mutex, }; use tokio::time::{sleep, timeout, Duration}; @@ -166,12 +168,19 @@ where .await?; // Monitor app output and status concurrently - let app = launcher.app.unwrap(); - let status_task = tokio::spawn(monitor_local_status(app)); - - // Wait for both tasks to complete + let app = Arc::new(Mutex::new(launcher.app.unwrap())); + let status_task = tokio::spawn(monitor_local_status(Arc::clone(&app))); + + // Wait for app to complete or SIGTERM + let status_result = tokio::select! { + status = status_task => status.unwrap(), + _ = tokio::signal::ctrl_c(), if !output::get_output_mode().is_mcp() => { + output::write("\nReceived Ctrl+C, stopping local run...\n"); + app.lock().await.terminate().await.ok(); + return Ok(output_task.await.unwrap()); + } + }; let final_result = output_task.await.unwrap(); - let status_result = status_task.await.unwrap(); // And if we crashed, err out match status_result { @@ -548,7 +557,7 @@ async fn monitor_output(mut output: OutputReceiver) { /// monitor_local_status is a helper function that will monitor the status of a given app and waits for /// it to progress to a terminal state. -async fn monitor_local_status(app: LocalApp) -> Status { +async fn monitor_local_status(app: Arc>) -> Status { debug!("Starting status monitoring for LocalApp"); let mut check_count = 0; let mut err_count = 0; @@ -561,7 +570,7 @@ async fn monitor_local_status(app: LocalApp) -> Status { check_count ); - match app.status().await { + match app.lock().await.status().await { Ok(status) => { // We reset the error count to indicate that we can intermittently get statuses. err_count = 0; From 42a1a97aed918de425292ed3dade595c4c9b0e1d Mon Sep 17 00:00:00 2001 From: Vim <121349594+sammuti@users.noreply.github.com> Date: Tue, 16 Dec 2025 05:35:15 -0700 Subject: [PATCH 3/6] [TOW-1213] Remove rust package info from app runtime log lines and No color for non-tty (#141) * [TOW-1213] Remove rust package info from app runtime log lines * No color for non-tty --- crates/tower-runtime/tests/local_test.rs | 49 ++++++++++++++++++++++ crates/tower-telemetry/src/logging.rs | 52 ++++++++++++++++++++++-- 2 files changed, 97 insertions(+), 4 deletions(-) diff --git a/crates/tower-runtime/tests/local_test.rs b/crates/tower-runtime/tests/local_test.rs index 65b6a24b..158c0758 100644 --- a/crates/tower-runtime/tests/local_test.rs +++ b/crates/tower-runtime/tests/local_test.rs @@ -33,6 +33,55 @@ async fn build_package_from_dir(dir: &PathBuf) -> Package { package } +#[tokio::test] +async fn test_running_hello_world_json_logs() { + tower_telemetry::enable_logging( + tower_telemetry::LogLevel::Debug, + tower_telemetry::LogFormat::Json, + tower_telemetry::LogDestination::Stdout, + ); + + debug!("Running 01-hello-world with JSON logs"); + let hello_world_dir = get_example_app_dir("01-hello-world"); + let package = build_package_from_dir(&hello_world_dir).await; + let (sender, mut receiver) = unbounded_channel(); + + // We need to create the package, which will load the app + let opts = StartOptions { + ctx: tower_telemetry::Context::new(), + package, + output_sender: sender, + cwd: None, + environment: "local".to_string(), + secrets: HashMap::new(), + parameters: HashMap::new(), + env_vars: HashMap::new(), + cache_dir: Some(config::default_cache_dir()) + }; + + // Start the app using the LocalApp runtime + let app = LocalApp::start(opts).await.expect("Failed to start app"); + + // The status should be running + let status = app.status().await.expect("Failed to get app status"); + assert!(status == Status::Running, "App should be running"); + + let mut outputs = Vec::new(); + while let Some(output) = receiver.recv().await { + outputs.push(output.line); + } + + let found_hello = outputs.iter().any(|line| line.contains("Hello, world!")); + assert!( + found_hello, + "Should have received 'Hello, world!' output from the application" + ); + + // check the status once more, should be done. + let status = app.status().await.expect("Failed to get app status"); + assert!(status == Status::Exited, "App should be running"); +} + #[tokio::test] async fn test_running_hello_world() { tower_telemetry::enable_logging( diff --git a/crates/tower-telemetry/src/logging.rs b/crates/tower-telemetry/src/logging.rs index e77ed376..c80b4464 100644 --- a/crates/tower-telemetry/src/logging.rs +++ b/crates/tower-telemetry/src/logging.rs @@ -1,3 +1,4 @@ +use std::io::IsTerminal; use tracing_subscriber::prelude::*; use tracing_subscriber::{filter::EnvFilter, fmt, layer::Layer, registry::Registry}; @@ -164,23 +165,66 @@ pub enum LogFormat { type BoxedFmtLayer = Box + Send + Sync>; +fn should_use_color(destination: &LogDestination) -> bool { + match destination { + LogDestination::Stdout => { + // Check if stdout is a TTY + std::io::stdout().is_terminal() + } + LogDestination::File(_) => { + // Never use color for file output + false + } + } +} + fn create_fmt_layer(format: LogFormat, destination: LogDestination) -> BoxedFmtLayer { + let use_color = should_use_color(&destination); + match destination { LogDestination::Stdout => match format { - LogFormat::Plain => Box::new(fmt::layer().event_format(fmt::format().pretty())), - LogFormat::Json => Box::new(fmt::layer().event_format(fmt::format().json())), + LogFormat::Plain => Box::new(fmt::layer().event_format( + fmt::format() + .pretty() + .with_target(false) + .with_file(false) + .with_line_number(false) + .with_ansi(use_color) + )), + LogFormat::Json => Box::new(fmt::layer().event_format( + fmt::format() + .json() + .with_target(false) + .with_file(false) + .with_line_number(false) + .with_ansi(use_color) + )), }, LogDestination::File(path) => { let file_appender = tracing_appender::rolling::daily(".", path); match format { LogFormat::Plain => Box::new( fmt::layer() - .event_format(fmt::format().pretty()) + .event_format( + fmt::format() + .pretty() + .with_target(false) + .with_file(false) + .with_line_number(false) + .with_ansi(use_color) + ) .with_writer(file_appender), ), LogFormat::Json => Box::new( fmt::layer() - .event_format(fmt::format().json()) + .event_format( + fmt::format() + .json() + .with_target(false) + .with_file(false) + .with_line_number(false) + .with_ansi(use_color) + ) .with_writer(file_appender), ), } From 9d43f63df1749553a0553a68e6a68f065132800f Mon Sep 17 00:00:00 2001 From: Vim <121349594+sammuti@users.noreply.github.com> Date: Tue, 16 Dec 2025 06:30:48 -0700 Subject: [PATCH 4/6] fmt (#142) --- .pre-commit-config.yaml | 6 ++++- crates/config/src/lib.rs | 4 +-- crates/tower-cmd/src/api.rs | 7 ++++-- crates/tower-cmd/src/run.rs | 4 +-- crates/tower-cmd/src/util/apps.rs | 4 +-- crates/tower-package/src/lib.rs | 13 +++++++--- crates/tower-runtime/tests/local_test.rs | 32 ++++++++++++++++++------ crates/tower-uv/src/lib.rs | 10 +++++--- crates/tower-uv/tests/install_test.rs | 4 ++- 9 files changed, 59 insertions(+), 25 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3e33492a..7e7fc25f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,4 +3,8 @@ repos: rev: 24.10.0 hooks: - id: black - language_version: python3.9 \ No newline at end of file + language_version: python3.9 + - repo: https://github.com/doublify/pre-commit-rust + rev: v1.0 + hooks: + - id: fmt \ No newline at end of file diff --git a/crates/config/src/lib.rs b/crates/config/src/lib.rs index 4d8a9b18..5890e72a 100644 --- a/crates/config/src/lib.rs +++ b/crates/config/src/lib.rs @@ -1,5 +1,5 @@ -use std::path::PathBuf; use serde::{Deserialize, Serialize}; +use std::path::PathBuf; use tower_api::apis::configuration::Configuration; use url::Url; @@ -208,7 +208,7 @@ impl From<&Config> for Configuration { } } -// default_cache_dir gets the path the default cache location for dependencies, etc. Note +// default_cache_dir gets the path the default cache location for dependencies, etc. Note // that you don't have to create underlying directory, uv will do that automagically for us. pub fn default_cache_dir() -> PathBuf { let dir = dirs::data_local_dir().unwrap(); diff --git a/crates/tower-cmd/src/api.rs b/crates/tower-cmd/src/api.rs index 7bc900d4..8a49b4a3 100644 --- a/crates/tower-cmd/src/api.rs +++ b/crates/tower-cmd/src/api.rs @@ -131,7 +131,7 @@ pub async fn describe_run_logs( let params = tower_api::apis::default_api::DescribeRunLogsParams { name: name.to_string(), seq, - start_at: None + start_at: None, }; unwrap_api_response(tower_api::apis::default_api::describe_run_logs( @@ -743,7 +743,10 @@ pub async fn list_environments( page_size: Some(1000), }; - unwrap_api_response(tower_api::apis::default_api::list_environments(api_config, params)).await + unwrap_api_response(tower_api::apis::default_api::list_environments( + api_config, params, + )) + .await } pub async fn create_environment( diff --git a/crates/tower-cmd/src/run.rs b/crates/tower-cmd/src/run.rs index f40517d0..ff9f5b62 100644 --- a/crates/tower-cmd/src/run.rs +++ b/crates/tower-cmd/src/run.rs @@ -599,10 +599,10 @@ async fn monitor_local_status(app: Arc>) -> Status { err_count += 1; // If we get five errors in a row, we abandon monitoring. - if err_count >= 5{ + if err_count >= 5 { debug!("Failed to get app status after 5 attempts, giving up"); output::error("An error occured while monitoring your local run status!"); - return tower_runtime::Status::Crashed { code: -1 } + return tower_runtime::Status::Crashed { code: -1 }; } // Otherwise, keep on keepin' on. diff --git a/crates/tower-cmd/src/util/apps.rs b/crates/tower-cmd/src/util/apps.rs index 494d650e..69b57aed 100644 --- a/crates/tower-cmd/src/util/apps.rs +++ b/crates/tower-cmd/src/util/apps.rs @@ -74,8 +74,8 @@ pub async fn ensure_app_exists( name: app_name.to_string(), short_description: Some(description.to_string()), slug: None, - is_externally_accessible: None, - subdomain: None + is_externally_accessible: None, + subdomain: None, }, }, ) diff --git a/crates/tower-package/src/lib.rs b/crates/tower-package/src/lib.rs index cd4644c5..b2a8f6a1 100644 --- a/crates/tower-package/src/lib.rs +++ b/crates/tower-package/src/lib.rs @@ -3,7 +3,7 @@ use glob::glob; use serde::{Deserialize, Serialize}; use sha2::{Digest, Sha256}; use std::collections::{HashMap, VecDeque}; -use std::path::{Path, PathBuf, Component}; +use std::path::{Component, Path, PathBuf}; use std::pin::Pin; use tmpdir::TmpDir; use tokio::{ @@ -22,7 +22,7 @@ pub use error::Error; // current version of the package format. we keep a version history here just in case anyone has // questions. will probably promote this to proper docs at some point. -// +// // Version History: // 1 - Initial version // 2 - Add app_dir, modules_dir, and checksum @@ -549,7 +549,7 @@ fn should_ignore_file(p: &PathBuf) -> bool { // normalize_path converts a Path to a normalized string with forward slashes as separators. fn normalize_path(path: &Path) -> Result { let mut next = Vec::new(); - + for component in path.components() { match component { Component::Prefix(_) | Component::RootDir => { @@ -642,7 +642,12 @@ mod test { #[tokio::test] async fn test_normalize_path() { - let path = PathBuf::from(".").join("some").join("nested").join("path").join("to").join("file.txt"); + let path = PathBuf::from(".") + .join("some") + .join("nested") + .join("path") + .join("to") + .join("file.txt"); let normalized = normalize_path(&path).unwrap(); assert_eq!(normalized, "some/nested/path/to/file.txt"); } diff --git a/crates/tower-runtime/tests/local_test.rs b/crates/tower-runtime/tests/local_test.rs index 158c0758..e803ff2f 100644 --- a/crates/tower-runtime/tests/local_test.rs +++ b/crates/tower-runtime/tests/local_test.rs @@ -105,7 +105,7 @@ async fn test_running_hello_world() { secrets: HashMap::new(), parameters: HashMap::new(), env_vars: HashMap::new(), - cache_dir: Some(config::default_cache_dir()) + cache_dir: Some(config::default_cache_dir()), }; // Start the app using the LocalApp runtime @@ -202,7 +202,7 @@ async fn test_running_legacy_app() { secrets: HashMap::new(), parameters: HashMap::new(), env_vars: HashMap::new(), - cache_dir: Some(config::default_cache_dir()) + cache_dir: Some(config::default_cache_dir()), }; // Start the app using the LocalApp runtime @@ -238,10 +238,13 @@ async fn test_running_legacy_app() { #[tokio::test] async fn test_running_app_with_secret() { debug!("Running 04-app-with-secret"); - + // We set a few environment variables that will be used to test the inherritance and override // behavior of child apps - std::env::set_var("PARENT_ENVIRONMENT_VARIABLE", "Something that should not get sent to the child"); + std::env::set_var( + "PARENT_ENVIRONMENT_VARIABLE", + "Something that should not get sent to the child", + ); std::env::set_var("OVERRIDDEN_ENVIRONMENT_VARIABLE", "The initial value"); let app_dir = get_example_app_dir("04-app-with-secret"); @@ -250,7 +253,10 @@ async fn test_running_app_with_secret() { let mut secrets = HashMap::new(); secrets.insert("MY_SECRET".to_string(), "It's in the sauce!".to_string()); - secrets.insert("OVERRIDDEN_ENVIRONMENT_VARIABLE".to_string(), "I reset it!".to_string()); + secrets.insert( + "OVERRIDDEN_ENVIRONMENT_VARIABLE".to_string(), + "I reset it!".to_string(), + ); // We need to create the package, which will load the app let opts = StartOptions { @@ -290,13 +296,19 @@ async fn test_running_app_with_secret() { assert!(output.line.ends_with("It's in the sauce!")); } - if output.line.starts_with("The parent environment variable is:") { + if output + .line + .starts_with("The parent environment variable is:") + { // Indicate that we found this line too. count_stdout += 1; assert!(output.line.ends_with("default_value")); } - if output.line.starts_with("The overridden environment variable is:") { + if output + .line + .starts_with("The overridden environment variable is:") + { // Indicate that we found the last line. count_stdout += 1; assert!(output.line.ends_with("I reset it!")); @@ -306,7 +318,11 @@ async fn test_running_app_with_secret() { } assert!(count_setup > 0, "There should be some setup output"); - assert!(count_stdout == 3, "should be three output lines from the program, there were {}", count_stdout); + assert!( + count_stdout == 3, + "should be three output lines from the program, there were {}", + count_stdout + ); // check the status once more, should be done. let status = app.status().await.expect("Failed to get app status"); diff --git a/crates/tower-uv/src/lib.rs b/crates/tower-uv/src/lib.rs index f625307f..6afe6e3a 100644 --- a/crates/tower-uv/src/lib.rs +++ b/crates/tower-uv/src/lib.rs @@ -68,7 +68,7 @@ fn normalize_env_vars(env_vars: &HashMap) -> HashMap { test_uv_path(&uv_path).await?; - Ok(Uv { uv_path, cache_dir, protected_mode }) + Ok(Uv { + uv_path, + cache_dir, + protected_mode, + }) } Err(e) => { debug!("Error setting up UV: {:?}", e); @@ -241,7 +245,7 @@ impl Uv { .arg("--no-progress") .arg("run") .arg(program); - + #[cfg(unix)] { cmd.process_group(0); diff --git a/crates/tower-uv/tests/install_test.rs b/crates/tower-uv/tests/install_test.rs index 1cb036d7..9e9bdf4a 100644 --- a/crates/tower-uv/tests/install_test.rs +++ b/crates/tower-uv/tests/install_test.rs @@ -7,6 +7,8 @@ async fn test_installing_uv() { let _ = tokio::fs::remove_dir_all(&default_uv_bin_dir).await; // Now if we instantiate a Uv instance, it should install the `uv` binary. - let uv = Uv::new(None, false).await.expect("Failed to create a Uv instance"); + let uv = Uv::new(None, false) + .await + .expect("Failed to create a Uv instance"); assert!(uv.is_valid().await); } From 5cff8a2a2aa63c1dd5324f0737434d6a8ee1b404 Mon Sep 17 00:00:00 2001 From: Vim <121349594+sammuti@users.noreply.github.com> Date: Tue, 23 Dec 2025 11:23:34 -0700 Subject: [PATCH 5/6] Update CONTRIBUTING.md with statement about the license (#144) --- CONTRIBUTING.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0880da08..f0b6a379 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -145,6 +145,8 @@ Updating, improving and correcting the documentation --> + + ## Styleguides ### Commit Messages ## Attribution This guide is based on the [contributing.md](https://contributing.md/generator)! + +## License for Contributions +By submitting a pull request, issue, or any other contribution to this repository, you agree that your contributions will be licensed under the same license that governs this project (as found in the [LICENSE](./LICENSE) file in the repository root). This means your contributions will be included under the project’s existing open source terms and conditions. From 6239423d58aeca557b114f1e3af7ee261f72d7ab Mon Sep 17 00:00:00 2001 From: Kilian Tscherny <90620239+kiliantscherny@users.noreply.github.com> Date: Tue, 23 Dec 2025 19:23:58 +0100 Subject: [PATCH 6/6] Fix: better handling of non-iterable dbt result objects and selectable dbt commands (#143) * fix: update the log run results to handle dbt commands better * refactor: update function docstring, remove inline comments * feat: add tests for selector flag in dbt --------- Co-authored-by: Brad Heller --- src/tower/_dbt.py | 51 +++++++++++++- tests/tower/test_dbt.py | 148 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 191 insertions(+), 8 deletions(-) diff --git a/src/tower/_dbt.py b/src/tower/_dbt.py index 8939ca54..518fe5b3 100644 --- a/src/tower/_dbt.py +++ b/src/tower/_dbt.py @@ -5,6 +5,7 @@ import os import shlex import tempfile +from collections.abc import Iterable as IterableABC from contextlib import contextmanager from dataclasses import dataclass, field from pathlib import Path @@ -38,6 +39,24 @@ def to_arg_list(self) -> list[str]: DbtCommand("build"), ) +# Commands that support --select flag +# See: https://docs.getdbt.com/reference/node-selection/syntax +COMMANDS_WITH_SELECT: frozenset[str] = frozenset( + { + "run", + "test", + "build", + "compile", + "seed", + "snapshot", + "docs", + "list", + "ls", + "show", + "source", + } +) + def parse_command_plan(raw: str | None) -> tuple[DbtCommand, ...]: """ @@ -182,8 +201,10 @@ def run_dbt_workflow(config: DbtRunnerConfig) -> list[object]: for command in config.commands: args = command.to_arg_list() - if config.selector and not ( - _has_flag(args, "--select") or _has_flag(args, "-s") + if ( + config.selector + and command.name in COMMANDS_WITH_SELECT + and not (_has_flag(args, "--select") or _has_flag(args, "-s")) ): args.extend(["--select", config.selector]) @@ -220,8 +241,34 @@ def run_dbt_workflow(config: DbtRunnerConfig) -> list[object]: def _log_run_results(log: logging.Logger, entries: Iterable[object] | None) -> None: + """Log individual model/test results from dbt commands that produce them. + + Based on dbt-core's return types (see dbt.cli.main.dbtRunnerResult): + + Commands returning RunExecutionResult (iterable, has node-level results): + - build, compile, run, seed, snapshot, test, run-operation + + Commands returning non-iterable results: + - docs generate → CatalogArtifact + - parse → Manifest + - list/ls → List[str] (iterable but no node results) + - debug → bool + - clean, deps, init, docs serve → None + + This function logs node-level results when available (RunExecutionResult). + For other return types, dbt's own logging is sufficient. + """ if not entries: return + + if not isinstance(entries, IterableABC) or isinstance(entries, (str, bytes)): + result_type = type(entries).__name__ + log.debug( + "Command returned %s (not iterable node results), skipping detailed logging", + result_type, + ) + return + for entry in entries: node = getattr(entry, "node", None) status = getattr(entry, "status", None) diff --git a/tests/tower/test_dbt.py b/tests/tower/test_dbt.py index 633afc6c..e871959b 100644 --- a/tests/tower/test_dbt.py +++ b/tests/tower/test_dbt.py @@ -1,18 +1,20 @@ import os -import pytest import tempfile from pathlib import Path -from unittest.mock import patch, MagicMock +from unittest.mock import MagicMock, patch + +import pytest from tower._dbt import ( - dbt, + COMMANDS_WITH_SELECT, + DEFAULT_COMMAND_PLAN, DbtCommand, DbtRunnerConfig, DbtWorkflow, - parse_command_plan, + dbt, load_profile_from_env, + parse_command_plan, run_dbt_workflow, - DEFAULT_COMMAND_PLAN, ) @@ -335,7 +337,7 @@ def test_run_workflow_success( def test_run_workflow_with_selector( self, temp_dbt_project, sample_profile, mock_dbt_runner ): - """Test workflow with selector adds --select flag.""" + """Test workflow with selector adds --select flag to commands that support it.""" with patch("tower._dbt.dbtRunner", return_value=mock_dbt_runner): config = DbtRunnerConfig( project_path=temp_dbt_project, @@ -350,6 +352,140 @@ def test_run_workflow_with_selector( assert "--select" in call_args[0][0] assert "tag:daily" in call_args[0][0] + def test_run_workflow_selector_not_added_to_unsupported_commands( + self, temp_dbt_project, sample_profile, mock_dbt_runner + ): + """Test workflow with selector does NOT add --select to commands that don't support it.""" + with patch("tower._dbt.dbtRunner", return_value=mock_dbt_runner): + config = DbtRunnerConfig( + project_path=temp_dbt_project, + profile_payload=sample_profile, + commands=(DbtCommand("deps"),), + selector="tag:daily", + ) + run_dbt_workflow(config) + + # Verify --select was NOT added for deps command + call_args = mock_dbt_runner.invoke.call_args + assert "--select" not in call_args[0][0] + + def test_run_workflow_selector_not_added_if_already_present( + self, temp_dbt_project, sample_profile, mock_dbt_runner + ): + """Test workflow doesn't add --select if it's already in command args.""" + with patch("tower._dbt.dbtRunner", return_value=mock_dbt_runner): + config = DbtRunnerConfig( + project_path=temp_dbt_project, + profile_payload=sample_profile, + commands=(DbtCommand("build", ("--select", "models/")),), + selector="tag:daily", + ) + run_dbt_workflow(config) + + # Verify only one --select flag is present (from command args) + call_args = mock_dbt_runner.invoke.call_args[0][0] + select_count = call_args.count("--select") + assert select_count == 1 + assert "models/" in call_args + assert "tag:daily" not in call_args + + def test_run_workflow_with_multiple_commands_mixed_select_support( + self, temp_dbt_project, sample_profile, mock_dbt_runner + ): + """Test workflow with multiple commands, some supporting --select and some not.""" + with patch("tower._dbt.dbtRunner", return_value=mock_dbt_runner): + config = DbtRunnerConfig( + project_path=temp_dbt_project, + profile_payload=sample_profile, + commands=( + DbtCommand("deps"), + DbtCommand("build"), + DbtCommand("docs", ("generate",)), + ), + selector="tag:daily", + ) + run_dbt_workflow(config) + + # Check all three invocations + assert mock_dbt_runner.invoke.call_count == 3 + + # First call (deps) should NOT have --select + deps_args = mock_dbt_runner.invoke.call_args_list[0][0][0] + assert "--select" not in deps_args + + # Second call (build) should have --select + build_args = mock_dbt_runner.invoke.call_args_list[1][0][0] + assert "--select" in build_args + assert "tag:daily" in build_args + + # Third call (docs generate) - docs is in COMMANDS_WITH_SELECT + # so it will have --select (even though docs generate may not need it) + docs_args = mock_dbt_runner.invoke.call_args_list[2][0][0] + assert "--select" in docs_args + assert "tag:daily" in docs_args + assert "generate" in docs_args + + @pytest.mark.parametrize( + "command_name", + [ + "run", + "test", + "build", + "compile", + "seed", + "snapshot", + "docs", + "list", + "ls", + "show", + "source", + ], + ) + def test_commands_with_select_support( + self, temp_dbt_project, sample_profile, mock_dbt_runner, command_name + ): + """Test that all commands in COMMANDS_WITH_SELECT get --select flag when selector is provided.""" + # Verify the command is actually in COMMANDS_WITH_SELECT + assert command_name in COMMANDS_WITH_SELECT + + with patch("tower._dbt.dbtRunner", return_value=mock_dbt_runner): + config = DbtRunnerConfig( + project_path=temp_dbt_project, + profile_payload=sample_profile, + commands=(DbtCommand(command_name),), + selector="tag:daily", + ) + run_dbt_workflow(config) + + # Verify --select was added + call_args = mock_dbt_runner.invoke.call_args[0][0] + assert "--select" in call_args + assert "tag:daily" in call_args + + @pytest.mark.parametrize( + "command_name", + ["deps", "clean", "debug", "init"], + ) + def test_commands_without_select_support( + self, temp_dbt_project, sample_profile, mock_dbt_runner, command_name + ): + """Test that commands not in COMMANDS_WITH_SELECT do NOT get --select flag even when selector is provided.""" + # Verify the command is NOT in COMMANDS_WITH_SELECT + assert command_name not in COMMANDS_WITH_SELECT + + with patch("tower._dbt.dbtRunner", return_value=mock_dbt_runner): + config = DbtRunnerConfig( + project_path=temp_dbt_project, + profile_payload=sample_profile, + commands=(DbtCommand(command_name),), + selector="tag:daily", + ) + run_dbt_workflow(config) + + # Verify --select was NOT added + call_args = mock_dbt_runner.invoke.call_args[0][0] + assert "--select" not in call_args + def test_run_workflow_with_full_refresh( self, temp_dbt_project, sample_profile, mock_dbt_runner ):