├── .github └── workflows │ ├── build-binaries.yml │ ├── publish-pypi.yml │ ├── release.yml │ ├── test-python.yml │ └── test-rust.yml ├── .gitignore ├── .python-version ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md ├── crates ├── config │ ├── Cargo.toml │ └── src │ │ ├── error.rs │ │ ├── lib.rs │ │ ├── session.rs │ │ └── towerfile.rs ├── crypto │ ├── Cargo.toml │ └── src │ │ ├── errors.rs │ │ └── lib.rs ├── testutils │ ├── Cargo.toml │ └── src │ │ ├── crypto.rs │ │ ├── fs.rs │ │ └── lib.rs ├── tower-api │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── apis │ │ ├── configuration.rs │ │ ├── default_api.rs │ │ └── mod.rs │ │ ├── lib.rs │ │ └── models │ │ ├── accept_invitation_params.rs │ │ ├── accept_invitation_response.rs │ │ ├── account.rs │ │ ├── acknowledge_alert_response.rs │ │ ├── alert.rs │ │ ├── alert_detail.rs │ │ ├── api_key.rs │ │ ├── app.rs │ │ ├── app_statistics.rs │ │ ├── app_summary.rs │ │ ├── app_version.rs │ │ ├── cancel_run_response.rs │ │ ├── catalog.rs │ │ ├── catalog_property.rs │ │ ├── claim_device_login_ticket_params.rs │ │ ├── claim_device_login_ticket_response.rs │ │ ├── create_account_params.rs │ │ ├── create_account_params_flags_struct.rs │ │ ├── create_account_response.rs │ │ ├── create_api_key_params.rs │ │ ├── create_api_key_response.rs │ │ ├── create_app_params.rs │ │ ├── create_app_response.rs │ │ ├── create_catalog_params.rs │ │ ├── create_catalog_response.rs │ │ ├── create_device_login_ticket_response.rs │ │ ├── create_password_reset_params.rs │ │ ├── create_password_reset_response.rs │ │ ├── create_secret_params.rs │ │ ├── create_secret_response.rs │ │ ├── create_session_params.rs │ │ ├── create_session_response.rs │ │ ├── create_team_params.rs │ │ ├── create_team_response.rs │ │ ├── delete_api_key_params.rs │ │ ├── delete_api_key_response.rs │ │ ├── delete_app_response.rs │ │ ├── delete_catalog_response.rs │ │ ├── delete_secret_response.rs │ │ ├── delete_team_invitation_params.rs │ │ ├── delete_team_invitation_response.rs │ │ ├── delete_team_params.rs │ │ ├── delete_team_response.rs │ │ ├── deploy_app_response.rs │ │ ├── describe_app_response.rs │ │ ├── describe_app_version_response.rs │ │ ├── describe_device_login_session_response.rs │ │ ├── describe_run_logs_response.rs │ │ ├── describe_run_response.rs │ │ ├── describe_secrets_key_response.rs │ │ ├── describe_session_response.rs │ │ ├── encrypted_catalog_property.rs │ │ ├── error_detail.rs │ │ ├── error_model.rs │ │ ├── export_catalogs_params.rs │ │ ├── export_catalogs_response.rs │ │ ├── export_secrets_params.rs │ │ ├── export_secrets_response.rs │ │ ├── exported_catalog.rs │ │ ├── exported_catalog_property.rs │ │ ├── exported_secret.rs │ │ ├── generate_app_statistics_response.rs │ │ ├── generate_run_statistics_response.rs │ │ ├── invite_team_member_params.rs │ │ ├── invite_team_member_response.rs │ │ ├── leave_team_response.rs │ │ ├── list_alerts_200_response.rs │ │ ├── list_alerts_response.rs │ │ ├── list_api_keys_response.rs │ │ ├── list_app_environments_response.rs │ │ ├── list_app_versions_response.rs │ │ ├── list_apps_response.rs │ │ ├── list_catalogs_response.rs │ │ ├── list_my_team_invitations_response.rs │ │ ├── list_runs_response.rs │ │ ├── list_secret_environments_response.rs │ │ ├── list_secrets_response.rs │ │ ├── list_team_invitations_response.rs │ │ ├── list_team_members_response.rs │ │ ├── list_teams_response.rs │ │ ├── log_line.rs │ │ ├── log_line_error.rs │ │ ├── mod.rs │ │ ├── pagination.rs │ │ ├── parameter.rs │ │ ├── refresh_session_params.rs │ │ ├── refresh_session_response.rs │ │ ├── remove_team_member_params.rs │ │ ├── remove_team_member_response.rs │ │ ├── resend_team_invitation_params.rs │ │ ├── resend_team_invitation_response.rs │ │ ├── run.rs │ │ ├── run_app_params.rs │ │ ├── run_app_response.rs │ │ ├── run_failure_alert.rs │ │ ├── run_log_line.rs │ │ ├── run_parameter.rs │ │ ├── run_results.rs │ │ ├── run_statistics.rs │ │ ├── secret.rs │ │ ├── series_point.rs │ │ ├── session.rs │ │ ├── sse_warning.rs │ │ ├── statistics_settings.rs │ │ ├── stream_alerts_200_response_inner.rs │ │ ├── stream_run_logs_200_response_inner.rs │ │ ├── team.rs │ │ ├── team_invitation.rs │ │ ├── token.rs │ │ ├── update_account_slug_params.rs │ │ ├── update_account_slug_response.rs │ │ ├── update_app_params.rs │ │ ├── update_app_response.rs │ │ ├── update_catalog_params.rs │ │ ├── update_catalog_response.rs │ │ ├── update_my_team_invitation_params.rs │ │ ├── update_my_team_invitation_response.rs │ │ ├── update_password_reset_params.rs │ │ ├── update_password_reset_response.rs │ │ ├── update_secret_params.rs │ │ ├── update_secret_response.rs │ │ ├── update_team_params.rs │ │ ├── update_team_response.rs │ │ ├── update_user_params.rs │ │ ├── update_user_response.rs │ │ └── user.rs ├── tower-cmd │ ├── Cargo.toml │ └── src │ │ ├── api.rs │ │ ├── apps.rs │ │ ├── banner.txt │ │ ├── deploy.rs │ │ ├── error.rs │ │ ├── lib.rs │ │ ├── output.rs │ │ ├── run.rs │ │ ├── secrets.rs │ │ ├── session.rs │ │ ├── teams.rs │ │ ├── util │ │ ├── apps.rs │ │ ├── cmd.rs │ │ ├── deploy.rs │ │ ├── mod.rs │ │ └── progress.rs │ │ └── version.rs ├── tower-package │ ├── Cargo.toml │ ├── src │ │ ├── error.rs │ │ └── lib.rs │ └── tests │ │ └── package_test.rs ├── tower-runtime │ ├── Cargo.toml │ └── src │ │ ├── errors.rs │ │ ├── lib.rs │ │ └── local.rs ├── tower-telemetry │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── logging.rs ├── tower-version │ ├── Cargo.toml │ └── src │ │ └── lib.rs └── tower │ ├── Cargo.toml │ ├── src │ └── main.rs │ └── wix │ └── main.wxs ├── dist-workspace.toml ├── pyproject.toml ├── rust-toolchain.toml ├── scripts ├── bump-version.sh ├── generate-python-api-client.sh ├── generate-rust-api-client.sh ├── rust-api-client-generator-config.yaml ├── rust-client-templates │ ├── .travis.yml │ ├── Cargo.mustache │ ├── README.mustache │ ├── api_doc.mustache │ ├── git_push.sh.mustache │ ├── gitignore.mustache │ ├── hyper │ │ ├── api.mustache │ │ ├── api_mod.mustache │ │ ├── client.mustache │ │ └── configuration.mustache │ ├── hyper0x │ │ ├── api.mustache │ │ ├── api_mod.mustache │ │ ├── client.mustache │ │ └── configuration.mustache │ ├── lib.mustache │ ├── model.mustache │ ├── model_doc.mustache │ ├── model_mod.mustache │ ├── partial_header.mustache │ ├── request.rs │ ├── reqwest-trait │ │ ├── api.mustache │ │ ├── api_mod.mustache │ │ └── configuration.mustache │ └── reqwest │ │ ├── api.mustache │ │ ├── api_mod.mustache │ │ └── configuration.mustache └── semver.py ├── src └── tower │ ├── __init__.py │ ├── __main__.py │ ├── _client.py │ ├── _context.py │ ├── _features.py │ ├── _llms.py │ ├── _tables.py │ ├── exceptions.py │ ├── polars.py │ ├── pyarrow.py │ ├── pyiceberg.py │ ├── tower_api_client │ ├── __init__.py │ ├── api │ │ ├── __init__.py │ │ └── default │ │ │ ├── __init__.py │ │ │ ├── accept_invitation.py │ │ │ ├── acknowledge_alert.py │ │ │ ├── cancel_run.py │ │ │ ├── claim_device_login_ticket.py │ │ │ ├── create_account.py │ │ │ ├── create_api_key.py │ │ │ ├── create_app.py │ │ │ ├── create_catalog.py │ │ │ ├── create_device_login_ticket.py │ │ │ ├── create_secret.py │ │ │ ├── create_session.py │ │ │ ├── create_team.py │ │ │ ├── delete_alert.py │ │ │ ├── delete_api_key.py │ │ │ ├── delete_app.py │ │ │ ├── delete_catalog.py │ │ │ ├── delete_secret.py │ │ │ ├── delete_team.py │ │ │ ├── delete_team_invitation.py │ │ │ ├── deploy_app.py │ │ │ ├── describe_app.py │ │ │ ├── describe_app_version.py │ │ │ ├── describe_device_login_session.py │ │ │ ├── describe_run.py │ │ │ ├── describe_run_logs.py │ │ │ ├── describe_secrets_key.py │ │ │ ├── describe_session.py │ │ │ ├── export_catalogs.py │ │ │ ├── export_secrets.py │ │ │ ├── generate_app_statistics.py │ │ │ ├── generate_run_statistics.py │ │ │ ├── invite_team_member.py │ │ │ ├── leave_team.py │ │ │ ├── list_alerts.py │ │ │ ├── list_api_keys.py │ │ │ ├── list_app_environments.py │ │ │ ├── list_app_versions.py │ │ │ ├── list_apps.py │ │ │ ├── list_catalogs.py │ │ │ ├── list_my_team_invitations.py │ │ │ ├── list_runs.py │ │ │ ├── list_secret_environments.py │ │ │ ├── list_secrets.py │ │ │ ├── list_team_invitations.py │ │ │ ├── list_team_members.py │ │ │ ├── list_teams.py │ │ │ ├── refresh_session.py │ │ │ ├── remove_team_member.py │ │ │ ├── resend_team_invitation.py │ │ │ ├── run_app.py │ │ │ ├── stream_run_logs.py │ │ │ ├── update_account_slug.py │ │ │ ├── update_app.py │ │ │ ├── update_catalog.py │ │ │ ├── update_my_team_invitation.py │ │ │ ├── update_secret.py │ │ │ ├── update_team.py │ │ │ └── update_user.py │ ├── client.py │ ├── errors.py │ ├── models │ │ ├── __init__.py │ │ ├── accept_invitation_params.py │ │ ├── accept_invitation_response.py │ │ ├── account.py │ │ ├── acknowledge_alert_response.py │ │ ├── alert.py │ │ ├── alert_alert_type.py │ │ ├── alert_detail.py │ │ ├── alert_status.py │ │ ├── api_key.py │ │ ├── app.py │ │ ├── app_statistics.py │ │ ├── app_status.py │ │ ├── app_summary.py │ │ ├── app_version.py │ │ ├── cancel_run_response.py │ │ ├── catalog.py │ │ ├── catalog_property.py │ │ ├── claim_device_login_ticket_params.py │ │ ├── claim_device_login_ticket_response.py │ │ ├── create_account_params.py │ │ ├── create_account_params_flags_struct.py │ │ ├── create_account_response.py │ │ ├── create_api_key_params.py │ │ ├── create_api_key_response.py │ │ ├── create_app_params.py │ │ ├── create_app_response.py │ │ ├── create_catalog_params.py │ │ ├── create_catalog_params_type.py │ │ ├── create_catalog_response.py │ │ ├── create_device_login_ticket_response.py │ │ ├── create_secret_params.py │ │ ├── create_secret_response.py │ │ ├── create_session_params.py │ │ ├── create_session_response.py │ │ ├── create_team_params.py │ │ ├── create_team_response.py │ │ ├── delete_api_key_params.py │ │ ├── delete_api_key_response.py │ │ ├── delete_app_response.py │ │ ├── delete_catalog_response.py │ │ ├── delete_secret_response.py │ │ ├── delete_team_invitation_params.py │ │ ├── delete_team_invitation_response.py │ │ ├── delete_team_params.py │ │ ├── delete_team_response.py │ │ ├── deploy_app_response.py │ │ ├── describe_app_response.py │ │ ├── describe_app_version_response.py │ │ ├── describe_device_login_session_response.py │ │ ├── describe_run_logs_response.py │ │ ├── describe_run_response.py │ │ ├── describe_secrets_key_response.py │ │ ├── describe_session_response.py │ │ ├── encrypted_catalog_property.py │ │ ├── error_detail.py │ │ ├── error_model.py │ │ ├── export_catalogs_params.py │ │ ├── export_catalogs_response.py │ │ ├── export_secrets_params.py │ │ ├── export_secrets_response.py │ │ ├── exported_catalog.py │ │ ├── exported_catalog_property.py │ │ ├── exported_secret.py │ │ ├── generate_app_statistics_response.py │ │ ├── generate_run_statistics_response.py │ │ ├── invite_team_member_params.py │ │ ├── invite_team_member_response.py │ │ ├── leave_team_response.py │ │ ├── list_alerts_response.py │ │ ├── list_api_keys_response.py │ │ ├── list_app_environments_response.py │ │ ├── list_app_versions_response.py │ │ ├── list_apps_response.py │ │ ├── list_apps_status_item.py │ │ ├── list_catalogs_response.py │ │ ├── list_my_team_invitations_response.py │ │ ├── list_runs_response.py │ │ ├── list_runs_status_item.py │ │ ├── list_secret_environments_response.py │ │ ├── list_secrets_response.py │ │ ├── list_team_invitations_response.py │ │ ├── list_team_members_response.py │ │ ├── list_teams_response.py │ │ ├── log_line.py │ │ ├── log_line_channel.py │ │ ├── log_line_error.py │ │ ├── pagination.py │ │ ├── parameter.py │ │ ├── refresh_session_params.py │ │ ├── refresh_session_response.py │ │ ├── remove_team_member_params.py │ │ ├── remove_team_member_response.py │ │ ├── resend_team_invitation_params.py │ │ ├── resend_team_invitation_response.py │ │ ├── run.py │ │ ├── run_app_params.py │ │ ├── run_app_params_parameters.py │ │ ├── run_app_response.py │ │ ├── run_log_line.py │ │ ├── run_parameter.py │ │ ├── run_results.py │ │ ├── run_statistics.py │ │ ├── run_status.py │ │ ├── run_status_group.py │ │ ├── secret.py │ │ ├── series_point.py │ │ ├── session.py │ │ ├── statistics_settings.py │ │ ├── team.py │ │ ├── team_invitation.py │ │ ├── token.py │ │ ├── update_account_slug_params.py │ │ ├── update_account_slug_response.py │ │ ├── update_app_params.py │ │ ├── update_app_response.py │ │ ├── update_catalog_params.py │ │ ├── update_catalog_response.py │ │ ├── update_my_team_invitation_params.py │ │ ├── update_my_team_invitation_response.py │ │ ├── update_secret_params.py │ │ ├── update_secret_response.py │ │ ├── update_team_params.py │ │ ├── update_team_response.py │ │ ├── update_user_params.py │ │ ├── update_user_response.py │ │ └── user.py │ └── types.py │ └── utils │ ├── pyarrow.py │ └── tables.py ├── tests └── tower │ ├── test_client.py │ └── test_tables.py ├── uv.lock └── version.txt /.github/workflows/publish-pypi.yml: -------------------------------------------------------------------------------- 1 | # Publish a release to PyPI. 2 | # 3 | # Assumed to run as a subworkflow of .github/workflows/release.yml; specifically, as a publish job 4 | # within `cargo-dist`. 5 | # 6 | # Shamelessly lifted from the guys who brought Ruff to the world. 7 | # https://github.com/astral-sh/ruff/ 8 | name: "[tower] Publish to PyPI" 9 | 10 | on: 11 | workflow_call: 12 | inputs: 13 | plan: 14 | required: true 15 | type: string 16 | 17 | jobs: 18 | pypi-publish: 19 | name: Upload to PyPI 20 | runs-on: ubuntu-latest 21 | environment: 22 | name: release 23 | permissions: 24 | # For PyPI's trusted publishing. 25 | id-token: write 26 | steps: 27 | - name: "Install uv" 28 | uses: astral-sh/setup-uv@v3 29 | - uses: actions/download-artifact@v4 30 | with: 31 | pattern: wheels-* 32 | path: wheels 33 | merge-multiple: true 34 | - name: Publish to PyPi 35 | run: uv publish -v wheels/* 36 | -------------------------------------------------------------------------------- /.github/workflows/test-python.yml: -------------------------------------------------------------------------------- 1 | # This workflow will build and test the Rust code in this repository. There are 2 | # separate workflows for testing the python portion of the code base. 3 | # 4 | # This file is *not* generated from automation and is manually maintained. 5 | # 6 | name: "[tower] Test python" 7 | 8 | on: 9 | pull_request: 10 | push: 11 | branches: 12 | - '*' 13 | tags-ignore: 14 | - '**' 15 | 16 | concurrency: 17 | group: ${{ github.workflow }}-${{ github.ref }} 18 | cancel-in-progress: true 19 | 20 | jobs: 21 | test: 22 | runs-on: ${{ matrix.os }} 23 | strategy: 24 | fail-fast: false 25 | matrix: 26 | os: 27 | - ubuntu-latest 28 | 29 | steps: 30 | - uses: actions/checkout@v4 31 | 32 | - name: Install the latest version of uv 33 | uses: astral-sh/setup-uv@v6 34 | 35 | - name: "Set up Python" 36 | uses: actions/setup-python@v5 37 | with: 38 | python-version-file: ".python-version" 39 | 40 | - name: Install the project 41 | run: uv sync --locked --all-extras --dev 42 | 43 | - name: Run tests 44 | run: uv run pytest tests 45 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /.venv 3 | *.pyc 4 | __pycache__ 5 | 6 | # 7 | # Artifacts from the Rust client generation process 8 | # 9 | /crates/tower-api/.openapi-generator-ignore 10 | /crates/tower-api/.openapi-generator/ 11 | /crates/tower-api/.travis.yml 12 | /crates/tower-api/git_push.sh 13 | /crates/tower-api/.gitignore 14 | /scripts/openapi.json 15 | /scripts/openapi-generator-cli-*.jar 16 | -------------------------------------------------------------------------------- /.python-version: -------------------------------------------------------------------------------- 1 | 3.12 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Tower Computing Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /crates/config/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "config" 3 | version = { workspace = true } 4 | authors = { workspace = true } 5 | edition = { workspace = true } 6 | rust-version = { workspace = true } 7 | license = { workspace = true } 8 | 9 | [dependencies] 10 | chrono = { workspace = true } 11 | clap = { workspace = true } 12 | dirs = { workspace = true } 13 | futures = { workspace = true } 14 | log = { workspace = true } 15 | serde = { workspace = true } 16 | serde_json = { workspace = true } 17 | snafu = { workspace = true } 18 | tokio = { workspace = true } 19 | toml = { workspace = true } 20 | testutils = { workspace = true } 21 | url = { workspace = true } 22 | tower-api = { workspace = true } 23 | -------------------------------------------------------------------------------- /crates/crypto/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "crypto" 3 | version = { workspace = true } 4 | edition = "2021" 5 | 6 | [dependencies] 7 | aes-gcm = { workspace = true } 8 | base64 = { workspace = true } 9 | pem = { workspace = true } 10 | rand = { workspace = true } 11 | rsa = { workspace = true } 12 | sha2 = { workspace = true } 13 | snafu = { workspace = true } 14 | testutils = { workspace = true } 15 | -------------------------------------------------------------------------------- /crates/crypto/src/errors.rs: -------------------------------------------------------------------------------- 1 | use snafu::prelude::*; 2 | 3 | #[derive(Debug, Snafu)] 4 | pub enum Error { 5 | #[snafu(display("invalid message"))] 6 | InvalidMessage, 7 | 8 | #[snafu(display("invalid encoding"))] 9 | InvalidEncoding, 10 | 11 | #[snafu(display("cryptography error"))] 12 | CryptographyError, 13 | 14 | #[snafu(display("base64 error"))] 15 | Base64Error, 16 | } 17 | 18 | impl From for Error { 19 | fn from(_error: std::string::FromUtf8Error) -> Self { 20 | Self::InvalidEncoding 21 | } 22 | } 23 | 24 | impl From for Error { 25 | fn from(_error: aes_gcm::Error) -> Self { 26 | Self::CryptographyError 27 | } 28 | } 29 | 30 | impl From for Error { 31 | fn from(_error: rsa::Error) -> Self { 32 | Self::CryptographyError 33 | } 34 | } 35 | 36 | impl From for Error { 37 | fn from(_error: base64::DecodeError) -> Self { 38 | Self::Base64Error 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /crates/testutils/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "testutils" 3 | version = { workspace = true } 4 | edition = "2021" 5 | 6 | [dependencies] 7 | pem = { workspace = true } 8 | rsa = { workspace = true } 9 | -------------------------------------------------------------------------------- /crates/testutils/src/fs.rs: -------------------------------------------------------------------------------- 1 | use std::fs::{File, remove_file}; 2 | use std::path::{Path, PathBuf}; 3 | use std::io; 4 | 5 | pub struct TestFile { 6 | path: PathBuf, 7 | file: File, 8 | } 9 | 10 | impl TestFile { 11 | // Creates a new temporary file, which will be deleted on drop. 12 | pub fn new>(path: P) -> io::Result { 13 | let path = path.as_ref().to_path_buf(); 14 | let file = File::create(&path)?; 15 | Ok(TestFile { path, file }) 16 | } 17 | 18 | // Provides a mutable reference to the inner file, e.g., to write to it. 19 | pub fn file(&mut self) -> &mut File { 20 | &mut self.file 21 | } 22 | } 23 | 24 | impl Drop for TestFile { 25 | fn drop(&mut self) { 26 | // Delete the file when `TestFile` goes out of scope. 27 | let _ = remove_file(&self.path); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /crates/testutils/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod fs; 2 | pub mod crypto; 3 | -------------------------------------------------------------------------------- /crates/tower-api/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "tower-api" 3 | version = { workspace = true } 4 | authors = { workspace = true } 5 | edition = { workspace = true } 6 | rust-version = { workspace = true } 7 | license = { workspace = true } 8 | 9 | [dependencies] 10 | log = { workspace = true } 11 | serde = { version = "^1.0", features = ["derive"] } 12 | serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } 13 | serde_json = "^1.0" 14 | serde_repr = "^0.1" 15 | url = "^2.5" 16 | reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart"] } 17 | -------------------------------------------------------------------------------- /crates/tower-api/src/apis/configuration.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | 12 | 13 | #[derive(Debug, Clone)] 14 | pub struct Configuration { 15 | pub base_path: String, 16 | pub user_agent: Option, 17 | pub client: reqwest::Client, 18 | pub basic_auth: Option, 19 | pub oauth_access_token: Option, 20 | pub bearer_access_token: Option, 21 | pub api_key: Option, 22 | } 23 | 24 | pub type BasicAuth = (String, Option); 25 | 26 | #[derive(Debug, Clone)] 27 | pub struct ApiKey { 28 | pub prefix: Option, 29 | pub key: String, 30 | } 31 | 32 | 33 | impl Configuration { 34 | pub fn new() -> Configuration { 35 | Configuration::default() 36 | } 37 | } 38 | 39 | impl Default for Configuration { 40 | fn default() -> Self { 41 | Configuration { 42 | base_path: "https://api.tower.dev/v1".to_owned(), 43 | user_agent: Some("Tower CLI".to_owned()), 44 | client: reqwest::Client::new(), 45 | basic_auth: None, 46 | oauth_access_token: None, 47 | bearer_access_token: None, 48 | api_key: None, 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /crates/tower-api/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::too_many_arguments)] 3 | 4 | extern crate serde_repr; 5 | extern crate serde; 6 | extern crate serde_json; 7 | extern crate url; 8 | extern crate reqwest; 9 | 10 | pub mod apis; 11 | pub mod models; 12 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/accept_invitation_params.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct AcceptInvitationParams { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// The invitation code to accept 20 | #[serde(rename = "code")] 21 | pub code: String, 22 | } 23 | 24 | impl AcceptInvitationParams { 25 | pub fn new(code: String) -> AcceptInvitationParams { 26 | AcceptInvitationParams { 27 | schema: None, 28 | code, 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/accept_invitation_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct AcceptInvitationResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "user")] 20 | pub user: Box, 21 | } 22 | 23 | impl AcceptInvitationResponse { 24 | pub fn new(user: models::User) -> AcceptInvitationResponse { 25 | AcceptInvitationResponse { 26 | schema: None, 27 | user: Box::new(user), 28 | } 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/account.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct Account { 16 | #[serde(rename = "name")] 17 | pub name: String, 18 | #[serde(rename = "slug")] 19 | pub slug: String, 20 | } 21 | 22 | impl Account { 23 | pub fn new(name: String, slug: String) -> Account { 24 | Account { 25 | name, 26 | slug, 27 | } 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/acknowledge_alert_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct AcknowledgeAlertResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "status")] 20 | pub status: String, 21 | } 22 | 23 | impl AcknowledgeAlertResponse { 24 | pub fn new(status: String) -> AcknowledgeAlertResponse { 25 | AcknowledgeAlertResponse { 26 | schema: None, 27 | status, 28 | } 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/alert.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct Alert { 16 | /// Whether the alert has been acknowledged 17 | #[serde(rename = "acked")] 18 | pub acked: bool, 19 | /// Type of the alert 20 | #[serde(rename = "alert_type")] 21 | pub alert_type: String, 22 | /// When the alert was created 23 | #[serde(rename = "created_at")] 24 | pub created_at: String, 25 | #[serde(rename = "detail")] 26 | pub detail: Box, 27 | /// Sequence number of the alert 28 | #[serde(rename = "seq")] 29 | pub seq: i32, 30 | /// Current status of the alert 31 | #[serde(rename = "status")] 32 | pub status: String, 33 | } 34 | 35 | impl Alert { 36 | pub fn new(acked: bool, alert_type: String, created_at: String, detail: models::RunFailureAlert, seq: i32, status: String) -> Alert { 37 | Alert { 38 | acked, 39 | alert_type, 40 | created_at, 41 | detail: Box::new(detail), 42 | seq, 43 | status, 44 | } 45 | } 46 | } 47 | 48 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/alert_detail.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.12 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct AlertDetail { 16 | #[serde(rename = "description")] 17 | pub description: String, 18 | #[serde(rename = "name")] 19 | pub name: String, 20 | } 21 | 22 | impl AlertDetail { 23 | pub fn new(description: String, name: String) -> AlertDetail { 24 | AlertDetail { 25 | description, 26 | name, 27 | } 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/api_key.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct ApiKey { 16 | #[serde(rename = "created_at")] 17 | pub created_at: String, 18 | #[serde(rename = "identifier")] 19 | pub identifier: String, 20 | #[serde(rename = "last_used_at", deserialize_with = "Option::deserialize")] 21 | pub last_used_at: Option, 22 | #[serde(rename = "name")] 23 | pub name: String, 24 | } 25 | 26 | impl ApiKey { 27 | pub fn new(created_at: String, identifier: String, last_used_at: Option, name: String) -> ApiKey { 28 | ApiKey { 29 | created_at, 30 | identifier, 31 | last_used_at, 32 | name, 33 | } 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/app_statistics.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct AppStatistics { 16 | #[serde(rename = "all_apps")] 17 | pub all_apps: i64, 18 | #[serde(rename = "disabled_apps")] 19 | pub disabled_apps: i64, 20 | #[serde(rename = "exited_apps")] 21 | pub exited_apps: i64, 22 | #[serde(rename = "failed_apps")] 23 | pub failed_apps: i64, 24 | #[serde(rename = "running_apps")] 25 | pub running_apps: i64, 26 | } 27 | 28 | impl AppStatistics { 29 | pub fn new(all_apps: i64, disabled_apps: i64, exited_apps: i64, failed_apps: i64, running_apps: i64) -> AppStatistics { 30 | AppStatistics { 31 | all_apps, 32 | disabled_apps, 33 | exited_apps, 34 | failed_apps, 35 | running_apps, 36 | } 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/app_summary.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct AppSummary { 16 | #[serde(rename = "app")] 17 | pub app: Box, 18 | #[serde(rename = "run_results")] 19 | pub run_results: Box, 20 | #[serde(rename = "runs")] 21 | pub runs: Vec, 22 | #[serde(rename = "total_runs")] 23 | pub total_runs: i64, 24 | } 25 | 26 | impl AppSummary { 27 | pub fn new(app: models::App, run_results: models::RunResults, runs: Vec, total_runs: i64) -> AppSummary { 28 | AppSummary { 29 | app: Box::new(app), 30 | run_results: Box::new(run_results), 31 | runs, 32 | total_runs, 33 | } 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/app_version.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct AppVersion { 16 | #[serde(rename = "created_at")] 17 | pub created_at: String, 18 | #[serde(rename = "parameters")] 19 | pub parameters: Vec, 20 | /// The Towerfile that this version was created from. 21 | #[serde(rename = "towerfile")] 22 | pub towerfile: String, 23 | #[serde(rename = "version")] 24 | pub version: String, 25 | } 26 | 27 | impl AppVersion { 28 | pub fn new(created_at: String, parameters: Vec, towerfile: String, version: String) -> AppVersion { 29 | AppVersion { 30 | created_at, 31 | parameters, 32 | towerfile, 33 | version, 34 | } 35 | } 36 | } 37 | 38 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/cancel_run_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct CancelRunResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "run")] 20 | pub run: Box, 21 | } 22 | 23 | impl CancelRunResponse { 24 | pub fn new(run: models::Run) -> CancelRunResponse { 25 | CancelRunResponse { 26 | schema: None, 27 | run: Box::new(run), 28 | } 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/catalog.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct Catalog { 16 | #[serde(rename = "CreatedAt")] 17 | pub created_at: String, 18 | #[serde(rename = "environment")] 19 | pub environment: String, 20 | #[serde(rename = "name")] 21 | pub name: String, 22 | #[serde(rename = "properties")] 23 | pub properties: Vec, 24 | #[serde(rename = "slug")] 25 | pub slug: String, 26 | #[serde(rename = "type")] 27 | pub r#type: String, 28 | } 29 | 30 | impl Catalog { 31 | pub fn new(created_at: String, environment: String, name: String, properties: Vec, slug: String, r#type: String) -> Catalog { 32 | Catalog { 33 | created_at, 34 | environment, 35 | name, 36 | properties, 37 | slug, 38 | r#type, 39 | } 40 | } 41 | } 42 | 43 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/catalog_property.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct CatalogProperty { 16 | #[serde(rename = "name")] 17 | pub name: String, 18 | #[serde(rename = "preview")] 19 | pub preview: String, 20 | } 21 | 22 | impl CatalogProperty { 23 | pub fn new(name: String, preview: String) -> CatalogProperty { 24 | CatalogProperty { 25 | name, 26 | preview, 27 | } 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/claim_device_login_ticket_params.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct ClaimDeviceLoginTicketParams { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// The user code to claim. 20 | #[serde(rename = "user_code")] 21 | pub user_code: String, 22 | } 23 | 24 | impl ClaimDeviceLoginTicketParams { 25 | pub fn new(user_code: String) -> ClaimDeviceLoginTicketParams { 26 | ClaimDeviceLoginTicketParams { 27 | schema: None, 28 | user_code, 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/claim_device_login_ticket_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct ClaimDeviceLoginTicketResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// Whether the code was successfully claimed. 20 | #[serde(rename = "claimed")] 21 | pub claimed: bool, 22 | } 23 | 24 | impl ClaimDeviceLoginTicketResponse { 25 | pub fn new(claimed: bool) -> ClaimDeviceLoginTicketResponse { 26 | ClaimDeviceLoginTicketResponse { 27 | schema: None, 28 | claimed, 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/create_account_params_flags_struct.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct CreateAccountParamsFlagsStruct { 16 | #[serde(rename = "is_test_account")] 17 | pub is_test_account: bool, 18 | } 19 | 20 | impl CreateAccountParamsFlagsStruct { 21 | pub fn new(is_test_account: bool) -> CreateAccountParamsFlagsStruct { 22 | CreateAccountParamsFlagsStruct { 23 | is_test_account, 24 | } 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/create_account_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct CreateAccountResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "session")] 20 | pub session: Box, 21 | } 22 | 23 | impl CreateAccountResponse { 24 | pub fn new(session: models::Session) -> CreateAccountResponse { 25 | CreateAccountResponse { 26 | schema: None, 27 | session: Box::new(session), 28 | } 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/create_api_key_params.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct CreateApiKeyParams { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "name")] 20 | pub name: String, 21 | } 22 | 23 | impl CreateApiKeyParams { 24 | pub fn new(name: String) -> CreateApiKeyParams { 25 | CreateApiKeyParams { 26 | schema: None, 27 | name, 28 | } 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/create_api_key_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct CreateApiKeyResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// Created API key 20 | #[serde(rename = "api_key")] 21 | pub api_key: Box, 22 | } 23 | 24 | impl CreateApiKeyResponse { 25 | pub fn new(api_key: models::ApiKey) -> CreateApiKeyResponse { 26 | CreateApiKeyResponse { 27 | schema: None, 28 | api_key: Box::new(api_key), 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/create_app_params.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct CreateAppParams { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// The name of the app. 20 | #[serde(rename = "name")] 21 | pub name: String, 22 | /// A description of the app. 23 | #[serde(rename = "short_description", skip_serializing_if = "Option::is_none")] 24 | pub short_description: Option, 25 | /// A slug for the app. 26 | #[serde(rename = "slug", skip_serializing_if = "Option::is_none")] 27 | pub slug: Option, 28 | } 29 | 30 | impl CreateAppParams { 31 | pub fn new(name: String) -> CreateAppParams { 32 | CreateAppParams { 33 | schema: None, 34 | name, 35 | short_description: None, 36 | slug: None, 37 | } 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/create_app_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct CreateAppResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "app")] 20 | pub app: Box, 21 | } 22 | 23 | impl CreateAppResponse { 24 | pub fn new(app: models::App) -> CreateAppResponse { 25 | CreateAppResponse { 26 | schema: None, 27 | app: Box::new(app), 28 | } 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/create_catalog_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct CreateCatalogResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "catalog")] 20 | pub catalog: Box, 21 | } 22 | 23 | impl CreateCatalogResponse { 24 | pub fn new(catalog: models::Catalog) -> CreateCatalogResponse { 25 | CreateCatalogResponse { 26 | schema: None, 27 | catalog: Box::new(catalog), 28 | } 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/create_password_reset_params.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct CreatePasswordResetParams { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// The email address to send the password reset email to 20 | #[serde(rename = "email")] 21 | pub email: String, 22 | } 23 | 24 | impl CreatePasswordResetParams { 25 | pub fn new(email: String) -> CreatePasswordResetParams { 26 | CreatePasswordResetParams { 27 | schema: None, 28 | email, 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/create_password_reset_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct CreatePasswordResetResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// A boolean indicating the request was successfully processed. 20 | #[serde(rename = "ok")] 21 | pub ok: bool, 22 | } 23 | 24 | impl CreatePasswordResetResponse { 25 | pub fn new(ok: bool) -> CreatePasswordResetResponse { 26 | CreatePasswordResetResponse { 27 | schema: None, 28 | ok, 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/create_secret_params.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct CreateSecretParams { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "encrypted_value")] 20 | pub encrypted_value: String, 21 | #[serde(rename = "environment")] 22 | pub environment: String, 23 | #[serde(rename = "name")] 24 | pub name: String, 25 | #[serde(rename = "preview")] 26 | pub preview: String, 27 | } 28 | 29 | impl CreateSecretParams { 30 | pub fn new(encrypted_value: String, environment: String, name: String, preview: String) -> CreateSecretParams { 31 | CreateSecretParams { 32 | schema: None, 33 | encrypted_value, 34 | environment, 35 | name, 36 | preview, 37 | } 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/create_secret_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct CreateSecretResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "secret")] 20 | pub secret: Box, 21 | } 22 | 23 | impl CreateSecretResponse { 24 | pub fn new(secret: models::Secret) -> CreateSecretResponse { 25 | CreateSecretResponse { 26 | schema: None, 27 | secret: Box::new(secret), 28 | } 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/create_session_params.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct CreateSessionParams { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "password")] 20 | pub password: String, 21 | #[serde(rename = "username")] 22 | pub username: String, 23 | } 24 | 25 | impl CreateSessionParams { 26 | pub fn new(password: String, username: String) -> CreateSessionParams { 27 | CreateSessionParams { 28 | schema: None, 29 | password, 30 | username, 31 | } 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/create_session_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct CreateSessionResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// The new session information. 20 | #[serde(rename = "session")] 21 | pub session: Box, 22 | } 23 | 24 | impl CreateSessionResponse { 25 | pub fn new(session: models::Session) -> CreateSessionResponse { 26 | CreateSessionResponse { 27 | schema: None, 28 | session: Box::new(session), 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/create_team_params.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct CreateTeamParams { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// The name of the team to create 20 | #[serde(rename = "name")] 21 | pub name: String, 22 | /// The slug of the team to create 23 | #[serde(rename = "slug")] 24 | pub slug: String, 25 | } 26 | 27 | impl CreateTeamParams { 28 | pub fn new(name: String, slug: String) -> CreateTeamParams { 29 | CreateTeamParams { 30 | schema: None, 31 | name, 32 | slug, 33 | } 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/create_team_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct CreateTeamResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// The team that was just created 20 | #[serde(rename = "team")] 21 | pub team: Box, 22 | } 23 | 24 | impl CreateTeamResponse { 25 | pub fn new(team: models::Team) -> CreateTeamResponse { 26 | CreateTeamResponse { 27 | schema: None, 28 | team: Box::new(team), 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/delete_api_key_params.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct DeleteApiKeyParams { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "identifier")] 20 | pub identifier: String, 21 | } 22 | 23 | impl DeleteApiKeyParams { 24 | pub fn new(identifier: String) -> DeleteApiKeyParams { 25 | DeleteApiKeyParams { 26 | schema: None, 27 | identifier, 28 | } 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/delete_api_key_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct DeleteApiKeyResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// Created API key 20 | #[serde(rename = "api_key")] 21 | pub api_key: Box, 22 | } 23 | 24 | impl DeleteApiKeyResponse { 25 | pub fn new(api_key: models::ApiKey) -> DeleteApiKeyResponse { 26 | DeleteApiKeyResponse { 27 | schema: None, 28 | api_key: Box::new(api_key), 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/delete_app_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct DeleteAppResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "app")] 20 | pub app: Box, 21 | } 22 | 23 | impl DeleteAppResponse { 24 | pub fn new(app: models::App) -> DeleteAppResponse { 25 | DeleteAppResponse { 26 | schema: None, 27 | app: Box::new(app), 28 | } 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/delete_catalog_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct DeleteCatalogResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "catalog")] 20 | pub catalog: Box, 21 | } 22 | 23 | impl DeleteCatalogResponse { 24 | pub fn new(catalog: models::Catalog) -> DeleteCatalogResponse { 25 | DeleteCatalogResponse { 26 | schema: None, 27 | catalog: Box::new(catalog), 28 | } 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/delete_secret_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct DeleteSecretResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "secret")] 20 | pub secret: Box, 21 | } 22 | 23 | impl DeleteSecretResponse { 24 | pub fn new(secret: models::Secret) -> DeleteSecretResponse { 25 | DeleteSecretResponse { 26 | schema: None, 27 | secret: Box::new(secret), 28 | } 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/delete_team_invitation_params.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct DeleteTeamInvitationParams { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// The email address of the team member to remove 20 | #[serde(rename = "email")] 21 | pub email: String, 22 | } 23 | 24 | impl DeleteTeamInvitationParams { 25 | pub fn new(email: String) -> DeleteTeamInvitationParams { 26 | DeleteTeamInvitationParams { 27 | schema: None, 28 | email, 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/delete_team_invitation_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct DeleteTeamInvitationResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// The team invitation that was just removed 20 | #[serde(rename = "invitation")] 21 | pub invitation: Box, 22 | } 23 | 24 | impl DeleteTeamInvitationResponse { 25 | pub fn new(invitation: models::TeamInvitation) -> DeleteTeamInvitationResponse { 26 | DeleteTeamInvitationResponse { 27 | schema: None, 28 | invitation: Box::new(invitation), 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/delete_team_params.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct DeleteTeamParams { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// The slug of the team to delete 20 | #[serde(rename = "slug")] 21 | pub slug: String, 22 | } 23 | 24 | impl DeleteTeamParams { 25 | pub fn new(slug: String) -> DeleteTeamParams { 26 | DeleteTeamParams { 27 | schema: None, 28 | slug, 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/delete_team_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct DeleteTeamResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// The team that was just created 20 | #[serde(rename = "team")] 21 | pub team: Box, 22 | } 23 | 24 | impl DeleteTeamResponse { 25 | pub fn new(team: models::Team) -> DeleteTeamResponse { 26 | DeleteTeamResponse { 27 | schema: None, 28 | team: Box::new(team), 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/deploy_app_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct DeployAppResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "version")] 20 | pub version: Box, 21 | } 22 | 23 | impl DeployAppResponse { 24 | pub fn new(version: models::AppVersion) -> DeployAppResponse { 25 | DeployAppResponse { 26 | schema: None, 27 | version: Box::new(version), 28 | } 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/describe_app_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct DescribeAppResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "app")] 20 | pub app: Box, 21 | #[serde(rename = "runs")] 22 | pub runs: Vec, 23 | } 24 | 25 | impl DescribeAppResponse { 26 | pub fn new(app: models::App, runs: Vec) -> DescribeAppResponse { 27 | DescribeAppResponse { 28 | schema: None, 29 | app: Box::new(app), 30 | runs, 31 | } 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/describe_app_version_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct DescribeAppVersionResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "version")] 20 | pub version: Box, 21 | } 22 | 23 | impl DescribeAppVersionResponse { 24 | pub fn new(version: models::AppVersion) -> DescribeAppVersionResponse { 25 | DescribeAppVersionResponse { 26 | schema: None, 27 | version: Box::new(version), 28 | } 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/describe_device_login_session_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct DescribeDeviceLoginSessionResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// The current session associated with your authentication method. 20 | #[serde(rename = "session")] 21 | pub session: Box, 22 | } 23 | 24 | impl DescribeDeviceLoginSessionResponse { 25 | pub fn new(session: models::Session) -> DescribeDeviceLoginSessionResponse { 26 | DescribeDeviceLoginSessionResponse { 27 | schema: None, 28 | session: Box::new(session), 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/describe_run_logs_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct DescribeRunLogsResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "log_lines")] 20 | pub log_lines: Vec, 21 | } 22 | 23 | impl DescribeRunLogsResponse { 24 | pub fn new(log_lines: Vec) -> DescribeRunLogsResponse { 25 | DescribeRunLogsResponse { 26 | schema: None, 27 | log_lines, 28 | } 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/describe_run_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct DescribeRunResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "run")] 20 | pub run: Box, 21 | } 22 | 23 | impl DescribeRunResponse { 24 | pub fn new(run: models::Run) -> DescribeRunResponse { 25 | DescribeRunResponse { 26 | schema: None, 27 | run: Box::new(run), 28 | } 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/describe_secrets_key_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct DescribeSecretsKeyResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "public_key")] 20 | pub public_key: String, 21 | } 22 | 23 | impl DescribeSecretsKeyResponse { 24 | pub fn new(public_key: String) -> DescribeSecretsKeyResponse { 25 | DescribeSecretsKeyResponse { 26 | schema: None, 27 | public_key, 28 | } 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/describe_session_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct DescribeSessionResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// The current session associated with your authentication method. 20 | #[serde(rename = "session")] 21 | pub session: Box, 22 | } 23 | 24 | impl DescribeSessionResponse { 25 | pub fn new(session: models::Session) -> DescribeSessionResponse { 26 | DescribeSessionResponse { 27 | schema: None, 28 | session: Box::new(session), 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/encrypted_catalog_property.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct EncryptedCatalogProperty { 16 | #[serde(rename = "encrypted_value")] 17 | pub encrypted_value: String, 18 | #[serde(rename = "name")] 19 | pub name: String, 20 | #[serde(rename = "preview")] 21 | pub preview: String, 22 | } 23 | 24 | impl EncryptedCatalogProperty { 25 | pub fn new(encrypted_value: String, name: String, preview: String) -> EncryptedCatalogProperty { 26 | EncryptedCatalogProperty { 27 | encrypted_value, 28 | name, 29 | preview, 30 | } 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/error_detail.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct ErrorDetail { 16 | /// Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id' 17 | #[serde(rename = "location", skip_serializing_if = "Option::is_none")] 18 | pub location: Option, 19 | /// Error message text 20 | #[serde(rename = "message", skip_serializing_if = "Option::is_none")] 21 | pub message: Option, 22 | #[serde(rename = "value", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] 23 | pub value: Option>, 24 | } 25 | 26 | impl ErrorDetail { 27 | pub fn new() -> ErrorDetail { 28 | ErrorDetail { 29 | location: None, 30 | message: None, 31 | value: None, 32 | } 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/export_catalogs_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct ExportCatalogsResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "catalogs")] 20 | pub catalogs: Vec, 21 | #[serde(rename = "pages")] 22 | pub pages: Box, 23 | } 24 | 25 | impl ExportCatalogsResponse { 26 | pub fn new(catalogs: Vec, pages: models::Pagination) -> ExportCatalogsResponse { 27 | ExportCatalogsResponse { 28 | schema: None, 29 | catalogs, 30 | pages: Box::new(pages), 31 | } 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/export_secrets_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct ExportSecretsResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "pages")] 20 | pub pages: Box, 21 | #[serde(rename = "secrets")] 22 | pub secrets: Vec, 23 | } 24 | 25 | impl ExportSecretsResponse { 26 | pub fn new(pages: models::Pagination, secrets: Vec) -> ExportSecretsResponse { 27 | ExportSecretsResponse { 28 | schema: None, 29 | pages: Box::new(pages), 30 | secrets, 31 | } 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/exported_catalog.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct ExportedCatalog { 16 | #[serde(rename = "CreatedAt")] 17 | pub created_at: String, 18 | #[serde(rename = "environment")] 19 | pub environment: String, 20 | #[serde(rename = "name")] 21 | pub name: String, 22 | #[serde(rename = "properties")] 23 | pub properties: Vec, 24 | #[serde(rename = "slug")] 25 | pub slug: String, 26 | #[serde(rename = "type")] 27 | pub r#type: String, 28 | } 29 | 30 | impl ExportedCatalog { 31 | pub fn new(created_at: String, environment: String, name: String, properties: Vec, slug: String, r#type: String) -> ExportedCatalog { 32 | ExportedCatalog { 33 | created_at, 34 | environment, 35 | name, 36 | properties, 37 | slug, 38 | r#type, 39 | } 40 | } 41 | } 42 | 43 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/exported_catalog_property.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct ExportedCatalogProperty { 16 | #[serde(rename = "encrypted_value")] 17 | pub encrypted_value: String, 18 | #[serde(rename = "name")] 19 | pub name: String, 20 | #[serde(rename = "preview")] 21 | pub preview: String, 22 | } 23 | 24 | impl ExportedCatalogProperty { 25 | pub fn new(encrypted_value: String, name: String, preview: String) -> ExportedCatalogProperty { 26 | ExportedCatalogProperty { 27 | encrypted_value, 28 | name, 29 | preview, 30 | } 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/exported_secret.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct ExportedSecret { 16 | #[serde(rename = "created_at")] 17 | pub created_at: String, 18 | #[serde(rename = "encrypted_value")] 19 | pub encrypted_value: String, 20 | #[serde(rename = "environment")] 21 | pub environment: String, 22 | #[serde(rename = "name")] 23 | pub name: String, 24 | } 25 | 26 | impl ExportedSecret { 27 | pub fn new(created_at: String, encrypted_value: String, environment: String, name: String) -> ExportedSecret { 28 | ExportedSecret { 29 | created_at, 30 | encrypted_value, 31 | environment, 32 | name, 33 | } 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/generate_app_statistics_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct GenerateAppStatisticsResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "statistics")] 20 | pub statistics: Box, 21 | } 22 | 23 | impl GenerateAppStatisticsResponse { 24 | pub fn new(statistics: models::AppStatistics) -> GenerateAppStatisticsResponse { 25 | GenerateAppStatisticsResponse { 26 | schema: None, 27 | statistics: Box::new(statistics), 28 | } 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/generate_run_statistics_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct GenerateRunStatisticsResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "series")] 20 | pub series: Vec, 21 | #[serde(rename = "settings")] 22 | pub settings: Box, 23 | #[serde(rename = "stats")] 24 | pub stats: Box, 25 | } 26 | 27 | impl GenerateRunStatisticsResponse { 28 | pub fn new(series: Vec, settings: models::StatisticsSettings, stats: models::RunStatistics) -> GenerateRunStatisticsResponse { 29 | GenerateRunStatisticsResponse { 30 | schema: None, 31 | series, 32 | settings: Box::new(settings), 33 | stats: Box::new(stats), 34 | } 35 | } 36 | } 37 | 38 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/invite_team_member_params.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct InviteTeamMemberParams { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// The email addresses of the people to invite. It can be a list in any format (comma separated, newline separated, etc.) and it will be parsed into individual addresses 20 | #[serde(rename = "emails")] 21 | pub emails: String, 22 | /// Optional message to include in the invite email 23 | #[serde(rename = "message", skip_serializing_if = "Option::is_none")] 24 | pub message: Option, 25 | } 26 | 27 | impl InviteTeamMemberParams { 28 | pub fn new(emails: String) -> InviteTeamMemberParams { 29 | InviteTeamMemberParams { 30 | schema: None, 31 | emails, 32 | message: None, 33 | } 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/invite_team_member_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct InviteTeamMemberResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// The team invitation that you created 20 | #[serde(rename = "team_invitations")] 21 | pub team_invitations: Vec, 22 | } 23 | 24 | impl InviteTeamMemberResponse { 25 | pub fn new(team_invitations: Vec) -> InviteTeamMemberResponse { 26 | InviteTeamMemberResponse { 27 | schema: None, 28 | team_invitations, 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/leave_team_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct LeaveTeamResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// The team that you just left 20 | #[serde(rename = "team")] 21 | pub team: Box, 22 | } 23 | 24 | impl LeaveTeamResponse { 25 | pub fn new(team: models::Team) -> LeaveTeamResponse { 26 | LeaveTeamResponse { 27 | schema: None, 28 | team: Box::new(team), 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/list_alerts_200_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct ListAlerts200Response { 16 | } 17 | 18 | impl ListAlerts200Response { 19 | pub fn new() -> ListAlerts200Response { 20 | ListAlerts200Response { 21 | } 22 | } 23 | } 24 | 25 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/list_alerts_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct ListAlertsResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// List of alerts 20 | #[serde(rename = "alerts")] 21 | pub alerts: Vec, 22 | /// Pagination information 23 | #[serde(rename = "pages")] 24 | pub pages: Box, 25 | } 26 | 27 | impl ListAlertsResponse { 28 | pub fn new(alerts: Vec, pages: models::Pagination) -> ListAlertsResponse { 29 | ListAlertsResponse { 30 | schema: None, 31 | alerts, 32 | pages: Box::new(pages), 33 | } 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/list_api_keys_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct ListApiKeysResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// List of API keys 20 | #[serde(rename = "api_keys")] 21 | pub api_keys: Vec, 22 | } 23 | 24 | impl ListApiKeysResponse { 25 | pub fn new(api_keys: Vec) -> ListApiKeysResponse { 26 | ListApiKeysResponse { 27 | schema: None, 28 | api_keys, 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/list_app_environments_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct ListAppEnvironmentsResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "environments")] 20 | pub environments: Vec, 21 | } 22 | 23 | impl ListAppEnvironmentsResponse { 24 | pub fn new(environments: Vec) -> ListAppEnvironmentsResponse { 25 | ListAppEnvironmentsResponse { 26 | schema: None, 27 | environments, 28 | } 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/list_app_versions_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct ListAppVersionsResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "versions")] 20 | pub versions: Vec, 21 | } 22 | 23 | impl ListAppVersionsResponse { 24 | pub fn new(versions: Vec) -> ListAppVersionsResponse { 25 | ListAppVersionsResponse { 26 | schema: None, 27 | versions, 28 | } 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/list_apps_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct ListAppsResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "apps")] 20 | pub apps: Vec, 21 | #[serde(rename = "pages")] 22 | pub pages: Box, 23 | } 24 | 25 | impl ListAppsResponse { 26 | pub fn new(apps: Vec, pages: models::Pagination) -> ListAppsResponse { 27 | ListAppsResponse { 28 | schema: None, 29 | apps, 30 | pages: Box::new(pages), 31 | } 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/list_catalogs_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct ListCatalogsResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "catalogs")] 20 | pub catalogs: Vec, 21 | #[serde(rename = "pages")] 22 | pub pages: Box, 23 | } 24 | 25 | impl ListCatalogsResponse { 26 | pub fn new(catalogs: Vec, pages: models::Pagination) -> ListCatalogsResponse { 27 | ListCatalogsResponse { 28 | schema: None, 29 | catalogs, 30 | pages: Box::new(pages), 31 | } 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/list_my_team_invitations_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct ListMyTeamInvitationsResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// All of team invitations 20 | #[serde(rename = "team_invitations")] 21 | pub team_invitations: Vec, 22 | } 23 | 24 | impl ListMyTeamInvitationsResponse { 25 | pub fn new(team_invitations: Vec) -> ListMyTeamInvitationsResponse { 26 | ListMyTeamInvitationsResponse { 27 | schema: None, 28 | team_invitations, 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/list_runs_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct ListRunsResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "pages")] 20 | pub pages: Box, 21 | #[serde(rename = "runs")] 22 | pub runs: Vec, 23 | } 24 | 25 | impl ListRunsResponse { 26 | pub fn new(pages: models::Pagination, runs: Vec) -> ListRunsResponse { 27 | ListRunsResponse { 28 | schema: None, 29 | pages: Box::new(pages), 30 | runs, 31 | } 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/list_secret_environments_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct ListSecretEnvironmentsResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "environments")] 20 | pub environments: Vec, 21 | } 22 | 23 | impl ListSecretEnvironmentsResponse { 24 | pub fn new(environments: Vec) -> ListSecretEnvironmentsResponse { 25 | ListSecretEnvironmentsResponse { 26 | schema: None, 27 | environments, 28 | } 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/list_secrets_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct ListSecretsResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "pages")] 20 | pub pages: Box, 21 | #[serde(rename = "secrets")] 22 | pub secrets: Vec, 23 | } 24 | 25 | impl ListSecretsResponse { 26 | pub fn new(pages: models::Pagination, secrets: Vec) -> ListSecretsResponse { 27 | ListSecretsResponse { 28 | schema: None, 29 | pages: Box::new(pages), 30 | secrets, 31 | } 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/list_team_invitations_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct ListTeamInvitationsResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// All of team invitations 20 | #[serde(rename = "team_invitations")] 21 | pub team_invitations: Vec, 22 | } 23 | 24 | impl ListTeamInvitationsResponse { 25 | pub fn new(team_invitations: Vec) -> ListTeamInvitationsResponse { 26 | ListTeamInvitationsResponse { 27 | schema: None, 28 | team_invitations, 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/list_team_members_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct ListTeamMembersResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// All of the members of a team 20 | #[serde(rename = "team_members")] 21 | pub team_members: Vec, 22 | } 23 | 24 | impl ListTeamMembersResponse { 25 | pub fn new(team_members: Vec) -> ListTeamMembersResponse { 26 | ListTeamMembersResponse { 27 | schema: None, 28 | team_members, 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/list_teams_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct ListTeamsResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// List of teams 20 | #[serde(rename = "teams")] 21 | pub teams: Vec, 22 | } 23 | 24 | impl ListTeamsResponse { 25 | pub fn new(teams: Vec) -> ListTeamsResponse { 26 | ListTeamsResponse { 27 | schema: None, 28 | teams, 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/log_line_error.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.12 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct LogLineError { 16 | /// Contents of the error. 17 | #[serde(rename = "content")] 18 | pub content: String, 19 | /// Timestamp of the event. 20 | #[serde(rename = "reported_at")] 21 | pub reported_at: String, 22 | } 23 | 24 | impl LogLineError { 25 | pub fn new(content: String, reported_at: String) -> LogLineError { 26 | LogLineError { 27 | content, 28 | reported_at, 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/pagination.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct Pagination { 16 | #[serde(rename = "num_pages")] 17 | pub num_pages: i64, 18 | #[serde(rename = "page")] 19 | pub page: i64, 20 | #[serde(rename = "page_size")] 21 | pub page_size: i64, 22 | #[serde(rename = "total")] 23 | pub total: i64, 24 | } 25 | 26 | impl Pagination { 27 | pub fn new(num_pages: i64, page: i64, page_size: i64, total: i64) -> Pagination { 28 | Pagination { 29 | num_pages, 30 | page, 31 | page_size, 32 | total, 33 | } 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/parameter.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct Parameter { 16 | #[serde(rename = "default")] 17 | pub default: String, 18 | #[serde(rename = "description")] 19 | pub description: String, 20 | #[serde(rename = "name")] 21 | pub name: String, 22 | } 23 | 24 | impl Parameter { 25 | pub fn new(default: String, description: String, name: String) -> Parameter { 26 | Parameter { 27 | default, 28 | description, 29 | name, 30 | } 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/refresh_session_params.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct RefreshSessionParams { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | } 20 | 21 | impl RefreshSessionParams { 22 | pub fn new() -> RefreshSessionParams { 23 | RefreshSessionParams { 24 | schema: None, 25 | } 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/refresh_session_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct RefreshSessionResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// A timestamp that indicates the last time the session data was refreshed. 20 | #[serde(rename = "refreshed_at")] 21 | pub refreshed_at: String, 22 | /// Refresh the current session and return the updated session information. 23 | #[serde(rename = "session")] 24 | pub session: Box, 25 | } 26 | 27 | impl RefreshSessionResponse { 28 | pub fn new(refreshed_at: String, session: models::Session) -> RefreshSessionResponse { 29 | RefreshSessionResponse { 30 | schema: None, 31 | refreshed_at, 32 | session: Box::new(session), 33 | } 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/remove_team_member_params.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct RemoveTeamMemberParams { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// The email address of the team member to remove 20 | #[serde(rename = "email")] 21 | pub email: String, 22 | } 23 | 24 | impl RemoveTeamMemberParams { 25 | pub fn new(email: String) -> RemoveTeamMemberParams { 26 | RemoveTeamMemberParams { 27 | schema: None, 28 | email, 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/remove_team_member_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct RemoveTeamMemberResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// The team member that was just removed 20 | #[serde(rename = "team_member")] 21 | pub team_member: Box, 22 | } 23 | 24 | impl RemoveTeamMemberResponse { 25 | pub fn new(team_member: models::User) -> RemoveTeamMemberResponse { 26 | RemoveTeamMemberResponse { 27 | schema: None, 28 | team_member: Box::new(team_member), 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/resend_team_invitation_params.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct ResendTeamInvitationParams { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// The email address of team invitation to resend 20 | #[serde(rename = "email")] 21 | pub email: String, 22 | /// Optional message to include in the invite email 23 | #[serde(rename = "message", skip_serializing_if = "Option::is_none")] 24 | pub message: Option, 25 | } 26 | 27 | impl ResendTeamInvitationParams { 28 | pub fn new(email: String) -> ResendTeamInvitationParams { 29 | ResendTeamInvitationParams { 30 | schema: None, 31 | email, 32 | message: None, 33 | } 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/resend_team_invitation_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct ResendTeamInvitationResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// The team invitations that were resent 20 | #[serde(rename = "team_invitation")] 21 | pub team_invitation: Box, 22 | } 23 | 24 | impl ResendTeamInvitationResponse { 25 | pub fn new(team_invitation: models::TeamInvitation) -> ResendTeamInvitationResponse { 26 | ResendTeamInvitationResponse { 27 | schema: None, 28 | team_invitation: Box::new(team_invitation), 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/run_app_params.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct RunAppParams { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// The environment to run this app in. 20 | #[serde(rename = "environment")] 21 | pub environment: String, 22 | /// The parameters to pass into this app. 23 | #[serde(rename = "parameters")] 24 | pub parameters: std::collections::HashMap, 25 | /// The ID of the run that invoked this run, if relevant. Should be null, if none. 26 | #[serde(rename = "parent_run_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] 27 | pub parent_run_id: Option>, 28 | } 29 | 30 | impl RunAppParams { 31 | pub fn new(environment: String, parameters: std::collections::HashMap) -> RunAppParams { 32 | RunAppParams { 33 | schema: None, 34 | environment, 35 | parameters, 36 | parent_run_id: None, 37 | } 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/run_app_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct RunAppResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "run")] 20 | pub run: Box, 21 | } 22 | 23 | impl RunAppResponse { 24 | pub fn new(run: models::Run) -> RunAppResponse { 25 | RunAppResponse { 26 | schema: None, 27 | run: Box::new(run), 28 | } 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/run_failure_alert.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct RunFailureAlert { 16 | /// App that the failed Run belongs to 17 | #[serde(rename = "app")] 18 | pub app: Box, 19 | /// Run that failed 20 | #[serde(rename = "run")] 21 | pub run: Box, 22 | } 23 | 24 | impl RunFailureAlert { 25 | pub fn new(app: models::App, run: models::Run) -> RunFailureAlert { 26 | RunFailureAlert { 27 | app: Box::new(app), 28 | run: Box::new(run), 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/run_log_line.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct RunLogLine { 16 | #[serde(rename = "channel")] 17 | pub channel: String, 18 | #[serde(rename = "message")] 19 | pub message: String, 20 | #[serde(rename = "timestamp")] 21 | pub timestamp: String, 22 | } 23 | 24 | impl RunLogLine { 25 | pub fn new(channel: String, message: String, timestamp: String) -> RunLogLine { 26 | RunLogLine { 27 | channel, 28 | message, 29 | timestamp, 30 | } 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/run_parameter.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct RunParameter { 16 | #[serde(rename = "name")] 17 | pub name: String, 18 | #[serde(rename = "value")] 19 | pub value: String, 20 | } 21 | 22 | impl RunParameter { 23 | pub fn new(name: String, value: String) -> RunParameter { 24 | RunParameter { 25 | name, 26 | value, 27 | } 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/run_results.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct RunResults { 16 | #[serde(rename = "cancelled")] 17 | pub cancelled: i64, 18 | #[serde(rename = "crashed")] 19 | pub crashed: i64, 20 | #[serde(rename = "errored")] 21 | pub errored: i64, 22 | #[serde(rename = "exited")] 23 | pub exited: i64, 24 | #[serde(rename = "pending")] 25 | pub pending: i64, 26 | #[serde(rename = "running")] 27 | pub running: i64, 28 | } 29 | 30 | impl RunResults { 31 | pub fn new(cancelled: i64, crashed: i64, errored: i64, exited: i64, pending: i64, running: i64) -> RunResults { 32 | RunResults { 33 | cancelled, 34 | crashed, 35 | errored, 36 | exited, 37 | pending, 38 | running, 39 | } 40 | } 41 | } 42 | 43 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/run_statistics.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct RunStatistics { 16 | #[serde(rename = "failed_runs")] 17 | pub failed_runs: i64, 18 | #[serde(rename = "successful_runs")] 19 | pub successful_runs: i64, 20 | #[serde(rename = "total_runs")] 21 | pub total_runs: i64, 22 | } 23 | 24 | impl RunStatistics { 25 | pub fn new(failed_runs: i64, successful_runs: i64, total_runs: i64) -> RunStatistics { 26 | RunStatistics { 27 | failed_runs, 28 | successful_runs, 29 | total_runs, 30 | } 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/secret.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct Secret { 16 | #[serde(rename = "created_at")] 17 | pub created_at: String, 18 | #[serde(rename = "environment")] 19 | pub environment: String, 20 | #[serde(rename = "name")] 21 | pub name: String, 22 | #[serde(rename = "preview")] 23 | pub preview: String, 24 | } 25 | 26 | impl Secret { 27 | pub fn new(created_at: String, environment: String, name: String, preview: String) -> Secret { 28 | Secret { 29 | created_at, 30 | environment, 31 | name, 32 | preview, 33 | } 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/series_point.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct SeriesPoint { 16 | #[serde(rename = "failed")] 17 | pub failed: i64, 18 | #[serde(rename = "key")] 19 | pub key: String, 20 | #[serde(rename = "successful")] 21 | pub successful: i64, 22 | } 23 | 24 | impl SeriesPoint { 25 | pub fn new(failed: i64, key: String, successful: i64) -> SeriesPoint { 26 | SeriesPoint { 27 | failed, 28 | key, 29 | successful, 30 | } 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/session.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct Session { 16 | #[serde(rename = "teams")] 17 | pub teams: Vec, 18 | #[serde(rename = "token")] 19 | pub token: Box, 20 | #[serde(rename = "user")] 21 | pub user: Box, 22 | } 23 | 24 | impl Session { 25 | pub fn new(teams: Vec, token: models::Token, user: models::User) -> Session { 26 | Session { 27 | teams, 28 | token: Box::new(token), 29 | user: Box::new(user), 30 | } 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/sse_warning.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct SseWarning { 16 | /// Contents of the warning. 17 | #[serde(rename = "content")] 18 | pub content: String, 19 | /// Timestamp of the event. 20 | #[serde(rename = "reported_at")] 21 | pub reported_at: String, 22 | } 23 | 24 | impl SseWarning { 25 | pub fn new(content: String, reported_at: String) -> SseWarning { 26 | SseWarning { 27 | content, 28 | reported_at, 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/statistics_settings.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct StatisticsSettings { 16 | #[serde(rename = "period")] 17 | pub period: String, 18 | } 19 | 20 | impl StatisticsSettings { 21 | pub fn new(period: String) -> StatisticsSettings { 22 | StatisticsSettings { 23 | period, 24 | } 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/stream_alerts_200_response_inner.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] 15 | #[serde(untagged)] 16 | pub enum StreamAlerts200ResponseInner { 17 | RunFailureAlert(models::RunFailureAlert), 18 | SseWarning(models::SseWarning), 19 | } 20 | 21 | impl Default for StreamAlerts200ResponseInner { 22 | fn default() -> Self { 23 | Self::RunFailureAlert(Default::default()) 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/stream_run_logs_200_response_inner.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] 15 | #[serde(untagged)] 16 | pub enum StreamRunLogs200ResponseInner { 17 | SseWarning(models::SseWarning), 18 | LogLine(models::LogLine), 19 | } 20 | 21 | impl Default for StreamRunLogs200ResponseInner { 22 | fn default() -> Self { 23 | Self::SseWarning(Default::default()) 24 | } 25 | } 26 | /// The channel (either Program or Setup) this log line belongs to. 27 | #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] 28 | pub enum Channel { 29 | #[serde(rename = "program")] 30 | Program, 31 | #[serde(rename = "setup")] 32 | Setup, 33 | } 34 | 35 | impl Default for Channel { 36 | fn default() -> Channel { 37 | Self::Program 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/team.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct Team { 16 | #[serde(rename = "name")] 17 | pub name: String, 18 | #[serde(rename = "slug")] 19 | pub slug: String, 20 | #[serde(rename = "token", skip_serializing_if = "Option::is_none")] 21 | pub token: Option>, 22 | /// The type of team, either 'personal' or 'team'. 23 | #[serde(rename = "type")] 24 | pub r#type: String, 25 | } 26 | 27 | impl Team { 28 | pub fn new(name: String, slug: String, r#type: String) -> Team { 29 | Team { 30 | name, 31 | slug, 32 | token: None, 33 | r#type, 34 | } 35 | } 36 | } 37 | 38 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/team_invitation.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct TeamInvitation { 16 | #[serde(rename = "email")] 17 | pub email: String, 18 | #[serde(rename = "invitation_sent_at")] 19 | pub invitation_sent_at: String, 20 | #[serde(rename = "team")] 21 | pub team: Box, 22 | } 23 | 24 | impl TeamInvitation { 25 | pub fn new(email: String, invitation_sent_at: String, team: models::Team) -> TeamInvitation { 26 | TeamInvitation { 27 | email, 28 | invitation_sent_at, 29 | team: Box::new(team), 30 | } 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/token.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct Token { 16 | #[serde(rename = "jwt")] 17 | pub jwt: String, 18 | } 19 | 20 | impl Token { 21 | pub fn new(jwt: String) -> Token { 22 | Token { 23 | jwt, 24 | } 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/update_account_slug_params.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct UpdateAccountSlugParams { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// The new slug for the account 20 | #[serde(rename = "new_slug")] 21 | pub new_slug: String, 22 | } 23 | 24 | impl UpdateAccountSlugParams { 25 | pub fn new(new_slug: String) -> UpdateAccountSlugParams { 26 | UpdateAccountSlugParams { 27 | schema: None, 28 | new_slug, 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/update_account_slug_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct UpdateAccountSlugResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "account")] 20 | pub account: Box, 21 | } 22 | 23 | impl UpdateAccountSlugResponse { 24 | pub fn new(account: models::Account) -> UpdateAccountSlugResponse { 25 | UpdateAccountSlugResponse { 26 | schema: None, 27 | account: Box::new(account), 28 | } 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/update_app_params.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct UpdateAppParams { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// New description for the App 20 | #[serde(rename = "description")] 21 | pub description: String, 22 | /// New status for the App 23 | #[serde(rename = "status")] 24 | pub status: String, 25 | } 26 | 27 | impl UpdateAppParams { 28 | pub fn new(description: String, status: String) -> UpdateAppParams { 29 | UpdateAppParams { 30 | schema: None, 31 | description, 32 | status, 33 | } 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/update_app_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct UpdateAppResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "App")] 20 | pub app: Box, 21 | } 22 | 23 | impl UpdateAppResponse { 24 | pub fn new(app: models::App) -> UpdateAppResponse { 25 | UpdateAppResponse { 26 | schema: None, 27 | app: Box::new(app), 28 | } 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/update_catalog_params.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct UpdateCatalogParams { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// New environment for the catalog 20 | #[serde(rename = "environment")] 21 | pub environment: String, 22 | /// New name for the catalog 23 | #[serde(rename = "name")] 24 | pub name: String, 25 | #[serde(rename = "properties")] 26 | pub properties: Vec, 27 | } 28 | 29 | impl UpdateCatalogParams { 30 | pub fn new(environment: String, name: String, properties: Vec) -> UpdateCatalogParams { 31 | UpdateCatalogParams { 32 | schema: None, 33 | environment, 34 | name, 35 | properties, 36 | } 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/update_catalog_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct UpdateCatalogResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "catalog")] 20 | pub catalog: Box, 21 | } 22 | 23 | impl UpdateCatalogResponse { 24 | pub fn new(catalog: models::Catalog) -> UpdateCatalogResponse { 25 | UpdateCatalogResponse { 26 | schema: None, 27 | catalog: Box::new(catalog), 28 | } 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/update_my_team_invitation_params.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct UpdateMyTeamInvitationParams { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// Whether or not the invitation was accepted. If false, it's considered rejected. 20 | #[serde(rename = "accepted")] 21 | pub accepted: bool, 22 | /// The slug of the team invitation to update 23 | #[serde(rename = "slug")] 24 | pub slug: String, 25 | } 26 | 27 | impl UpdateMyTeamInvitationParams { 28 | pub fn new(accepted: bool, slug: String) -> UpdateMyTeamInvitationParams { 29 | UpdateMyTeamInvitationParams { 30 | schema: None, 31 | accepted, 32 | slug, 33 | } 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/update_my_team_invitation_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct UpdateMyTeamInvitationResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | } 20 | 21 | impl UpdateMyTeamInvitationResponse { 22 | pub fn new() -> UpdateMyTeamInvitationResponse { 23 | UpdateMyTeamInvitationResponse { 24 | schema: None, 25 | } 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/update_password_reset_params.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct UpdatePasswordResetParams { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// The new password that you want to set for your account 20 | #[serde(rename = "password")] 21 | pub password: String, 22 | } 23 | 24 | impl UpdatePasswordResetParams { 25 | pub fn new(password: String) -> UpdatePasswordResetParams { 26 | UpdatePasswordResetParams { 27 | schema: None, 28 | password, 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/update_password_reset_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct UpdatePasswordResetResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// A boolean indicating the request was successfully processed. 20 | #[serde(rename = "ok")] 21 | pub ok: bool, 22 | } 23 | 24 | impl UpdatePasswordResetResponse { 25 | pub fn new(ok: bool) -> UpdatePasswordResetResponse { 26 | UpdatePasswordResetResponse { 27 | schema: None, 28 | ok, 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/update_secret_params.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct UpdateSecretParams { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "encrypted_value")] 20 | pub encrypted_value: String, 21 | #[serde(rename = "environment")] 22 | pub environment: String, 23 | #[serde(rename = "preview")] 24 | pub preview: String, 25 | } 26 | 27 | impl UpdateSecretParams { 28 | pub fn new(encrypted_value: String, environment: String, preview: String) -> UpdateSecretParams { 29 | UpdateSecretParams { 30 | schema: None, 31 | encrypted_value, 32 | environment, 33 | preview, 34 | } 35 | } 36 | } 37 | 38 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/update_secret_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct UpdateSecretResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "secret")] 20 | pub secret: Box, 21 | } 22 | 23 | impl UpdateSecretResponse { 24 | pub fn new(secret: models::Secret) -> UpdateSecretResponse { 25 | UpdateSecretResponse { 26 | schema: None, 27 | secret: Box::new(secret), 28 | } 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/update_team_params.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct UpdateTeamParams { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// The name of the team to create. This is optional, if you supply null it will not update the team name. 20 | #[serde(rename = "name", deserialize_with = "Option::deserialize")] 21 | pub name: Option, 22 | /// The new slug that you want the team to use. This is optional, if you supply null it will not update the slug. 23 | #[serde(rename = "slug", deserialize_with = "Option::deserialize")] 24 | pub slug: Option, 25 | } 26 | 27 | impl UpdateTeamParams { 28 | pub fn new(name: Option, slug: Option) -> UpdateTeamParams { 29 | UpdateTeamParams { 30 | schema: None, 31 | name, 32 | slug, 33 | } 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/update_team_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct UpdateTeamResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | /// The team that was just created 20 | #[serde(rename = "team")] 21 | pub team: Box, 22 | } 23 | 24 | impl UpdateTeamResponse { 25 | pub fn new(team: models::Team) -> UpdateTeamResponse { 26 | UpdateTeamResponse { 27 | schema: None, 28 | team: Box::new(team), 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /crates/tower-api/src/models/update_user_response.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tower API 3 | * 4 | * REST API to interact with Tower Services. 5 | * 6 | * The version of the OpenAPI document: v0.5.23 7 | * Contact: hello@tower.dev 8 | * Generated by: https://openapi-generator.tech 9 | */ 10 | 11 | use crate::models; 12 | use serde::{Deserialize, Serialize}; 13 | 14 | #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct UpdateUserResponse { 16 | /// A URL to the JSON Schema for this object. 17 | #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] 18 | pub schema: Option, 19 | #[serde(rename = "user")] 20 | pub user: Box, 21 | } 22 | 23 | impl UpdateUserResponse { 24 | pub fn new(user: models::User) -> UpdateUserResponse { 25 | UpdateUserResponse { 26 | schema: None, 27 | user: Box::new(user), 28 | } 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /crates/tower-cmd/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "tower-cmd" 3 | version = { workspace = true } 4 | edition = "2021" 5 | 6 | [dependencies] 7 | anyhow = { workspace = true } 8 | bytes = { workspace = true } 9 | chrono = { workspace = true } 10 | clap = { workspace = true } 11 | cli-table = { workspace = true } 12 | colored = { workspace = true } 13 | config = { workspace = true } 14 | crypto = { workspace = true } 15 | futures-util = { workspace = true } 16 | http = { workspace = true } 17 | indicatif = { workspace = true } 18 | log = { workspace = true } 19 | promptly = { workspace = true } 20 | reqwest = { workspace = true } 21 | rpassword = { workspace = true } 22 | rsa = { workspace = true } 23 | serde = { workspace = true } 24 | serde_json = { workspace = true } 25 | simple_logger = { workspace = true } 26 | snafu = { workspace = true } 27 | spinners = { workspace = true } 28 | tokio = { workspace = true } 29 | tokio-util = { workspace = true } 30 | tower-api = { workspace = true } 31 | tower-package = { workspace = true } 32 | tower-runtime = { workspace = true } 33 | tower-version = { path = "../tower-version" } 34 | webbrowser = { workspace = true } 35 | -------------------------------------------------------------------------------- /crates/tower-cmd/src/banner.txt: -------------------------------------------------------------------------------- 1 | _____ _____ _____ ___ 2 | |_ _/ _ \ \ / / __| _ \ 3 | | || (_) \ \/\/ /| _|| / 4 | |_| \___/ \_/\_/ |___|_|_\ 5 | 6 | -------------------------------------------------------------------------------- /crates/tower-cmd/src/error.rs: -------------------------------------------------------------------------------- 1 | use snafu::prelude::*; 2 | 3 | #[derive(Debug, Snafu)] 4 | pub enum Error { 5 | #[snafu(display("fetching catalogs failed"))] 6 | FetchingCatalogsFailed, 7 | 8 | #[snafu(display("fetching secrets failed"))] 9 | FetchingSecretsFailed, 10 | 11 | #[snafu(display("cryptography error"))] 12 | CryptographyError, 13 | } 14 | 15 | impl From for Error { 16 | fn from(err: crypto::Error) -> Self { 17 | log::debug!("cryptography error: {:?}", err); 18 | Self::CryptographyError 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /crates/tower-cmd/src/util/cmd.rs: -------------------------------------------------------------------------------- 1 | use crate::output; 2 | use clap::ArgMatches; 3 | 4 | pub fn get_string_flag(args: &ArgMatches, name: &str) -> String { 5 | args.get_one::(name) 6 | .unwrap_or_else(|| { 7 | output::die(&format!("{} is required", name)); 8 | }) 9 | .to_string() 10 | } 11 | 12 | pub fn get_bool_flag(args: &ArgMatches, name: &str) -> bool { 13 | args.get_one::(name) 14 | .unwrap_or_else(|| { 15 | output::die(&format!("{} is required", name)); 16 | }) 17 | .to_owned() 18 | } 19 | -------------------------------------------------------------------------------- /crates/tower-cmd/src/util/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod apps; 2 | pub mod deploy; 3 | pub mod progress; 4 | pub mod cmd; 5 | -------------------------------------------------------------------------------- /crates/tower-cmd/src/util/progress.rs: -------------------------------------------------------------------------------- 1 | use futures_util::stream::Stream; 2 | use std::sync::{Arc, Mutex}; 3 | use std::{ 4 | pin::Pin, 5 | task::{Context, Poll}, 6 | }; 7 | 8 | pub struct ProgressStream { 9 | inner: R, 10 | progress: Arc>, 11 | progress_cb: Box, 12 | total_size: u64, 13 | } 14 | 15 | impl ProgressStream { 16 | pub async fn new( 17 | inner: R, 18 | total_size: u64, 19 | progress_cb: Box, 20 | ) -> Result { 21 | Ok(Self { 22 | inner, 23 | progress_cb, 24 | progress: Arc::new(Mutex::new(0)), 25 | total_size, 26 | }) 27 | } 28 | } 29 | 30 | impl> + Unpin> Stream for ProgressStream { 31 | type Item = Result; 32 | 33 | fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { 34 | match Pin::new(&mut self.inner).poll_next(cx) { 35 | Poll::Ready(Some(Ok(chunk))) => { 36 | let chunk_size = chunk.len() as u64; 37 | let mut progress = self.progress.lock().unwrap(); 38 | *progress += chunk_size; 39 | (self.progress_cb)(*progress, self.total_size); 40 | Poll::Ready(Some(Ok(chunk))) 41 | } 42 | other => other, 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /crates/tower-cmd/src/version.rs: -------------------------------------------------------------------------------- 1 | use clap::Command; 2 | use crate::output; 3 | 4 | pub fn version_cmd() -> Command { 5 | Command::new("version") 6 | .about("Print the current version of Tower") 7 | } 8 | 9 | pub async fn do_version() { 10 | let line = format!("v{}\n", tower_version::current_version()); 11 | output::write(&line); 12 | } 13 | -------------------------------------------------------------------------------- /crates/tower-package/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "tower-package" 3 | version = { workspace = true } 4 | authors = { workspace = true } 5 | edition = { workspace = true } 6 | rust-version = { workspace = true } 7 | license = { workspace = true } 8 | 9 | [dependencies] 10 | async-compression = { workspace = true } 11 | config = { workspace = true } 12 | glob = { workspace = true } 13 | log = { workspace = true } 14 | serde = { workspace = true } 15 | serde_json = { workspace = true } 16 | snafu = { workspace = true } 17 | tmpdir = { workspace = true } 18 | tokio = { workspace = true } 19 | tokio-stream = { workspace = true } 20 | tokio-tar = { workspace = true } 21 | tokio-util = { workspace = true } 22 | 23 | [dev-dependencies] 24 | env_logger = { workspace = true } 25 | -------------------------------------------------------------------------------- /crates/tower-package/src/error.rs: -------------------------------------------------------------------------------- 1 | use snafu::prelude::*; 2 | 3 | #[derive(Debug, Snafu)] 4 | pub enum Error { 5 | #[snafu(display("No manifest found"))] 6 | NoManifest, 7 | 8 | #[snafu(display("Invalid manifest"))] 9 | InvalidManifest, 10 | 11 | #[snafu(display("Invalid path"))] 12 | InvalidPath, 13 | } 14 | 15 | impl From for Error { 16 | fn from(err: std::io::Error) -> Self { 17 | log::debug!("IO error: {}", err); 18 | Error::NoManifest 19 | } 20 | } 21 | 22 | impl From for Error { 23 | fn from(err: serde_json::Error) -> Self { 24 | log::debug!("JSON error: {}", err); 25 | Error::InvalidManifest 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /crates/tower-runtime/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "tower-runtime" 3 | version = { workspace = true } 4 | authors = { workspace = true } 5 | edition = { workspace = true } 6 | rust-version = { workspace = true } 7 | license = { workspace = true } 8 | 9 | [dependencies] 10 | chrono = { workspace = true } 11 | tokio = { workspace = true } 12 | log = { workspace = true } 13 | snafu = { workspace = true } 14 | tower-package = { workspace = true } 15 | -------------------------------------------------------------------------------- /crates/tower-telemetry/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "tower-telemetry" 3 | version = { workspace = true } 4 | authors = { workspace = true } 5 | edition = { workspace = true } 6 | rust-version = { workspace = true } 7 | license = { workspace = true } 8 | 9 | [dependencies] 10 | log = { workspace = true } 11 | -------------------------------------------------------------------------------- /crates/tower-telemetry/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod logging; 2 | pub use logging::RunContext; 3 | -------------------------------------------------------------------------------- /crates/tower-telemetry/src/logging.rs: -------------------------------------------------------------------------------- 1 | use log::kv::{Key, Value}; 2 | 3 | pub struct RunContext { 4 | run_id: String, 5 | } 6 | 7 | impl log::kv::ToValue for RunContext { 8 | fn to_value(&self) -> Value { 9 | Value::from(self.run_id.as_str()) 10 | } 11 | } 12 | 13 | impl log::kv::ToKey for RunContext { 14 | fn to_key(&self) -> Key { 15 | Key::from("tower.run_id") 16 | } 17 | } 18 | 19 | impl RunContext { 20 | pub fn new(run_id: String) -> Self { 21 | Self { run_id } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /crates/tower-version/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "tower-version" 3 | edition.workspace = true 4 | version.workspace = true 5 | description.workspace = true 6 | rust-version.workspace = true 7 | authors.workspace = true 8 | license.workspace = true 9 | repository.workspace = true 10 | 11 | [dependencies] 12 | anyhow = { workspace = true } 13 | chrono = { workspace = true } 14 | config = { workspace = true } 15 | log = { workspace = true } 16 | reqwest = { workspace = true } 17 | serde_json = { workspace = true } 18 | -------------------------------------------------------------------------------- /crates/tower-version/src/lib.rs: -------------------------------------------------------------------------------- 1 | use anyhow::Result; 2 | use log; 3 | use reqwest; 4 | use serde_json::Value; 5 | use chrono::{Utc, Duration}; 6 | 7 | pub fn current_version() -> &'static str { 8 | env!("CARGO_PKG_VERSION") 9 | } 10 | 11 | pub async fn should_check_latest_version() -> bool { 12 | let dt = config::get_last_version_check_timestamp(); 13 | let window = Utc::now() - Duration::minutes(5); 14 | 15 | // If we haven't checked in the last 5 minutes, then we should check. 16 | dt < window 17 | } 18 | 19 | pub async fn check_latest_version() -> Result> { 20 | let client = reqwest::Client::new(); 21 | let pypi_url = std::env::var("TOWER_PYPI_URL") 22 | .unwrap_or_else(|_| "https://pypi.org".to_string()); 23 | let url = format!("{}/pypi/tower/json", pypi_url); 24 | 25 | let resp = client 26 | .get(url) 27 | .send() 28 | .await?; 29 | 30 | let status = resp.status(); 31 | log::debug!("PyPI returned status code: {}", status); 32 | 33 | if status.is_success() { 34 | // Update the config so we don't check more often. 35 | config::set_last_version_check_timestamp(Utc::now()); 36 | 37 | let json: Value = resp.json().await?; 38 | if let Some(version) = json.get("info") 39 | .and_then(|info| info.get("version")) 40 | .and_then(|v| v.as_str()) { 41 | return Ok(Some(version.to_string())); 42 | } 43 | } 44 | Ok(None) 45 | } 46 | -------------------------------------------------------------------------------- /crates/tower/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "tower" 3 | publish = true 4 | version = { workspace = true } 5 | authors = { workspace = true } 6 | edition = { workspace = true } 7 | rust-version = { workspace = true } 8 | license = { workspace = true } 9 | repository = { workspace = true } 10 | default-run = "tower" 11 | 12 | [package.metadata.wix] 13 | upgrade-guid = "327A8111-21DA-4EEB-8BD2-F24C437C071A" 14 | path-guid = "CB5E6AA5-5ACF-4A2A-963E-CB9EE1769979" 15 | license = false 16 | eula = false 17 | 18 | [dependencies] 19 | tokio = { workspace = true } 20 | tower-cmd = { workspace = true } 21 | tower-api = { workspace = true } 22 | 23 | [[bin]] 24 | name = "tower" 25 | path = "src/main.rs" 26 | -------------------------------------------------------------------------------- /crates/tower/src/main.rs: -------------------------------------------------------------------------------- 1 | use tower_cmd::App; 2 | 3 | #[tokio::main] 4 | async fn main() { 5 | App::new().run().await; 6 | } 7 | -------------------------------------------------------------------------------- /dist-workspace.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | members = ["cargo:."] 3 | 4 | # Config for 'dist' 5 | [dist] 6 | # The preferred dist version to use in CI (Cargo.toml SemVer syntax) 7 | cargo-dist-version = "0.28.5" 8 | # CI backends to support 9 | ci = "github" 10 | # The installers to generate for each app 11 | installers = ["shell", "homebrew", "msi"] 12 | # A GitHub repo to push Homebrew formulas to 13 | tap = "tower/tower-cli" 14 | # Target platforms to build apps for (Rust target-triple syntax) 15 | targets = ["aarch64-apple-darwin", "aarch64-unknown-linux-gnu", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl"] 16 | # Path that installers should place binaries in 17 | install-path = "CARGO_HOME" 18 | # Publish jobs to run in CI 19 | publish-jobs = ["./publish-pypi"] 20 | # Whether to install an updater program 21 | install-updater = false 22 | # Whether dist should create a Github Release or use an existing draft 23 | create-release = true 24 | # Which actions to run on pull requests 25 | pr-run-mode = "skip" 26 | # Local artifacts jobs to run in CI 27 | local-artifacts-jobs = ["./build-binaries"] 28 | # Whether to publish prereleases to package managers 29 | publish-prereleases = true 30 | 31 | [dist.github-custom-runners] 32 | global = "ubuntu-22.04" 33 | 34 | [dist.github-custom-runners.x86_64-unknown-linux-gnu] 35 | runner = "ubuntu-latest" 36 | 37 | [dist.github-custom-runners.aarch64-unknown-linux-gnu] 38 | runner = "ubuntu-latest" 39 | -------------------------------------------------------------------------------- /rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | channel = "1.81" 3 | -------------------------------------------------------------------------------- /scripts/generate-python-api-client.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # This script generates the Python API client using the OpenAPI specification. 4 | # 5 | 6 | TOWER_OPENAPI_URL="https://api.tower.dev/v1/openapi-3.0.yaml" 7 | OUTPUT_DIR="src/tower" 8 | 9 | # We have to remove the previously-generated source in case some things were 10 | # removed, etc. 11 | rm -rf ${OUTPUT_DIR}/tower_api_client 12 | 13 | cd ${OUTPUT_DIR} && uv run openapi-python-client generate --meta none \ 14 | --url ${TOWER_OPENAPI_URL} 15 | -------------------------------------------------------------------------------- /scripts/rust-api-client-generator-config.yaml: -------------------------------------------------------------------------------- 1 | # Generator Configuration 2 | generatorName: rust 3 | inputSpec: openapi.json 4 | outputDir: ../crates/tower-api 5 | httpUserAgent: "Tower CLI" 6 | templateDir: rust-client-templates 7 | nameMappings: 8 | $schema: schema 9 | 10 | globalProperties: 11 | modelDocs: false 12 | apiDocs: false 13 | 14 | additionalProperties: 15 | packageName: tower-api 16 | packageVersion: "1.0.0" 17 | # Rust client options 18 | supportAsync: true 19 | supportMultipleResponses: true 20 | useSingleRequestParameter: true 21 | generateOptionalConstructor: true 22 | library: reqwest 23 | bestFitInt: true 24 | dateLibrary: chrono 25 | useRustLogging: true 26 | rustfmt: true 27 | -------------------------------------------------------------------------------- /scripts/rust-client-templates/.travis.yml: -------------------------------------------------------------------------------- 1 | language: rust 2 | -------------------------------------------------------------------------------- /scripts/rust-client-templates/gitignore.mustache: -------------------------------------------------------------------------------- 1 | /target/ 2 | **/*.rs.bk 3 | Cargo.lock 4 | -------------------------------------------------------------------------------- /scripts/rust-client-templates/hyper/client.mustache: -------------------------------------------------------------------------------- 1 | use std::sync::Arc; 2 | 3 | use hyper; 4 | use hyper_util::client::legacy::connect::Connect; 5 | use super::configuration::Configuration; 6 | 7 | pub struct APIClient { 8 | {{#apiInfo}} 9 | {{#apis}} 10 | {{#operations}} 11 | {{#operation}} 12 | {{#-last}} 13 | {{{classFilename}}}: Box, 14 | {{/-last}} 15 | {{/operation}} 16 | {{/operations}} 17 | {{/apis}} 18 | {{/apiInfo}} 19 | } 20 | 21 | impl APIClient { 22 | pub fn new(configuration: Configuration) -> APIClient 23 | where C: Clone + std::marker::Send + Sync + 'static { 24 | let rc = Arc::new(configuration); 25 | 26 | APIClient { 27 | {{#apiInfo}} 28 | {{#apis}} 29 | {{#operations}} 30 | {{#operation}} 31 | {{#-last}} 32 | {{{classFilename}}}: Box::new(crate::apis::{{{classname}}}Client::new(rc.clone())), 33 | {{/-last}} 34 | {{/operation}} 35 | {{/operations}} 36 | {{/apis}} 37 | {{/apiInfo}} 38 | } 39 | } 40 | 41 | {{#apiInfo}} 42 | {{#apis}} 43 | {{#operations}} 44 | {{#operation}} 45 | {{#-last}} 46 | pub fn {{{classFilename}}}(&self) -> &dyn crate::apis::{{{classname}}}{ 47 | self.{{{classFilename}}}.as_ref() 48 | } 49 | 50 | {{/-last}} 51 | {{/operation}} 52 | {{/operations}} 53 | {{/apis}} 54 | {{/apiInfo}} 55 | } 56 | -------------------------------------------------------------------------------- /scripts/rust-client-templates/hyper0x/api_mod.mustache: -------------------------------------------------------------------------------- 1 | use http; 2 | use hyper; 3 | use serde_json; 4 | 5 | #[derive(Debug)] 6 | pub enum Error { 7 | Api(ApiError), 8 | Header(hyper::http::header::InvalidHeaderValue), 9 | Http(http::Error), 10 | Hyper(hyper::Error), 11 | Serde(serde_json::Error), 12 | UriError(http::uri::InvalidUri), 13 | } 14 | 15 | #[derive(Debug)] 16 | pub struct ApiError { 17 | pub code: hyper::StatusCode, 18 | pub body: hyper::body::Body, 19 | } 20 | 21 | impl From<(hyper::StatusCode, hyper::body::Body)> for Error { 22 | fn from(e: (hyper::StatusCode, hyper::body::Body)) -> Self { 23 | Error::Api(ApiError { 24 | code: e.0, 25 | body: e.1, 26 | }) 27 | } 28 | } 29 | 30 | impl From for Error { 31 | fn from(e: http::Error) -> Self { 32 | Error::Http(e) 33 | } 34 | } 35 | 36 | impl From for Error { 37 | fn from(e: hyper::Error) -> Self { 38 | Error::Hyper(e) 39 | } 40 | } 41 | 42 | impl From for Error { 43 | fn from(e: serde_json::Error) -> Self { 44 | Error::Serde(e) 45 | } 46 | } 47 | 48 | mod request; 49 | 50 | {{#apiInfo}} 51 | {{#apis}} 52 | mod {{{classFilename}}}; 53 | {{#operations}} 54 | {{#operation}} 55 | {{#-last}} 56 | pub use self::{{{classFilename}}}::{ {{{classname}}}, {{{classname}}}Client }; 57 | {{/-last}} 58 | {{/operation}} 59 | {{/operations}} 60 | {{/apis}} 61 | {{/apiInfo}} 62 | 63 | pub mod configuration; 64 | pub mod client; 65 | -------------------------------------------------------------------------------- /scripts/rust-client-templates/hyper0x/client.mustache: -------------------------------------------------------------------------------- 1 | use std::rc::Rc; 2 | 3 | use hyper; 4 | use super::configuration::Configuration; 5 | 6 | pub struct APIClient { 7 | {{#apiInfo}} 8 | {{#apis}} 9 | {{#operations}} 10 | {{#operation}} 11 | {{#-last}} 12 | {{{classFilename}}}: Box, 13 | {{/-last}} 14 | {{/operation}} 15 | {{/operations}} 16 | {{/apis}} 17 | {{/apiInfo}} 18 | } 19 | 20 | impl APIClient { 21 | pub fn new(configuration: Configuration) -> APIClient 22 | where C: Clone + std::marker::Send + Sync + 'static { 23 | let rc = Rc::new(configuration); 24 | 25 | APIClient { 26 | {{#apiInfo}} 27 | {{#apis}} 28 | {{#operations}} 29 | {{#operation}} 30 | {{#-last}} 31 | {{{classFilename}}}: Box::new(crate::apis::{{{classname}}}Client::new(rc.clone())), 32 | {{/-last}} 33 | {{/operation}} 34 | {{/operations}} 35 | {{/apis}} 36 | {{/apiInfo}} 37 | } 38 | } 39 | 40 | {{#apiInfo}} 41 | {{#apis}} 42 | {{#operations}} 43 | {{#operation}} 44 | {{#-last}} 45 | pub fn {{{classFilename}}}(&self) -> &dyn crate::apis::{{{classname}}}{ 46 | self.{{{classFilename}}}.as_ref() 47 | } 48 | 49 | {{/-last}} 50 | {{/operation}} 51 | {{/operations}} 52 | {{/apis}} 53 | {{/apiInfo}} 54 | } 55 | -------------------------------------------------------------------------------- /scripts/rust-client-templates/hyper0x/configuration.mustache: -------------------------------------------------------------------------------- 1 | {{>partial_header}} 2 | use hyper; 3 | 4 | pub struct Configuration 5 | where C: Clone + std::marker::Send + Sync + 'static { 6 | pub base_path: String, 7 | pub user_agent: Option, 8 | pub client: hyper::client::Client, 9 | pub basic_auth: Option, 10 | pub oauth_access_token: Option, 11 | pub api_key: Option, 12 | // TODO: take an oauth2 token source, similar to the go one 13 | } 14 | 15 | pub type BasicAuth = (String, Option); 16 | 17 | pub struct ApiKey { 18 | pub prefix: Option, 19 | pub key: String, 20 | } 21 | 22 | impl Configuration 23 | where C: Clone + std::marker::Send + Sync { 24 | pub fn new(client: hyper::client::Client) -> Configuration { 25 | Configuration { 26 | base_path: "{{{basePath}}}".to_owned(), 27 | user_agent: {{#httpUserAgent}}Some("{{{.}}}".to_owned()){{/httpUserAgent}}{{^httpUserAgent}}Some("OpenAPI-Generator/{{{version}}}/rust".to_owned()){{/httpUserAgent}}, 28 | client, 29 | basic_auth: None, 30 | oauth_access_token: None, 31 | api_key: None, 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /scripts/rust-client-templates/lib.mustache: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::too_many_arguments)] 3 | 4 | extern crate serde_repr; 5 | extern crate serde; 6 | extern crate serde_json; 7 | extern crate url; 8 | {{#hyper}} 9 | extern crate hyper; 10 | extern crate futures; 11 | {{/hyper}} 12 | {{#reqwest}} 13 | extern crate reqwest; 14 | {{/reqwest}} 15 | 16 | pub mod apis; 17 | pub mod models; 18 | -------------------------------------------------------------------------------- /scripts/rust-client-templates/model_mod.mustache: -------------------------------------------------------------------------------- 1 | {{#models}} 2 | {{#model}} 3 | pub mod {{{classFilename}}}; 4 | pub use self::{{{classFilename}}}::{{{classname}}}; 5 | {{/model}} 6 | {{/models}} 7 | {{#serdeAsDoubleOption}} 8 | use serde::{Deserialize, Deserializer, Serializer}; 9 | use serde_with::{de::DeserializeAsWrap, ser::SerializeAsWrap, DeserializeAs, SerializeAs}; 10 | use std::marker::PhantomData; 11 | 12 | pub(crate) struct DoubleOption(PhantomData); 13 | 14 | impl SerializeAs>> for DoubleOption 15 | where 16 | TAs: SerializeAs, 17 | { 18 | fn serialize_as(values: &Option>, serializer: S) -> Result 19 | where 20 | S: Serializer, 21 | { 22 | match values { 23 | None => serializer.serialize_unit(), 24 | Some(None) => serializer.serialize_none(), 25 | Some(Some(v)) => serializer.serialize_some(&SerializeAsWrap::::new(v)), 26 | } 27 | } 28 | } 29 | 30 | impl<'de, T, TAs> DeserializeAs<'de, Option>> for DoubleOption 31 | where 32 | TAs: DeserializeAs<'de, T>, 33 | T: std::fmt::Debug, 34 | { 35 | fn deserialize_as(deserializer: D) -> Result>, D::Error> 36 | where 37 | D: Deserializer<'de>, 38 | { 39 | Ok(Some( 40 | DeserializeAsWrap::, Option>::deserialize(deserializer)? 41 | .into_inner(), 42 | )) 43 | } 44 | } 45 | {{/serdeAsDoubleOption}} -------------------------------------------------------------------------------- /scripts/rust-client-templates/partial_header.mustache: -------------------------------------------------------------------------------- 1 | /* 2 | {{#appName}} 3 | * {{{.}}} 4 | * 5 | {{/appName}} 6 | {{#appDescription}} 7 | * {{{.}}} 8 | * 9 | {{/appDescription}} 10 | * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} 11 | * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} 12 | * Generated by: https://openapi-generator.tech 13 | */ 14 | -------------------------------------------------------------------------------- /src/tower/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Tower: A compute platform for modern data projects. 3 | 4 | This package provides tools for interacting with the Tower platform, 5 | including running apps locally or in the Tower cloud. 6 | 7 | Optional features: 8 | - AI/LLM support: Install with `pip install "tower[ai]"` 9 | - Apache Iceberg support: Install with `pip install "tower[iceberg]"` 10 | - All features: Install with `pip install "tower[all]"` 11 | """ 12 | 13 | from ._client import ( 14 | run_app, 15 | wait_for_run, 16 | wait_for_runs, 17 | ) 18 | 19 | from ._features import override_get_attr, get_available_features, is_feature_enabled 20 | 21 | 22 | def __getattr__(name: str) -> any: 23 | """ 24 | Dynamic attribute lookup for optional features. 25 | 26 | This allows Tower to lazily load optional dependencies only when 27 | their features are actually used. 28 | """ 29 | return override_get_attr(name) 30 | -------------------------------------------------------------------------------- /src/tower/__main__.py: -------------------------------------------------------------------------------- 1 | import io 2 | import sys 3 | 4 | _CLEAN_GLOBALS = globals().copy() 5 | 6 | 7 | def run_program(filename): 8 | ns = dict( 9 | _CLEAN_GLOBALS, 10 | # Make sure the __file__ variable is usable 11 | # by the script we're profiling 12 | __file__=filename, 13 | ) 14 | 15 | with io.open(filename, encoding="utf-8") as f: 16 | exec(compile(f.read(), filename, "exec"), ns, ns) 17 | 18 | 19 | def parse_args(): 20 | from argparse import REMAINDER, ArgumentParser 21 | 22 | parser = ArgumentParser() 23 | parser.add_argument( 24 | "program", 25 | nargs=REMAINDER, 26 | help="python script or module followed by command line arguments to run", 27 | ) 28 | return parser.parse_args() 29 | 30 | 31 | if __name__ == "__main__": 32 | args = parse_args() 33 | 34 | if len(args.program) == 0: 35 | print("A program to run must be provided. Use -h for help") 36 | sys.exit(1) 37 | 38 | run_program(args.program[0]) 39 | -------------------------------------------------------------------------------- /src/tower/_context.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | class TowerContext: 4 | def __init__(self, tower_url: str, environment: str, api_key: str = None, hugging_face_provider: str = None, hugging_face_api_key: str = None): 5 | self.tower_url = tower_url 6 | self.environment = environment 7 | self.api_key = api_key 8 | self.hugging_face_provider = hugging_face_provider 9 | self.hugging_face_api_key = hugging_face_api_key 10 | 11 | def is_local(self) -> bool: 12 | if self.environment is None or self.environment == "": 13 | return True 14 | elif self.environment == "local": 15 | return True 16 | else: 17 | return False 18 | 19 | @classmethod 20 | def build(cls): 21 | tower_url = os.getenv("TOWER_URL") 22 | tower_environment = os.getenv("TOWER_ENVIRONMENT") 23 | tower_api_key = os.getenv("TOWER_API_KEY") 24 | hugging_face_provider = os.getenv("TOWER_HUGGING_FACE_PROVIDER") 25 | hugging_face_api_key = os.getenv("TOWER_HUGGING_FACE_API_KEY") 26 | 27 | return cls( 28 | tower_url = tower_url, 29 | environment = tower_environment, 30 | api_key = tower_api_key, 31 | hugging_face_provider = hugging_face_provider, 32 | hugging_face_api_key = hugging_face_api_key, 33 | ) 34 | 35 | -------------------------------------------------------------------------------- /src/tower/exceptions.py: -------------------------------------------------------------------------------- 1 | class NotFoundException(Exception): 2 | def __init__(self, message: str): 3 | super().__init__(message) 4 | 5 | 6 | class UnauthorizedException(Exception): 7 | def __init__(self, message: str): 8 | super().__init__(message) 9 | 10 | 11 | class UnknownException(Exception): 12 | def __init__(self, message: str): 13 | super().__init__(message) 14 | 15 | 16 | class UnhandledRunStateException(Exception): 17 | def __init__(self, state: str): 18 | message = f"Run state '{state}' was unexpected. Maybe you need to upgrade to the latest Tower SDK." 19 | super().__init__(message) 20 | 21 | 22 | class TimeoutException(Exception): 23 | def __init__(self, time: float): 24 | super().__init__(f"A timeout occurred after {time} seconds.") 25 | 26 | 27 | class RunFailedError(RuntimeError): 28 | def __init__(self, app_name: str, number: int, state: str): 29 | super().__init__(f"Run {app_name}#{number} failed with status '{state}'") 30 | -------------------------------------------------------------------------------- /src/tower/polars.py: -------------------------------------------------------------------------------- 1 | try: 2 | import polars as _polars 3 | # Re-export everything from polars 4 | from polars import * 5 | 6 | # Or if you prefer, you can be explicit about what you re-export 7 | # from polars import DataFrame, Series, etc. 8 | except ImportError: 9 | _polars = None 10 | # Set specific names to None if you're using explicit imports 11 | -------------------------------------------------------------------------------- /src/tower/pyarrow.py: -------------------------------------------------------------------------------- 1 | try: 2 | import pyarrow as _pyarrow 3 | # Re-export everything 4 | from pyarrow import * 5 | except ImportError: 6 | _pyarrow = None 7 | -------------------------------------------------------------------------------- /src/tower/pyiceberg.py: -------------------------------------------------------------------------------- 1 | try: 2 | import pyiceberg as _pyiceberg 3 | # Re-export everything 4 | from pyiceberg import * 5 | except ImportError: 6 | _pyiceberg = None 7 | 8 | 9 | # Dynamic dispatch for submodules, as relevant. 10 | def __getattr__(name): 11 | """Forward attribute access to the original module.""" 12 | return getattr(_pyiceberg, name) 13 | 14 | # Optionally, also set up the module to handle subpackage imports 15 | # This requires Python 3.7+ 16 | def __dir__(): 17 | return dir(_pyiceberg) 18 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/__init__.py: -------------------------------------------------------------------------------- 1 | """A client library for accessing Tower API""" 2 | 3 | from .client import AuthenticatedClient, Client 4 | 5 | __all__ = ( 6 | "AuthenticatedClient", 7 | "Client", 8 | ) 9 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/api/__init__.py: -------------------------------------------------------------------------------- 1 | """Contains methods for accessing the API""" 2 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/api/default/__init__.py: -------------------------------------------------------------------------------- 1 | """Contains endpoint functions for accessing the API""" 2 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/errors.py: -------------------------------------------------------------------------------- 1 | """Contains shared errors types that can be raised from API functions""" 2 | 3 | 4 | class UnexpectedStatus(Exception): 5 | """Raised by api functions when the response status an undocumented status and Client.raise_on_unexpected_status is True""" 6 | 7 | def __init__(self, status_code: int, content: bytes): 8 | self.status_code = status_code 9 | self.content = content 10 | 11 | super().__init__( 12 | f"Unexpected status code: {status_code}\n\nResponse content:\n{content.decode(errors='ignore')}" 13 | ) 14 | 15 | 16 | __all__ = ["UnexpectedStatus"] 17 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/accept_invitation_params.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import Any, TypeVar, Union 3 | 4 | from attrs import define as _attrs_define 5 | 6 | from ..types import UNSET, Unset 7 | 8 | T = TypeVar("T", bound="AcceptInvitationParams") 9 | 10 | 11 | @_attrs_define 12 | class AcceptInvitationParams: 13 | """ 14 | Attributes: 15 | code (str): The invitation code to accept 16 | schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: 17 | https://api.tower.dev/v1/schemas/AcceptInvitationParams.json. 18 | """ 19 | 20 | code: str 21 | schema: Union[Unset, str] = UNSET 22 | 23 | def to_dict(self) -> dict[str, Any]: 24 | code = self.code 25 | 26 | schema = self.schema 27 | 28 | field_dict: dict[str, Any] = {} 29 | field_dict.update( 30 | { 31 | "code": code, 32 | } 33 | ) 34 | if schema is not UNSET: 35 | field_dict["$schema"] = schema 36 | 37 | return field_dict 38 | 39 | @classmethod 40 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 41 | d = dict(src_dict) 42 | code = d.pop("code") 43 | 44 | schema = d.pop("$schema", UNSET) 45 | 46 | accept_invitation_params = cls( 47 | code=code, 48 | schema=schema, 49 | ) 50 | 51 | return accept_invitation_params 52 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/account.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import Any, TypeVar 3 | 4 | from attrs import define as _attrs_define 5 | 6 | T = TypeVar("T", bound="Account") 7 | 8 | 9 | @_attrs_define 10 | class Account: 11 | """ 12 | Attributes: 13 | name (str): 14 | slug (str): 15 | """ 16 | 17 | name: str 18 | slug: str 19 | 20 | def to_dict(self) -> dict[str, Any]: 21 | name = self.name 22 | 23 | slug = self.slug 24 | 25 | field_dict: dict[str, Any] = {} 26 | field_dict.update( 27 | { 28 | "name": name, 29 | "slug": slug, 30 | } 31 | ) 32 | 33 | return field_dict 34 | 35 | @classmethod 36 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 37 | d = dict(src_dict) 38 | name = d.pop("name") 39 | 40 | slug = d.pop("slug") 41 | 42 | account = cls( 43 | name=name, 44 | slug=slug, 45 | ) 46 | 47 | return account 48 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/acknowledge_alert_response.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import Any, TypeVar, Union 3 | 4 | from attrs import define as _attrs_define 5 | 6 | from ..types import UNSET, Unset 7 | 8 | T = TypeVar("T", bound="AcknowledgeAlertResponse") 9 | 10 | 11 | @_attrs_define 12 | class AcknowledgeAlertResponse: 13 | """ 14 | Attributes: 15 | status (str): 16 | schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: 17 | https://api.tower.dev/v1/schemas/AcknowledgeAlertResponse.json. 18 | """ 19 | 20 | status: str 21 | schema: Union[Unset, str] = UNSET 22 | 23 | def to_dict(self) -> dict[str, Any]: 24 | status = self.status 25 | 26 | schema = self.schema 27 | 28 | field_dict: dict[str, Any] = {} 29 | field_dict.update( 30 | { 31 | "status": status, 32 | } 33 | ) 34 | if schema is not UNSET: 35 | field_dict["$schema"] = schema 36 | 37 | return field_dict 38 | 39 | @classmethod 40 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 41 | d = dict(src_dict) 42 | status = d.pop("status") 43 | 44 | schema = d.pop("$schema", UNSET) 45 | 46 | acknowledge_alert_response = cls( 47 | status=status, 48 | schema=schema, 49 | ) 50 | 51 | return acknowledge_alert_response 52 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/alert_alert_type.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class AlertAlertType(str, Enum): 5 | ERROR = "error" 6 | SUCCESS = "success" 7 | 8 | def __str__(self) -> str: 9 | return str(self.value) 10 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/alert_detail.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import Any, TypeVar 3 | 4 | from attrs import define as _attrs_define 5 | 6 | T = TypeVar("T", bound="AlertDetail") 7 | 8 | 9 | @_attrs_define 10 | class AlertDetail: 11 | """ 12 | Attributes: 13 | description (str): 14 | name (str): 15 | """ 16 | 17 | description: str 18 | name: str 19 | 20 | def to_dict(self) -> dict[str, Any]: 21 | description = self.description 22 | 23 | name = self.name 24 | 25 | field_dict: dict[str, Any] = {} 26 | field_dict.update( 27 | { 28 | "description": description, 29 | "name": name, 30 | } 31 | ) 32 | 33 | return field_dict 34 | 35 | @classmethod 36 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 37 | d = dict(src_dict) 38 | description = d.pop("description") 39 | 40 | name = d.pop("name") 41 | 42 | alert_detail = cls( 43 | description=description, 44 | name=name, 45 | ) 46 | 47 | return alert_detail 48 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/alert_status.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class AlertStatus(str, Enum): 5 | ERRORED = "errored" 6 | PENDING = "pending" 7 | SENT = "sent" 8 | 9 | def __str__(self) -> str: 10 | return str(self.value) 11 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/app_status.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class AppStatus(str, Enum): 5 | ACTIVE = "active" 6 | DISABLED = "disabled" 7 | FAILED = "failed" 8 | RUNNING = "running" 9 | 10 | def __str__(self) -> str: 11 | return str(self.value) 12 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/cancel_run_response.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import TYPE_CHECKING, Any, TypeVar, Union 3 | 4 | from attrs import define as _attrs_define 5 | 6 | from ..types import UNSET, Unset 7 | 8 | if TYPE_CHECKING: 9 | from ..models.run import Run 10 | 11 | 12 | T = TypeVar("T", bound="CancelRunResponse") 13 | 14 | 15 | @_attrs_define 16 | class CancelRunResponse: 17 | """ 18 | Attributes: 19 | run (Run): 20 | schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: 21 | https://api.tower.dev/v1/schemas/CancelRunResponse.json. 22 | """ 23 | 24 | run: "Run" 25 | schema: Union[Unset, str] = UNSET 26 | 27 | def to_dict(self) -> dict[str, Any]: 28 | run = self.run.to_dict() 29 | 30 | schema = self.schema 31 | 32 | field_dict: dict[str, Any] = {} 33 | field_dict.update( 34 | { 35 | "run": run, 36 | } 37 | ) 38 | if schema is not UNSET: 39 | field_dict["$schema"] = schema 40 | 41 | return field_dict 42 | 43 | @classmethod 44 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 45 | from ..models.run import Run 46 | 47 | d = dict(src_dict) 48 | run = Run.from_dict(d.pop("run")) 49 | 50 | schema = d.pop("$schema", UNSET) 51 | 52 | cancel_run_response = cls( 53 | run=run, 54 | schema=schema, 55 | ) 56 | 57 | return cancel_run_response 58 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/catalog_property.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import Any, TypeVar 3 | 4 | from attrs import define as _attrs_define 5 | 6 | T = TypeVar("T", bound="CatalogProperty") 7 | 8 | 9 | @_attrs_define 10 | class CatalogProperty: 11 | """ 12 | Attributes: 13 | name (str): 14 | preview (str): 15 | """ 16 | 17 | name: str 18 | preview: str 19 | 20 | def to_dict(self) -> dict[str, Any]: 21 | name = self.name 22 | 23 | preview = self.preview 24 | 25 | field_dict: dict[str, Any] = {} 26 | field_dict.update( 27 | { 28 | "name": name, 29 | "preview": preview, 30 | } 31 | ) 32 | 33 | return field_dict 34 | 35 | @classmethod 36 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 37 | d = dict(src_dict) 38 | name = d.pop("name") 39 | 40 | preview = d.pop("preview") 41 | 42 | catalog_property = cls( 43 | name=name, 44 | preview=preview, 45 | ) 46 | 47 | return catalog_property 48 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/claim_device_login_ticket_params.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import Any, TypeVar, Union 3 | 4 | from attrs import define as _attrs_define 5 | 6 | from ..types import UNSET, Unset 7 | 8 | T = TypeVar("T", bound="ClaimDeviceLoginTicketParams") 9 | 10 | 11 | @_attrs_define 12 | class ClaimDeviceLoginTicketParams: 13 | """ 14 | Attributes: 15 | user_code (str): The user code to claim. 16 | schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: 17 | https://api.tower.dev/v1/schemas/ClaimDeviceLoginTicketParams.json. 18 | """ 19 | 20 | user_code: str 21 | schema: Union[Unset, str] = UNSET 22 | 23 | def to_dict(self) -> dict[str, Any]: 24 | user_code = self.user_code 25 | 26 | schema = self.schema 27 | 28 | field_dict: dict[str, Any] = {} 29 | field_dict.update( 30 | { 31 | "user_code": user_code, 32 | } 33 | ) 34 | if schema is not UNSET: 35 | field_dict["$schema"] = schema 36 | 37 | return field_dict 38 | 39 | @classmethod 40 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 41 | d = dict(src_dict) 42 | user_code = d.pop("user_code") 43 | 44 | schema = d.pop("$schema", UNSET) 45 | 46 | claim_device_login_ticket_params = cls( 47 | user_code=user_code, 48 | schema=schema, 49 | ) 50 | 51 | return claim_device_login_ticket_params 52 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/claim_device_login_ticket_response.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import Any, TypeVar, Union 3 | 4 | from attrs import define as _attrs_define 5 | 6 | from ..types import UNSET, Unset 7 | 8 | T = TypeVar("T", bound="ClaimDeviceLoginTicketResponse") 9 | 10 | 11 | @_attrs_define 12 | class ClaimDeviceLoginTicketResponse: 13 | """ 14 | Attributes: 15 | claimed (bool): Whether the code was successfully claimed. 16 | schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: 17 | https://api.tower.dev/v1/schemas/ClaimDeviceLoginTicketResponse.json. 18 | """ 19 | 20 | claimed: bool 21 | schema: Union[Unset, str] = UNSET 22 | 23 | def to_dict(self) -> dict[str, Any]: 24 | claimed = self.claimed 25 | 26 | schema = self.schema 27 | 28 | field_dict: dict[str, Any] = {} 29 | field_dict.update( 30 | { 31 | "claimed": claimed, 32 | } 33 | ) 34 | if schema is not UNSET: 35 | field_dict["$schema"] = schema 36 | 37 | return field_dict 38 | 39 | @classmethod 40 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 41 | d = dict(src_dict) 42 | claimed = d.pop("claimed") 43 | 44 | schema = d.pop("$schema", UNSET) 45 | 46 | claim_device_login_ticket_response = cls( 47 | claimed=claimed, 48 | schema=schema, 49 | ) 50 | 51 | return claim_device_login_ticket_response 52 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/create_account_params_flags_struct.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import Any, TypeVar 3 | 4 | from attrs import define as _attrs_define 5 | 6 | T = TypeVar("T", bound="CreateAccountParamsFlagsStruct") 7 | 8 | 9 | @_attrs_define 10 | class CreateAccountParamsFlagsStruct: 11 | """ 12 | Attributes: 13 | is_test_account (bool): 14 | """ 15 | 16 | is_test_account: bool 17 | 18 | def to_dict(self) -> dict[str, Any]: 19 | is_test_account = self.is_test_account 20 | 21 | field_dict: dict[str, Any] = {} 22 | field_dict.update( 23 | { 24 | "is_test_account": is_test_account, 25 | } 26 | ) 27 | 28 | return field_dict 29 | 30 | @classmethod 31 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 32 | d = dict(src_dict) 33 | is_test_account = d.pop("is_test_account") 34 | 35 | create_account_params_flags_struct = cls( 36 | is_test_account=is_test_account, 37 | ) 38 | 39 | return create_account_params_flags_struct 40 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/create_api_key_params.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import Any, TypeVar, Union 3 | 4 | from attrs import define as _attrs_define 5 | 6 | from ..types import UNSET, Unset 7 | 8 | T = TypeVar("T", bound="CreateAPIKeyParams") 9 | 10 | 11 | @_attrs_define 12 | class CreateAPIKeyParams: 13 | """ 14 | Attributes: 15 | name (str): 16 | schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: 17 | https://api.tower.dev/v1/schemas/CreateAPIKeyParams.json. 18 | """ 19 | 20 | name: str 21 | schema: Union[Unset, str] = UNSET 22 | 23 | def to_dict(self) -> dict[str, Any]: 24 | name = self.name 25 | 26 | schema = self.schema 27 | 28 | field_dict: dict[str, Any] = {} 29 | field_dict.update( 30 | { 31 | "name": name, 32 | } 33 | ) 34 | if schema is not UNSET: 35 | field_dict["$schema"] = schema 36 | 37 | return field_dict 38 | 39 | @classmethod 40 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 41 | d = dict(src_dict) 42 | name = d.pop("name") 43 | 44 | schema = d.pop("$schema", UNSET) 45 | 46 | create_api_key_params = cls( 47 | name=name, 48 | schema=schema, 49 | ) 50 | 51 | return create_api_key_params 52 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/create_app_response.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import TYPE_CHECKING, Any, TypeVar, Union 3 | 4 | from attrs import define as _attrs_define 5 | 6 | from ..types import UNSET, Unset 7 | 8 | if TYPE_CHECKING: 9 | from ..models.app import App 10 | 11 | 12 | T = TypeVar("T", bound="CreateAppResponse") 13 | 14 | 15 | @_attrs_define 16 | class CreateAppResponse: 17 | """ 18 | Attributes: 19 | app (App): 20 | schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: 21 | https://api.tower.dev/v1/schemas/CreateAppResponse.json. 22 | """ 23 | 24 | app: "App" 25 | schema: Union[Unset, str] = UNSET 26 | 27 | def to_dict(self) -> dict[str, Any]: 28 | app = self.app.to_dict() 29 | 30 | schema = self.schema 31 | 32 | field_dict: dict[str, Any] = {} 33 | field_dict.update( 34 | { 35 | "app": app, 36 | } 37 | ) 38 | if schema is not UNSET: 39 | field_dict["$schema"] = schema 40 | 41 | return field_dict 42 | 43 | @classmethod 44 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 45 | from ..models.app import App 46 | 47 | d = dict(src_dict) 48 | app = App.from_dict(d.pop("app")) 49 | 50 | schema = d.pop("$schema", UNSET) 51 | 52 | create_app_response = cls( 53 | app=app, 54 | schema=schema, 55 | ) 56 | 57 | return create_app_response 58 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/create_catalog_params_type.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class CreateCatalogParamsType(str, Enum): 5 | APACHE_POLARIS = "apache-polaris" 6 | SNOWFLAKE_OPEN_CATALOG = "snowflake-open-catalog" 7 | 8 | def __str__(self) -> str: 9 | return str(self.value) 10 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/delete_api_key_params.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import Any, TypeVar, Union 3 | 4 | from attrs import define as _attrs_define 5 | 6 | from ..types import UNSET, Unset 7 | 8 | T = TypeVar("T", bound="DeleteAPIKeyParams") 9 | 10 | 11 | @_attrs_define 12 | class DeleteAPIKeyParams: 13 | """ 14 | Attributes: 15 | identifier (str): 16 | schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: 17 | https://api.tower.dev/v1/schemas/DeleteAPIKeyParams.json. 18 | """ 19 | 20 | identifier: str 21 | schema: Union[Unset, str] = UNSET 22 | 23 | def to_dict(self) -> dict[str, Any]: 24 | identifier = self.identifier 25 | 26 | schema = self.schema 27 | 28 | field_dict: dict[str, Any] = {} 29 | field_dict.update( 30 | { 31 | "identifier": identifier, 32 | } 33 | ) 34 | if schema is not UNSET: 35 | field_dict["$schema"] = schema 36 | 37 | return field_dict 38 | 39 | @classmethod 40 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 41 | d = dict(src_dict) 42 | identifier = d.pop("identifier") 43 | 44 | schema = d.pop("$schema", UNSET) 45 | 46 | delete_api_key_params = cls( 47 | identifier=identifier, 48 | schema=schema, 49 | ) 50 | 51 | return delete_api_key_params 52 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/delete_app_response.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import TYPE_CHECKING, Any, TypeVar, Union 3 | 4 | from attrs import define as _attrs_define 5 | 6 | from ..types import UNSET, Unset 7 | 8 | if TYPE_CHECKING: 9 | from ..models.app import App 10 | 11 | 12 | T = TypeVar("T", bound="DeleteAppResponse") 13 | 14 | 15 | @_attrs_define 16 | class DeleteAppResponse: 17 | """ 18 | Attributes: 19 | app (App): 20 | schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: 21 | https://api.tower.dev/v1/schemas/DeleteAppResponse.json. 22 | """ 23 | 24 | app: "App" 25 | schema: Union[Unset, str] = UNSET 26 | 27 | def to_dict(self) -> dict[str, Any]: 28 | app = self.app.to_dict() 29 | 30 | schema = self.schema 31 | 32 | field_dict: dict[str, Any] = {} 33 | field_dict.update( 34 | { 35 | "app": app, 36 | } 37 | ) 38 | if schema is not UNSET: 39 | field_dict["$schema"] = schema 40 | 41 | return field_dict 42 | 43 | @classmethod 44 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 45 | from ..models.app import App 46 | 47 | d = dict(src_dict) 48 | app = App.from_dict(d.pop("app")) 49 | 50 | schema = d.pop("$schema", UNSET) 51 | 52 | delete_app_response = cls( 53 | app=app, 54 | schema=schema, 55 | ) 56 | 57 | return delete_app_response 58 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/delete_team_invitation_params.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import Any, TypeVar, Union 3 | 4 | from attrs import define as _attrs_define 5 | 6 | from ..types import UNSET, Unset 7 | 8 | T = TypeVar("T", bound="DeleteTeamInvitationParams") 9 | 10 | 11 | @_attrs_define 12 | class DeleteTeamInvitationParams: 13 | """ 14 | Attributes: 15 | email (str): The email address of the team member to remove 16 | schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: 17 | https://api.tower.dev/v1/schemas/DeleteTeamInvitationParams.json. 18 | """ 19 | 20 | email: str 21 | schema: Union[Unset, str] = UNSET 22 | 23 | def to_dict(self) -> dict[str, Any]: 24 | email = self.email 25 | 26 | schema = self.schema 27 | 28 | field_dict: dict[str, Any] = {} 29 | field_dict.update( 30 | { 31 | "email": email, 32 | } 33 | ) 34 | if schema is not UNSET: 35 | field_dict["$schema"] = schema 36 | 37 | return field_dict 38 | 39 | @classmethod 40 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 41 | d = dict(src_dict) 42 | email = d.pop("email") 43 | 44 | schema = d.pop("$schema", UNSET) 45 | 46 | delete_team_invitation_params = cls( 47 | email=email, 48 | schema=schema, 49 | ) 50 | 51 | return delete_team_invitation_params 52 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/delete_team_params.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import Any, TypeVar, Union 3 | 4 | from attrs import define as _attrs_define 5 | 6 | from ..types import UNSET, Unset 7 | 8 | T = TypeVar("T", bound="DeleteTeamParams") 9 | 10 | 11 | @_attrs_define 12 | class DeleteTeamParams: 13 | """ 14 | Attributes: 15 | slug (str): The slug of the team to delete 16 | schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: 17 | https://api.tower.dev/v1/schemas/DeleteTeamParams.json. 18 | """ 19 | 20 | slug: str 21 | schema: Union[Unset, str] = UNSET 22 | 23 | def to_dict(self) -> dict[str, Any]: 24 | slug = self.slug 25 | 26 | schema = self.schema 27 | 28 | field_dict: dict[str, Any] = {} 29 | field_dict.update( 30 | { 31 | "slug": slug, 32 | } 33 | ) 34 | if schema is not UNSET: 35 | field_dict["$schema"] = schema 36 | 37 | return field_dict 38 | 39 | @classmethod 40 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 41 | d = dict(src_dict) 42 | slug = d.pop("slug") 43 | 44 | schema = d.pop("$schema", UNSET) 45 | 46 | delete_team_params = cls( 47 | slug=slug, 48 | schema=schema, 49 | ) 50 | 51 | return delete_team_params 52 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/describe_secrets_key_response.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import Any, TypeVar, Union 3 | 4 | from attrs import define as _attrs_define 5 | 6 | from ..types import UNSET, Unset 7 | 8 | T = TypeVar("T", bound="DescribeSecretsKeyResponse") 9 | 10 | 11 | @_attrs_define 12 | class DescribeSecretsKeyResponse: 13 | """ 14 | Attributes: 15 | public_key (str): 16 | schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: 17 | https://api.tower.dev/v1/schemas/DescribeSecretsKeyResponse.json. 18 | """ 19 | 20 | public_key: str 21 | schema: Union[Unset, str] = UNSET 22 | 23 | def to_dict(self) -> dict[str, Any]: 24 | public_key = self.public_key 25 | 26 | schema = self.schema 27 | 28 | field_dict: dict[str, Any] = {} 29 | field_dict.update( 30 | { 31 | "public_key": public_key, 32 | } 33 | ) 34 | if schema is not UNSET: 35 | field_dict["$schema"] = schema 36 | 37 | return field_dict 38 | 39 | @classmethod 40 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 41 | d = dict(src_dict) 42 | public_key = d.pop("public_key") 43 | 44 | schema = d.pop("$schema", UNSET) 45 | 46 | describe_secrets_key_response = cls( 47 | public_key=public_key, 48 | schema=schema, 49 | ) 50 | 51 | return describe_secrets_key_response 52 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/encrypted_catalog_property.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import Any, TypeVar 3 | 4 | from attrs import define as _attrs_define 5 | 6 | T = TypeVar("T", bound="EncryptedCatalogProperty") 7 | 8 | 9 | @_attrs_define 10 | class EncryptedCatalogProperty: 11 | """ 12 | Attributes: 13 | encrypted_value (str): 14 | name (str): 15 | preview (str): 16 | """ 17 | 18 | encrypted_value: str 19 | name: str 20 | preview: str 21 | 22 | def to_dict(self) -> dict[str, Any]: 23 | encrypted_value = self.encrypted_value 24 | 25 | name = self.name 26 | 27 | preview = self.preview 28 | 29 | field_dict: dict[str, Any] = {} 30 | field_dict.update( 31 | { 32 | "encrypted_value": encrypted_value, 33 | "name": name, 34 | "preview": preview, 35 | } 36 | ) 37 | 38 | return field_dict 39 | 40 | @classmethod 41 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 42 | d = dict(src_dict) 43 | encrypted_value = d.pop("encrypted_value") 44 | 45 | name = d.pop("name") 46 | 47 | preview = d.pop("preview") 48 | 49 | encrypted_catalog_property = cls( 50 | encrypted_value=encrypted_value, 51 | name=name, 52 | preview=preview, 53 | ) 54 | 55 | return encrypted_catalog_property 56 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/exported_catalog_property.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import Any, TypeVar 3 | 4 | from attrs import define as _attrs_define 5 | 6 | T = TypeVar("T", bound="ExportedCatalogProperty") 7 | 8 | 9 | @_attrs_define 10 | class ExportedCatalogProperty: 11 | """ 12 | Attributes: 13 | encrypted_value (str): 14 | name (str): 15 | preview (str): 16 | """ 17 | 18 | encrypted_value: str 19 | name: str 20 | preview: str 21 | 22 | def to_dict(self) -> dict[str, Any]: 23 | encrypted_value = self.encrypted_value 24 | 25 | name = self.name 26 | 27 | preview = self.preview 28 | 29 | field_dict: dict[str, Any] = {} 30 | field_dict.update( 31 | { 32 | "encrypted_value": encrypted_value, 33 | "name": name, 34 | "preview": preview, 35 | } 36 | ) 37 | 38 | return field_dict 39 | 40 | @classmethod 41 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 42 | d = dict(src_dict) 43 | encrypted_value = d.pop("encrypted_value") 44 | 45 | name = d.pop("name") 46 | 47 | preview = d.pop("preview") 48 | 49 | exported_catalog_property = cls( 50 | encrypted_value=encrypted_value, 51 | name=name, 52 | preview=preview, 53 | ) 54 | 55 | return exported_catalog_property 56 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/list_apps_status_item.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class ListAppsStatusItem(str, Enum): 5 | ACTIVE = "active" 6 | DISABLED = "disabled" 7 | FAILED = "failed" 8 | RUNNING = "running" 9 | 10 | def __str__(self) -> str: 11 | return str(self.value) 12 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/list_runs_status_item.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class ListRunsStatusItem(str, Enum): 5 | CANCELLED = "cancelled" 6 | CRASHED = "crashed" 7 | ERRORED = "errored" 8 | EXITED = "exited" 9 | PENDING = "pending" 10 | RUNNING = "running" 11 | SCHEDULED = "scheduled" 12 | 13 | def __str__(self) -> str: 14 | return str(self.value) 15 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/log_line_channel.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class LogLineChannel(str, Enum): 5 | PROGRAM = "program" 6 | SETUP = "setup" 7 | 8 | def __str__(self) -> str: 9 | return str(self.value) 10 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/log_line_error.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | from collections.abc import Mapping 3 | from typing import Any, TypeVar 4 | 5 | from attrs import define as _attrs_define 6 | from dateutil.parser import isoparse 7 | 8 | T = TypeVar("T", bound="LogLineError") 9 | 10 | 11 | @_attrs_define 12 | class LogLineError: 13 | """ 14 | Attributes: 15 | content (str): Contents of the error. 16 | reported_at (datetime.datetime): Timestamp of the event. 17 | """ 18 | 19 | content: str 20 | reported_at: datetime.datetime 21 | 22 | def to_dict(self) -> dict[str, Any]: 23 | content = self.content 24 | 25 | reported_at = self.reported_at.isoformat() 26 | 27 | field_dict: dict[str, Any] = {} 28 | field_dict.update( 29 | { 30 | "content": content, 31 | "reported_at": reported_at, 32 | } 33 | ) 34 | 35 | return field_dict 36 | 37 | @classmethod 38 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 39 | d = dict(src_dict) 40 | content = d.pop("content") 41 | 42 | reported_at = isoparse(d.pop("reported_at")) 43 | 44 | log_line_error = cls( 45 | content=content, 46 | reported_at=reported_at, 47 | ) 48 | 49 | return log_line_error 50 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/pagination.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import Any, TypeVar 3 | 4 | from attrs import define as _attrs_define 5 | 6 | T = TypeVar("T", bound="Pagination") 7 | 8 | 9 | @_attrs_define 10 | class Pagination: 11 | """ 12 | Attributes: 13 | num_pages (int): 14 | page (int): 15 | page_size (int): 16 | total (int): 17 | """ 18 | 19 | num_pages: int 20 | page: int 21 | page_size: int 22 | total: int 23 | 24 | def to_dict(self) -> dict[str, Any]: 25 | num_pages = self.num_pages 26 | 27 | page = self.page 28 | 29 | page_size = self.page_size 30 | 31 | total = self.total 32 | 33 | field_dict: dict[str, Any] = {} 34 | field_dict.update( 35 | { 36 | "num_pages": num_pages, 37 | "page": page, 38 | "page_size": page_size, 39 | "total": total, 40 | } 41 | ) 42 | 43 | return field_dict 44 | 45 | @classmethod 46 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 47 | d = dict(src_dict) 48 | num_pages = d.pop("num_pages") 49 | 50 | page = d.pop("page") 51 | 52 | page_size = d.pop("page_size") 53 | 54 | total = d.pop("total") 55 | 56 | pagination = cls( 57 | num_pages=num_pages, 58 | page=page, 59 | page_size=page_size, 60 | total=total, 61 | ) 62 | 63 | return pagination 64 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/parameter.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import Any, TypeVar 3 | 4 | from attrs import define as _attrs_define 5 | 6 | T = TypeVar("T", bound="Parameter") 7 | 8 | 9 | @_attrs_define 10 | class Parameter: 11 | """ 12 | Attributes: 13 | default (str): 14 | description (str): 15 | name (str): 16 | """ 17 | 18 | default: str 19 | description: str 20 | name: str 21 | 22 | def to_dict(self) -> dict[str, Any]: 23 | default = self.default 24 | 25 | description = self.description 26 | 27 | name = self.name 28 | 29 | field_dict: dict[str, Any] = {} 30 | field_dict.update( 31 | { 32 | "default": default, 33 | "description": description, 34 | "name": name, 35 | } 36 | ) 37 | 38 | return field_dict 39 | 40 | @classmethod 41 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 42 | d = dict(src_dict) 43 | default = d.pop("default") 44 | 45 | description = d.pop("description") 46 | 47 | name = d.pop("name") 48 | 49 | parameter = cls( 50 | default=default, 51 | description=description, 52 | name=name, 53 | ) 54 | 55 | return parameter 56 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/refresh_session_params.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import Any, TypeVar, Union 3 | 4 | from attrs import define as _attrs_define 5 | 6 | from ..types import UNSET, Unset 7 | 8 | T = TypeVar("T", bound="RefreshSessionParams") 9 | 10 | 11 | @_attrs_define 12 | class RefreshSessionParams: 13 | """ 14 | Attributes: 15 | schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: 16 | https://api.tower.dev/v1/schemas/RefreshSessionParams.json. 17 | """ 18 | 19 | schema: Union[Unset, str] = UNSET 20 | 21 | def to_dict(self) -> dict[str, Any]: 22 | schema = self.schema 23 | 24 | field_dict: dict[str, Any] = {} 25 | field_dict.update({}) 26 | if schema is not UNSET: 27 | field_dict["$schema"] = schema 28 | 29 | return field_dict 30 | 31 | @classmethod 32 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 33 | d = dict(src_dict) 34 | schema = d.pop("$schema", UNSET) 35 | 36 | refresh_session_params = cls( 37 | schema=schema, 38 | ) 39 | 40 | return refresh_session_params 41 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/remove_team_member_params.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import Any, TypeVar, Union 3 | 4 | from attrs import define as _attrs_define 5 | 6 | from ..types import UNSET, Unset 7 | 8 | T = TypeVar("T", bound="RemoveTeamMemberParams") 9 | 10 | 11 | @_attrs_define 12 | class RemoveTeamMemberParams: 13 | """ 14 | Attributes: 15 | email (str): The email address of the team member to remove 16 | schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: 17 | https://api.tower.dev/v1/schemas/RemoveTeamMemberParams.json. 18 | """ 19 | 20 | email: str 21 | schema: Union[Unset, str] = UNSET 22 | 23 | def to_dict(self) -> dict[str, Any]: 24 | email = self.email 25 | 26 | schema = self.schema 27 | 28 | field_dict: dict[str, Any] = {} 29 | field_dict.update( 30 | { 31 | "email": email, 32 | } 33 | ) 34 | if schema is not UNSET: 35 | field_dict["$schema"] = schema 36 | 37 | return field_dict 38 | 39 | @classmethod 40 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 41 | d = dict(src_dict) 42 | email = d.pop("email") 43 | 44 | schema = d.pop("$schema", UNSET) 45 | 46 | remove_team_member_params = cls( 47 | email=email, 48 | schema=schema, 49 | ) 50 | 51 | return remove_team_member_params 52 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/run_app_params_parameters.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import Any, TypeVar 3 | 4 | from attrs import define as _attrs_define 5 | from attrs import field as _attrs_field 6 | 7 | T = TypeVar("T", bound="RunAppParamsParameters") 8 | 9 | 10 | @_attrs_define 11 | class RunAppParamsParameters: 12 | """The parameters to pass into this app.""" 13 | 14 | additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) 15 | 16 | def to_dict(self) -> dict[str, Any]: 17 | field_dict: dict[str, Any] = {} 18 | field_dict.update(self.additional_properties) 19 | 20 | return field_dict 21 | 22 | @classmethod 23 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 24 | d = dict(src_dict) 25 | run_app_params_parameters = cls() 26 | 27 | run_app_params_parameters.additional_properties = d 28 | return run_app_params_parameters 29 | 30 | @property 31 | def additional_keys(self) -> list[str]: 32 | return list(self.additional_properties.keys()) 33 | 34 | def __getitem__(self, key: str) -> str: 35 | return self.additional_properties[key] 36 | 37 | def __setitem__(self, key: str, value: str) -> None: 38 | self.additional_properties[key] = value 39 | 40 | def __delitem__(self, key: str) -> None: 41 | del self.additional_properties[key] 42 | 43 | def __contains__(self, key: str) -> bool: 44 | return key in self.additional_properties 45 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/run_app_response.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import TYPE_CHECKING, Any, TypeVar, Union 3 | 4 | from attrs import define as _attrs_define 5 | 6 | from ..types import UNSET, Unset 7 | 8 | if TYPE_CHECKING: 9 | from ..models.run import Run 10 | 11 | 12 | T = TypeVar("T", bound="RunAppResponse") 13 | 14 | 15 | @_attrs_define 16 | class RunAppResponse: 17 | """ 18 | Attributes: 19 | run (Run): 20 | schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: 21 | https://api.tower.dev/v1/schemas/RunAppResponse.json. 22 | """ 23 | 24 | run: "Run" 25 | schema: Union[Unset, str] = UNSET 26 | 27 | def to_dict(self) -> dict[str, Any]: 28 | run = self.run.to_dict() 29 | 30 | schema = self.schema 31 | 32 | field_dict: dict[str, Any] = {} 33 | field_dict.update( 34 | { 35 | "run": run, 36 | } 37 | ) 38 | if schema is not UNSET: 39 | field_dict["$schema"] = schema 40 | 41 | return field_dict 42 | 43 | @classmethod 44 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 45 | from ..models.run import Run 46 | 47 | d = dict(src_dict) 48 | run = Run.from_dict(d.pop("run")) 49 | 50 | schema = d.pop("$schema", UNSET) 51 | 52 | run_app_response = cls( 53 | run=run, 54 | schema=schema, 55 | ) 56 | 57 | return run_app_response 58 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/run_log_line.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | from collections.abc import Mapping 3 | from typing import Any, TypeVar 4 | 5 | from attrs import define as _attrs_define 6 | from dateutil.parser import isoparse 7 | 8 | T = TypeVar("T", bound="RunLogLine") 9 | 10 | 11 | @_attrs_define 12 | class RunLogLine: 13 | """ 14 | Attributes: 15 | channel (str): 16 | message (str): 17 | timestamp (datetime.datetime): 18 | """ 19 | 20 | channel: str 21 | message: str 22 | timestamp: datetime.datetime 23 | 24 | def to_dict(self) -> dict[str, Any]: 25 | channel = self.channel 26 | 27 | message = self.message 28 | 29 | timestamp = self.timestamp.isoformat() 30 | 31 | field_dict: dict[str, Any] = {} 32 | field_dict.update( 33 | { 34 | "channel": channel, 35 | "message": message, 36 | "timestamp": timestamp, 37 | } 38 | ) 39 | 40 | return field_dict 41 | 42 | @classmethod 43 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 44 | d = dict(src_dict) 45 | channel = d.pop("channel") 46 | 47 | message = d.pop("message") 48 | 49 | timestamp = isoparse(d.pop("timestamp")) 50 | 51 | run_log_line = cls( 52 | channel=channel, 53 | message=message, 54 | timestamp=timestamp, 55 | ) 56 | 57 | return run_log_line 58 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/run_parameter.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import Any, TypeVar 3 | 4 | from attrs import define as _attrs_define 5 | 6 | T = TypeVar("T", bound="RunParameter") 7 | 8 | 9 | @_attrs_define 10 | class RunParameter: 11 | """ 12 | Attributes: 13 | name (str): 14 | value (str): 15 | """ 16 | 17 | name: str 18 | value: str 19 | 20 | def to_dict(self) -> dict[str, Any]: 21 | name = self.name 22 | 23 | value = self.value 24 | 25 | field_dict: dict[str, Any] = {} 26 | field_dict.update( 27 | { 28 | "name": name, 29 | "value": value, 30 | } 31 | ) 32 | 33 | return field_dict 34 | 35 | @classmethod 36 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 37 | d = dict(src_dict) 38 | name = d.pop("name") 39 | 40 | value = d.pop("value") 41 | 42 | run_parameter = cls( 43 | name=name, 44 | value=value, 45 | ) 46 | 47 | return run_parameter 48 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/run_statistics.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import Any, TypeVar 3 | 4 | from attrs import define as _attrs_define 5 | 6 | T = TypeVar("T", bound="RunStatistics") 7 | 8 | 9 | @_attrs_define 10 | class RunStatistics: 11 | """ 12 | Attributes: 13 | failed_runs (int): 14 | successful_runs (int): 15 | total_runs (int): 16 | """ 17 | 18 | failed_runs: int 19 | successful_runs: int 20 | total_runs: int 21 | 22 | def to_dict(self) -> dict[str, Any]: 23 | failed_runs = self.failed_runs 24 | 25 | successful_runs = self.successful_runs 26 | 27 | total_runs = self.total_runs 28 | 29 | field_dict: dict[str, Any] = {} 30 | field_dict.update( 31 | { 32 | "failed_runs": failed_runs, 33 | "successful_runs": successful_runs, 34 | "total_runs": total_runs, 35 | } 36 | ) 37 | 38 | return field_dict 39 | 40 | @classmethod 41 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 42 | d = dict(src_dict) 43 | failed_runs = d.pop("failed_runs") 44 | 45 | successful_runs = d.pop("successful_runs") 46 | 47 | total_runs = d.pop("total_runs") 48 | 49 | run_statistics = cls( 50 | failed_runs=failed_runs, 51 | successful_runs=successful_runs, 52 | total_runs=total_runs, 53 | ) 54 | 55 | return run_statistics 56 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/run_status.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class RunStatus(str, Enum): 5 | CANCELLED = "cancelled" 6 | CRASHED = "crashed" 7 | ERRORED = "errored" 8 | EXITED = "exited" 9 | PENDING = "pending" 10 | RUNNING = "running" 11 | SCHEDULED = "scheduled" 12 | 13 | def __str__(self) -> str: 14 | return str(self.value) 15 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/run_status_group.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class RunStatusGroup(str, Enum): 5 | FAILED = "failed" 6 | SUCCESSFUL = "successful" 7 | VALUE_2 = "" 8 | 9 | def __str__(self) -> str: 10 | return str(self.value) 11 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/series_point.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import Any, TypeVar 3 | 4 | from attrs import define as _attrs_define 5 | 6 | T = TypeVar("T", bound="SeriesPoint") 7 | 8 | 9 | @_attrs_define 10 | class SeriesPoint: 11 | """ 12 | Attributes: 13 | failed (int): 14 | key (str): 15 | successful (int): 16 | """ 17 | 18 | failed: int 19 | key: str 20 | successful: int 21 | 22 | def to_dict(self) -> dict[str, Any]: 23 | failed = self.failed 24 | 25 | key = self.key 26 | 27 | successful = self.successful 28 | 29 | field_dict: dict[str, Any] = {} 30 | field_dict.update( 31 | { 32 | "failed": failed, 33 | "key": key, 34 | "successful": successful, 35 | } 36 | ) 37 | 38 | return field_dict 39 | 40 | @classmethod 41 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 42 | d = dict(src_dict) 43 | failed = d.pop("failed") 44 | 45 | key = d.pop("key") 46 | 47 | successful = d.pop("successful") 48 | 49 | series_point = cls( 50 | failed=failed, 51 | key=key, 52 | successful=successful, 53 | ) 54 | 55 | return series_point 56 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/statistics_settings.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import Any, TypeVar 3 | 4 | from attrs import define as _attrs_define 5 | 6 | T = TypeVar("T", bound="StatisticsSettings") 7 | 8 | 9 | @_attrs_define 10 | class StatisticsSettings: 11 | """ 12 | Attributes: 13 | period (str): 14 | """ 15 | 16 | period: str 17 | 18 | def to_dict(self) -> dict[str, Any]: 19 | period = self.period 20 | 21 | field_dict: dict[str, Any] = {} 22 | field_dict.update( 23 | { 24 | "period": period, 25 | } 26 | ) 27 | 28 | return field_dict 29 | 30 | @classmethod 31 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 32 | d = dict(src_dict) 33 | period = d.pop("period") 34 | 35 | statistics_settings = cls( 36 | period=period, 37 | ) 38 | 39 | return statistics_settings 40 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/token.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import Any, TypeVar 3 | 4 | from attrs import define as _attrs_define 5 | 6 | T = TypeVar("T", bound="Token") 7 | 8 | 9 | @_attrs_define 10 | class Token: 11 | """ 12 | Attributes: 13 | jwt (str): 14 | """ 15 | 16 | jwt: str 17 | 18 | def to_dict(self) -> dict[str, Any]: 19 | jwt = self.jwt 20 | 21 | field_dict: dict[str, Any] = {} 22 | field_dict.update( 23 | { 24 | "jwt": jwt, 25 | } 26 | ) 27 | 28 | return field_dict 29 | 30 | @classmethod 31 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 32 | d = dict(src_dict) 33 | jwt = d.pop("jwt") 34 | 35 | token = cls( 36 | jwt=jwt, 37 | ) 38 | 39 | return token 40 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/update_account_slug_params.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import Any, TypeVar, Union 3 | 4 | from attrs import define as _attrs_define 5 | 6 | from ..types import UNSET, Unset 7 | 8 | T = TypeVar("T", bound="UpdateAccountSlugParams") 9 | 10 | 11 | @_attrs_define 12 | class UpdateAccountSlugParams: 13 | """ 14 | Attributes: 15 | new_slug (str): The new slug for the account 16 | schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: 17 | https://api.tower.dev/v1/schemas/UpdateAccountSlugParams.json. 18 | """ 19 | 20 | new_slug: str 21 | schema: Union[Unset, str] = UNSET 22 | 23 | def to_dict(self) -> dict[str, Any]: 24 | new_slug = self.new_slug 25 | 26 | schema = self.schema 27 | 28 | field_dict: dict[str, Any] = {} 29 | field_dict.update( 30 | { 31 | "new_slug": new_slug, 32 | } 33 | ) 34 | if schema is not UNSET: 35 | field_dict["$schema"] = schema 36 | 37 | return field_dict 38 | 39 | @classmethod 40 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 41 | d = dict(src_dict) 42 | new_slug = d.pop("new_slug") 43 | 44 | schema = d.pop("$schema", UNSET) 45 | 46 | update_account_slug_params = cls( 47 | new_slug=new_slug, 48 | schema=schema, 49 | ) 50 | 51 | return update_account_slug_params 52 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/update_app_response.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import TYPE_CHECKING, Any, TypeVar, Union 3 | 4 | from attrs import define as _attrs_define 5 | 6 | from ..types import UNSET, Unset 7 | 8 | if TYPE_CHECKING: 9 | from ..models.app import App 10 | 11 | 12 | T = TypeVar("T", bound="UpdateAppResponse") 13 | 14 | 15 | @_attrs_define 16 | class UpdateAppResponse: 17 | """ 18 | Attributes: 19 | app (App): 20 | schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: 21 | https://api.tower.dev/v1/schemas/UpdateAppResponse.json. 22 | """ 23 | 24 | app: "App" 25 | schema: Union[Unset, str] = UNSET 26 | 27 | def to_dict(self) -> dict[str, Any]: 28 | app = self.app.to_dict() 29 | 30 | schema = self.schema 31 | 32 | field_dict: dict[str, Any] = {} 33 | field_dict.update( 34 | { 35 | "App": app, 36 | } 37 | ) 38 | if schema is not UNSET: 39 | field_dict["$schema"] = schema 40 | 41 | return field_dict 42 | 43 | @classmethod 44 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 45 | from ..models.app import App 46 | 47 | d = dict(src_dict) 48 | app = App.from_dict(d.pop("App")) 49 | 50 | schema = d.pop("$schema", UNSET) 51 | 52 | update_app_response = cls( 53 | app=app, 54 | schema=schema, 55 | ) 56 | 57 | return update_app_response 58 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/models/update_my_team_invitation_response.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import Any, TypeVar, Union 3 | 4 | from attrs import define as _attrs_define 5 | 6 | from ..types import UNSET, Unset 7 | 8 | T = TypeVar("T", bound="UpdateMyTeamInvitationResponse") 9 | 10 | 11 | @_attrs_define 12 | class UpdateMyTeamInvitationResponse: 13 | """ 14 | Attributes: 15 | schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: 16 | https://api.tower.dev/v1/schemas/UpdateMyTeamInvitationResponse.json. 17 | """ 18 | 19 | schema: Union[Unset, str] = UNSET 20 | 21 | def to_dict(self) -> dict[str, Any]: 22 | schema = self.schema 23 | 24 | field_dict: dict[str, Any] = {} 25 | field_dict.update({}) 26 | if schema is not UNSET: 27 | field_dict["$schema"] = schema 28 | 29 | return field_dict 30 | 31 | @classmethod 32 | def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 33 | d = dict(src_dict) 34 | schema = d.pop("$schema", UNSET) 35 | 36 | update_my_team_invitation_response = cls( 37 | schema=schema, 38 | ) 39 | 40 | return update_my_team_invitation_response 41 | -------------------------------------------------------------------------------- /src/tower/tower_api_client/types.py: -------------------------------------------------------------------------------- 1 | """Contains some shared types for properties""" 2 | 3 | from collections.abc import MutableMapping 4 | from http import HTTPStatus 5 | from typing import BinaryIO, Generic, Literal, Optional, TypeVar 6 | 7 | from attrs import define 8 | 9 | 10 | class Unset: 11 | def __bool__(self) -> Literal[False]: 12 | return False 13 | 14 | 15 | UNSET: Unset = Unset() 16 | 17 | FileJsonType = tuple[Optional[str], BinaryIO, Optional[str]] 18 | 19 | 20 | @define 21 | class File: 22 | """Contains information for file uploads""" 23 | 24 | payload: BinaryIO 25 | file_name: Optional[str] = None 26 | mime_type: Optional[str] = None 27 | 28 | def to_tuple(self) -> FileJsonType: 29 | """Return a tuple representation that httpx will accept for multipart/form-data""" 30 | return self.file_name, self.payload, self.mime_type 31 | 32 | 33 | T = TypeVar("T") 34 | 35 | 36 | @define 37 | class Response(Generic[T]): 38 | """A response from an endpoint""" 39 | 40 | status_code: HTTPStatus 41 | content: bytes 42 | headers: MutableMapping[str, str] 43 | parsed: Optional[T] 44 | 45 | 46 | __all__ = ["UNSET", "File", "FileJsonType", "Response", "Unset"] 47 | -------------------------------------------------------------------------------- /src/tower/utils/tables.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | def make_table_name(name: str, namespace: Optional[str]) -> str: 4 | namespace = namespace_or_default(namespace) 5 | 6 | if "." in name: 7 | return name 8 | else: 9 | return f"{namespace}.{name}" 10 | 11 | def namespace_or_default(namespace: Optional[str]) -> str: 12 | if namespace is None: 13 | return "default" 14 | else: 15 | return namespace 16 | -------------------------------------------------------------------------------- /version.txt: -------------------------------------------------------------------------------- 1 | 0.3 2 | --------------------------------------------------------------------------------