From 8135d0ef17556b8f045c6dd70be39987bbb53baa Mon Sep 17 00:00:00 2001 From: Brad Heller Date: Thu, 23 Apr 2026 08:51:46 +0100 Subject: [PATCH 1/9] chore: Upgrade to the latest API spec (from staging, for now) --- crates/tower-api/README.md | 33 +- crates/tower-api/src/apis/configuration.rs | 4 +- crates/tower-api/src/apis/default_api.rs | 658 +++--------------- .../tower-api/src/apis/feature_flags_api.rs | 2 +- crates/tower-api/src/models/account.rs | 2 +- .../src/models/acknowledge_alert_response.rs | 2 +- .../models/acknowledge_all_alerts_response.rs | 2 +- crates/tower-api/src/models/alert.rs | 2 +- crates/tower-api/src/models/api_key.rs | 2 +- crates/tower-api/src/models/app.rs | 2 +- crates/tower-api/src/models/app_statistics.rs | 2 +- crates/tower-api/src/models/app_summary.rs | 2 +- crates/tower-api/src/models/app_version.rs | 2 +- .../src/models/authentication_context.rs | 2 +- .../src/models/batch_schedule_params.rs | 2 +- .../src/models/batch_schedule_response.rs | 2 +- .../src/models/cancel_run_response.rs | 2 +- crates/tower-api/src/models/catalog.rs | 2 +- .../tower-api/src/models/catalog_property.rs | 2 +- .../claim_device_login_ticket_params.rs | 2 +- .../claim_device_login_ticket_response.rs | 2 +- .../src/models/create_account_params.rs | 2 +- .../create_account_params_flags_struct.rs | 2 +- .../src/models/create_account_response.rs | 2 +- .../src/models/create_api_key_params.rs | 2 +- .../src/models/create_api_key_response.rs | 2 +- .../tower-api/src/models/create_app_params.rs | 2 +- .../src/models/create_app_response.rs | 2 +- .../src/models/create_catalog_params.rs | 6 +- .../src/models/create_catalog_response.rs | 2 +- .../create_device_login_ticket_response.rs | 2 +- .../src/models/create_environment_params.rs | 2 +- .../src/models/create_environment_response.rs | 2 +- .../src/models/create_guest_params.rs | 2 +- .../src/models/create_guest_response.rs | 2 +- .../models/create_sandbox_secrets_params.rs | 2 +- .../models/create_sandbox_secrets_response.rs | 2 +- .../src/models/create_schedule_params.rs | 6 +- .../src/models/create_schedule_response.rs | 2 +- .../src/models/create_secret_params.rs | 2 +- .../src/models/create_secret_response.rs | 2 +- .../src/models/create_session_params.rs | 2 +- .../src/models/create_session_response.rs | 2 +- .../src/models/create_team_params.rs | 2 +- .../src/models/create_team_response.rs | 2 +- .../src/models/create_webhook_params.rs | 2 +- .../src/models/create_webhook_response.rs | 2 +- .../src/models/delete_api_key_params.rs | 2 +- .../src/models/delete_api_key_response.rs | 2 +- .../src/models/delete_app_response.rs | 2 +- .../src/models/delete_catalog_response.rs | 2 +- .../src/models/delete_guest_output_body.rs | 2 +- .../src/models/delete_schedule_params.rs | 2 +- .../src/models/delete_schedule_response.rs | 2 +- .../src/models/delete_secret_response.rs | 2 +- .../src/models/delete_session_params.rs | 2 +- .../src/models/delete_session_response.rs | 2 +- .../models/delete_team_invitation_params.rs | 2 +- .../models/delete_team_invitation_response.rs | 2 +- .../src/models/delete_team_params.rs | 2 +- .../src/models/delete_team_response.rs | 2 +- .../src/models/delete_webhook_response.rs | 2 +- .../src/models/deploy_app_request.rs | 2 +- .../src/models/deploy_app_response.rs | 2 +- .../src/models/describe_account_body.rs | 2 +- .../src/models/describe_app_response.rs | 2 +- .../models/describe_app_version_response.rs | 2 +- .../describe_authentication_context_body.rs | 2 +- .../src/models/describe_catalog_response.rs | 2 +- .../describe_device_login_session_response.rs | 2 +- .../models/describe_email_preferences_body.rs | 2 +- .../src/models/describe_plan_response.rs | 2 +- .../src/models/describe_run_graph_response.rs | 2 +- .../src/models/describe_run_links.rs | 2 +- .../src/models/describe_run_logs_response.rs | 2 +- .../src/models/describe_run_response.rs | 2 +- .../models/describe_secrets_key_response.rs | 2 +- .../src/models/describe_session_response.rs | 2 +- .../src/models/describe_team_response.rs | 2 +- .../src/models/describe_webhook_response.rs | 2 +- .../src/models/email_subscriptions.rs | 2 +- .../src/models/encrypted_catalog_property.rs | 2 +- crates/tower-api/src/models/environment.rs | 2 +- crates/tower-api/src/models/error_detail.rs | 2 +- crates/tower-api/src/models/error_model.rs | 2 +- crates/tower-api/src/models/event_alert.rs | 2 +- crates/tower-api/src/models/event_error.rs | 2 +- crates/tower-api/src/models/event_log.rs | 2 +- .../tower-api/src/models/event_shouldertap.rs | 2 +- crates/tower-api/src/models/event_warning.rs | 2 +- .../src/models/export_catalogs_params.rs | 2 +- .../src/models/export_catalogs_response.rs | 2 +- .../src/models/export_secrets_params.rs | 2 +- .../src/models/export_secrets_response.rs | 2 +- .../tower-api/src/models/exported_catalog.rs | 2 +- .../src/models/exported_catalog_property.rs | 2 +- .../tower-api/src/models/exported_secret.rs | 2 +- crates/tower-api/src/models/feature.rs | 2 +- .../src/models/featurebase_identity.rs | 2 +- .../generate_app_statistics_response.rs | 2 +- ...organization_usage_time_series_response.rs | 34 + .../generate_run_statistics_response.rs | 2 +- .../generate_runner_credentials_response.rs | 2 +- .../models/get_feature_flag_response_body.rs | 2 +- crates/tower-api/src/models/guest.rs | 2 +- .../src/models/invite_team_member_params.rs | 2 +- .../src/models/invite_team_member_response.rs | 2 +- .../src/models/leave_team_response.rs | 2 +- .../src/models/list_alerts_response.rs | 2 +- .../src/models/list_api_keys_response.rs | 2 +- .../models/list_app_environments_response.rs | 2 +- .../src/models/list_app_versions_response.rs | 2 +- .../src/models/list_apps_response.rs | 2 +- .../src/models/list_catalogs_response.rs | 2 +- .../src/models/list_environments_response.rs | 2 +- .../src/models/list_guests_response.rs | 2 +- .../list_my_team_invitations_response.rs | 2 +- .../src/models/list_runners_response.rs | 2 +- .../src/models/list_runs_response.rs | 2 +- .../src/models/list_schedules_response.rs | 2 +- .../list_secret_environments_response.rs | 2 +- .../src/models/list_secrets_response.rs | 2 +- .../models/list_team_invitations_response.rs | 2 +- .../src/models/list_team_members_response.rs | 2 +- .../src/models/list_teams_response.rs | 2 +- .../src/models/list_webhooks_response.rs | 2 +- crates/tower-api/src/models/mod.rs | 38 +- crates/tower-api/src/models/organization.rs | 2 +- .../src/models/organization_usage.rs | 2 +- crates/tower-api/src/models/pagination.rs | 2 +- crates/tower-api/src/models/parameter.rs | 2 +- crates/tower-api/src/models/plan.rs | 2 +- .../src/models/refresh_session_params.rs | 2 +- .../src/models/refresh_session_response.rs | 2 +- .../regenerate_guest_login_url_params.rs | 2 +- .../regenerate_guest_login_url_response.rs | 2 +- .../src/models/remove_team_member_params.rs | 2 +- .../src/models/remove_team_member_response.rs | 2 +- .../models/resend_team_invitation_params.rs | 2 +- .../models/resend_team_invitation_response.rs | 2 +- crates/tower-api/src/models/run.rs | 12 +- .../src/models/run_app_initiator_data.rs | 2 +- crates/tower-api/src/models/run_app_params.rs | 2 +- .../tower-api/src/models/run_app_response.rs | 2 +- crates/tower-api/src/models/run_attempt.rs | 9 +- .../tower-api/src/models/run_failure_alert.rs | 2 +- crates/tower-api/src/models/run_graph_node.rs | 2 +- .../tower-api/src/models/run_graph_run_id.rs | 2 +- crates/tower-api/src/models/run_initiator.rs | 2 +- .../src/models/run_initiator_details.rs | 2 +- crates/tower-api/src/models/run_log_line.rs | 2 +- crates/tower-api/src/models/run_parameter.rs | 9 +- .../src/models/run_parameter_input.rs | 36 + crates/tower-api/src/models/run_results.rs | 7 +- .../tower-api/src/models/run_retry_policy.rs | 2 +- .../src/models/run_run_initiator_details.rs | 2 +- crates/tower-api/src/models/run_statistics.rs | 2 +- .../src/models/run_timeseries_point.rs | 7 +- crates/tower-api/src/models/runner.rs | 2 +- .../src/models/runner_credentials.rs | 2 +- crates/tower-api/src/models/schedule.rs | 4 +- .../models/schedule_run_initiator_details.rs | 2 +- .../src/models/search_runs_response.rs | 2 +- crates/tower-api/src/models/secret.rs | 2 +- .../src/models/server_sent_events_inner.rs | 2 +- .../src/models/server_sent_events_inner_1.rs | 2 +- .../src/models/server_sent_events_inner_2.rs | 2 +- crates/tower-api/src/models/session.rs | 2 +- crates/tower-api/src/models/shoulder_tap.rs | 2 +- crates/tower-api/src/models/sse_warning.rs | 2 +- .../src/models/statistics_settings.rs | 2 +- crates/tower-api/src/models/team.rs | 2 +- .../tower-api/src/models/team_invitation.rs | 2 +- .../tower-api/src/models/team_membership.rs | 2 +- .../src/models/test_webhook_response.rs | 2 +- crates/tower-api/src/models/token.rs | 2 +- .../src/models/update_account_params.rs | 2 +- .../src/models/update_account_response.rs | 2 +- .../models/update_app_environment_params.rs | 33 + .../models/update_app_environment_response.rs | 36 + .../tower-api/src/models/update_app_params.rs | 2 +- .../src/models/update_app_response.rs | 2 +- .../src/models/update_catalog_params.rs | 2 +- .../src/models/update_catalog_response.rs | 2 +- .../models/update_email_preferences_body.rs | 2 +- .../src/models/update_environment_params.rs | 2 +- .../src/models/update_environment_response.rs | 2 +- .../update_my_team_invitation_params.rs | 2 +- .../update_my_team_invitation_response.rs | 2 +- .../src/models/update_organization_params.rs | 2 +- .../models/update_organization_response.rs | 2 +- .../src/models/update_plan_params.rs | 2 +- .../src/models/update_plan_response.rs | 2 +- .../src/models/update_schedule_params.rs | 6 +- .../src/models/update_schedule_response.rs | 2 +- .../src/models/update_secret_params.rs | 2 +- .../src/models/update_secret_response.rs | 2 +- .../src/models/update_team_member_params.rs | 2 +- .../src/models/update_team_member_response.rs | 2 +- .../src/models/update_team_params.rs | 2 +- .../src/models/update_team_response.rs | 2 +- .../src/models/update_user_params.rs | 2 +- .../src/models/update_user_response.rs | 2 +- .../src/models/update_webhook_params.rs | 2 +- .../src/models/update_webhook_response.rs | 2 +- crates/tower-api/src/models/usage_limit.rs | 2 +- .../models/usage_metric_time_series_point.rs | 57 ++ crates/tower-api/src/models/user.rs | 2 +- crates/tower-api/src/models/webhook.rs | 2 +- src/tower/tower_api_client/__init__.py | 8 - src/tower/tower_api_client/api/__init__.py | 1 - .../tower_api_client/api/default/__init__.py | 1 - .../api/default/acknowledge_alert.py | 161 ----- .../api/default/acknowledge_all_alerts.py | 134 ---- .../api/default/activate_schedules.py | 167 ----- .../api/default/cancel_run.py | 175 ----- .../api/default/check_webhook.py | 153 ---- .../api/default/claim_device_login_ticket.py | 167 ----- .../api/default/create_account.py | 167 ----- .../api/default/create_api_key.py | 159 ----- .../api/default/create_app.py | 167 ----- .../api/default/create_authenticator.py | 171 ----- .../api/default/create_catalog.py | 167 ----- .../api/default/create_device_login_ticket.py | 136 ---- .../api/default/create_environment.py | 167 ----- .../api/default/create_guest.py | 171 ----- .../api/default/create_password_reset.py | 171 ----- .../api/default/create_sandbox_secrets.py | 167 ----- .../api/default/create_schedule.py | 167 ----- .../api/default/create_secret.py | 189 ----- .../api/default/create_session.py | 167 ----- .../api/default/create_team.py | 167 ----- .../api/default/create_webhook.py | 159 ----- .../api/default/deactivate_schedules.py | 167 ----- .../api/default/delete_alert.py | 159 ----- .../api/default/delete_api_key.py | 159 ----- .../api/default/delete_app.py | 161 ----- .../api/default/delete_authenticator.py | 167 ----- .../api/default/delete_catalog.py | 182 ----- .../api/default/delete_guest.py | 161 ----- .../api/default/delete_schedule.py | 167 ----- .../api/default/delete_secret.py | 182 ----- .../api/default/delete_session.py | 168 ----- .../api/default/delete_team.py | 167 ----- .../api/default/delete_team_invitation.py | 183 ----- .../api/default/delete_webhook.py | 153 ---- .../api/default/deploy_app.py | 256 ------- .../api/default/describe_account.py | 161 ----- .../api/default/describe_app.py | 246 ------- .../api/default/describe_app_version.py | 175 ----- .../describe_authentication_context.py | 140 ---- .../api/default/describe_catalog.py | 182 ----- .../default/describe_device_login_session.py | 163 ----- .../api/default/describe_email_preferences.py | 134 ---- .../default/describe_organization_usage.py | 134 ---- .../api/default/describe_plan.py | 181 ----- .../api/default/describe_run.py | 187 ----- .../api/default/describe_run_graph.py | 187 ----- .../api/default/describe_run_logs.py | 200 ------ .../api/default/describe_secrets_key.py | 166 ----- .../api/default/describe_session.py | 134 ---- .../api/default/describe_team.py | 161 ----- .../api/default/describe_webhook.py | 153 ---- .../api/default/export_catalogs.py | 167 ----- .../api/default/export_secrets.py | 167 ----- .../api/default/generate_app_statistics.py | 170 ----- .../api/default/generate_authenticator.py | 134 ---- .../api/default/generate_run_statistics.py | 251 ------- .../default/generate_runner_credentials.py | 140 ---- .../api/default/invite_team_member.py | 183 ----- .../api/default/leave_team.py | 165 ----- .../api/default/list_alerts.py | 271 -------- .../api/default/list_api_keys.py | 181 ----- .../api/default/list_app_environments.py | 161 ----- .../api/default/list_app_versions.py | 161 ----- .../tower_api_client/api/default/list_apps.py | 274 -------- .../api/default/list_authenticators.py | 134 ---- .../api/default/list_catalogs.py | 215 ------ .../api/default/list_environments.py | 181 ----- .../api/default/list_guests.py | 166 ----- .../api/default/list_my_team_invitations.py | 134 ---- .../api/default/list_runners.py | 181 ----- .../tower_api_client/api/default/list_runs.py | 292 -------- .../api/default/list_schedules.py | 200 ------ .../api/default/list_secret_environments.py | 134 ---- .../api/default/list_secrets.py | 215 ------ .../api/default/list_team_invitations.py | 161 ----- .../api/default/list_team_members.py | 161 ----- .../api/default/list_teams.py | 181 ----- .../api/default/list_webhooks.py | 173 ----- .../api/default/refresh_session.py | 175 ----- .../api/default/regenerate_guest_login_url.py | 189 ----- .../api/default/remove_team_member.py | 175 ----- .../api/default/resend_email_verification.py | 136 ---- .../api/default/resend_team_invitation.py | 183 ----- .../tower_api_client/api/default/run_app.py | 190 ----- .../api/default/search_runs.py | 272 -------- .../api/default/stream_alerts.py | 160 ----- .../api/default/stream_run_logs.py | 201 ------ .../api/default/stream_shouldertaps.py | 184 ----- .../api/default/update_account.py | 183 ----- .../api/default/update_app.py | 183 ----- .../api/default/update_catalog.py | 183 ----- .../api/default/update_email_preferences.py | 170 ----- .../api/default/update_environment.py | 183 ----- .../api/default/update_my_team_invitation.py | 184 ----- .../api/default/update_organization.py | 210 ------ .../api/default/update_password_reset.py | 183 ----- .../api/default/update_plan.py | 159 ----- .../api/default/update_schedule.py | 183 ----- .../api/default/update_secret.py | 183 ----- .../api/default/update_team.py | 187 ----- .../api/default/update_team_member.py | 175 ----- .../api/default/update_user.py | 167 ----- .../api/default/update_webhook.py | 187 ----- .../api/default/verify_email.py | 171 ----- .../api/feature_flags/__init__.py | 1 - .../feature_flags/get_feature_flag_value.py | 165 ----- src/tower/tower_api_client/client.py | 282 -------- src/tower/tower_api_client/errors.py | 16 - src/tower/tower_api_client/models/__init__.py | 483 ------------- src/tower/tower_api_client/models/account.py | 69 -- .../models/acknowledge_alert_response.py | 54 -- .../models/acknowledge_all_alerts_response.py | 62 -- src/tower/tower_api_client/models/alert.py | 90 --- src/tower/tower_api_client/models/api_key.py | 112 --- src/tower/tower_api_client/models/app.py | 251 ------- .../models/app_health_status.py | 9 - .../tower_api_client/models/app_statistics.py | 66 -- .../tower_api_client/models/app_status.py | 9 - .../tower_api_client/models/app_summary.py | 66 -- .../tower_api_client/models/app_version.py | 82 --- .../models/authentication_context.py | 42 -- .../models/batch_schedule_params.py | 54 -- .../models/batch_schedule_response.py | 68 -- .../models/cancel_run_response.py | 60 -- src/tower/tower_api_client/models/catalog.py | 101 --- .../models/catalog_property.py | 61 -- .../claim_device_login_ticket_params.py | 62 -- .../claim_device_login_ticket_response.py | 54 -- .../models/create_account_params.py | 62 -- .../create_account_params_flags_struct.py | 42 -- .../models/create_account_response.py | 60 -- .../models/create_api_key_params.py | 128 ---- .../models/create_api_key_response.py | 60 -- .../models/create_app_params.py | 103 --- .../models/create_app_response.py | 60 -- .../models/create_authenticator_params.py | 62 -- .../models/create_authenticator_response.py | 60 -- .../models/create_catalog_params.py | 93 --- .../models/create_catalog_params_type.py | 12 - .../models/create_catalog_response.py | 60 -- .../create_device_login_ticket_response.py | 104 --- .../models/create_environment_params.py | 54 -- .../models/create_environment_response.py | 60 -- .../models/create_guest_params.py | 82 --- .../models/create_guest_response.py | 78 --- .../models/create_password_reset_params.py | 54 -- .../models/create_password_reset_response.py | 54 -- .../models/create_sandbox_secrets_params.py | 62 -- .../models/create_sandbox_secrets_response.py | 54 -- .../models/create_schedule_params.py | 200 ------ .../create_schedule_params_overlap_policy.py | 9 - .../models/create_schedule_params_status.py | 9 - .../models/create_schedule_response.py | 60 -- .../models/create_secret_params.py | 78 --- .../models/create_secret_response.py | 60 -- .../models/create_session_params.py | 72 -- .../models/create_session_response.py | 60 -- .../models/create_team_params.py | 54 -- .../models/create_team_response.py | 60 -- .../models/create_webhook_params.py | 62 -- .../models/create_webhook_response.py | 68 -- .../models/delete_api_key_params.py | 54 -- .../models/delete_api_key_response.py | 60 -- .../models/delete_app_response.py | 60 -- .../models/delete_authenticator_params.py | 54 -- .../models/delete_authenticator_response.py | 60 -- .../models/delete_catalog_response.py | 60 -- .../models/delete_guest_output_body.py | 43 -- .../models/delete_schedule_params.py | 54 -- .../models/delete_schedule_response.py | 68 -- .../models/delete_secret_response.py | 60 -- .../models/delete_session_params.py | 52 -- .../models/delete_session_response.py | 60 -- .../models/delete_team_invitation_params.py | 54 -- .../models/delete_team_invitation_response.py | 60 -- .../models/delete_team_params.py | 54 -- .../models/delete_team_response.py | 60 -- .../models/delete_webhook_response.py | 60 -- .../models/deploy_app_json_body.py | 64 -- .../models/deploy_app_response.py | 60 -- .../models/describe_account_body.py | 60 -- .../models/describe_app_response.py | 78 --- .../models/describe_app_version_response.py | 60 -- .../describe_authentication_context_body.py | 62 -- .../models/describe_catalog_response.py | 60 -- .../describe_device_login_session_response.py | 60 -- .../models/describe_email_preferences_body.py | 60 -- .../models/describe_plan_response.py | 60 -- .../models/describe_run_graph_response.py | 68 -- .../models/describe_run_links.py | 99 --- .../models/describe_run_logs_response.py | 68 -- .../models/describe_run_response.py | 70 -- .../models/describe_secrets_key_response.py | 54 -- .../models/describe_session_response.py | 60 -- .../models/describe_team_response.py | 96 --- .../models/describe_webhook_response.py | 60 -- .../models/email_subscriptions.py | 60 -- .../models/encrypted_catalog_property.py | 58 -- .../tower_api_client/models/environment.py | 42 -- .../tower_api_client/models/error_detail.py | 60 -- .../tower_api_client/models/error_model.py | 119 ---- .../models/export_catalogs_params.py | 86 --- .../models/export_catalogs_response.py | 78 --- .../models/export_secrets_params.py | 86 --- .../models/export_secrets_response.py | 78 --- .../models/exported_catalog.py | 101 --- .../models/exported_catalog_property.py | 69 -- .../models/exported_secret.py | 68 -- src/tower/tower_api_client/models/feature.py | 66 -- .../models/featurebase_identity.py | 50 -- .../generate_app_statistics_response.py | 60 -- .../models/generate_authenticator_response.py | 60 -- .../generate_run_statistics_response.py | 88 --- .../generate_run_statistics_status_item.py | 14 - .../generate_runner_credentials_response.py | 60 -- .../models/get_feature_flag_response_body.py | 81 --- ...t_feature_flag_response_body_value_type.py | 11 - src/tower/tower_api_client/models/guest.py | 71 -- .../models/invite_team_member_params.py | 74 -- .../models/invite_team_member_params_role.py | 9 - .../models/invite_team_member_response.py | 68 -- .../models/leave_team_response.py | 60 -- .../models/list_alerts_response.py | 78 --- .../models/list_api_keys_response.py | 78 --- .../models/list_app_environments_response.py | 54 -- .../models/list_app_versions_response.py | 68 -- .../models/list_apps_filter.py | 12 - .../models/list_apps_response.py | 78 --- .../tower_api_client/models/list_apps_sort.py | 11 - .../models/list_authenticators_response.py | 70 -- .../models/list_catalogs_response.py | 78 --- .../models/list_environments_response.py | 78 --- .../models/list_guests_response.py | 68 -- .../list_my_team_invitations_response.py | 68 -- .../models/list_runners_response.py | 78 --- .../models/list_runs_response.py | 78 --- .../models/list_runs_status_item.py | 14 - .../models/list_schedules_response.py | 78 --- .../list_secret_environments_response.py | 54 -- .../models/list_secrets_response.py | 78 --- .../models/list_team_invitations_response.py | 68 -- .../models/list_team_members_response.py | 68 -- .../models/list_teams_response.py | 78 --- .../models/list_webhooks_response.py | 78 --- .../tower_api_client/models/organization.py | 56 -- .../models/organization_usage.py | 108 --- .../tower_api_client/models/pagination.py | 66 -- .../tower_api_client/models/parameter.py | 69 -- src/tower/tower_api_client/models/plan.py | 129 ---- .../models/refresh_session_params.py | 52 -- .../models/refresh_session_response.py | 70 -- .../regenerate_guest_login_url_params.py | 62 -- .../regenerate_guest_login_url_response.py | 64 -- .../models/remove_team_member_params.py | 54 -- .../models/remove_team_member_response.py | 60 -- .../models/resend_team_invitation_params.py | 63 -- .../models/resend_team_invitation_response.py | 60 -- src/tower/tower_api_client/models/run.py | 338 --------- .../models/run_app_initiator_data.py | 44 -- .../models/run_app_initiator_data_type.py | 10 - .../tower_api_client/models/run_app_params.py | 125 ---- .../models/run_app_params_parameters.py | 46 -- .../models/run_app_response.py | 60 -- .../tower_api_client/models/run_attempt.py | 117 ---- .../models/run_failure_alert.py | 66 -- .../tower_api_client/models/run_graph_node.py | 56 -- .../models/run_graph_run_id.py | 50 -- .../tower_api_client/models/run_initiator.py | 89 --- .../tower_api_client/models/run_log_line.py | 113 --- .../models/run_log_line_channel.py | 9 - .../tower_api_client/models/run_parameter.py | 61 -- .../tower_api_client/models/run_results.py | 90 --- .../models/run_retry_policy.py | 58 -- .../models/run_run_initiator_details.py | 51 -- .../tower_api_client/models/run_statistics.py | 82 --- .../tower_api_client/models/run_status.py | 15 - .../models/run_status_group.py | 10 - .../models/run_timeseries_point.py | 108 --- src/tower/tower_api_client/models/runner.py | 116 --- .../models/runner_credentials.py | 74 -- src/tower/tower_api_client/models/schedule.py | 166 ----- .../models/schedule_app_status.py | 9 - .../models/schedule_overlap_policy.py | 9 - .../models/schedule_run_initiator_details.py | 42 -- .../models/schedule_status.py | 9 - .../models/search_runs_response.py | 78 --- .../models/search_runs_status_item.py | 14 - src/tower/tower_api_client/models/secret.py | 68 -- src/tower/tower_api_client/models/session.py | 88 --- .../tower_api_client/models/shoulder_tap.py | 76 -- .../tower_api_client/models/sse_warning.py | 52 -- .../models/statistics_settings.py | 78 --- .../models/statistics_settings_interval.py | 9 - .../models/stream_alerts_event_alert.py | 103 --- .../models/stream_alerts_event_error.py | 103 --- .../models/stream_run_logs_event_log.py | 103 --- .../models/stream_run_logs_event_warning.py | 103 --- .../stream_shouldertaps_event_shouldertap.py | 103 --- .../stream_shouldertaps_event_warning.py | 103 --- src/tower/tower_api_client/models/team.py | 99 --- .../models/team_invitation.py | 74 -- .../models/team_membership.py | 68 -- .../models/team_membership_role.py | 9 - .../models/test_webhook_response.py | 60 -- src/tower/tower_api_client/models/token.py | 63 -- .../models/unverified_authenticator.py | 66 -- .../models/update_account_params.py | 81 --- .../update_account_params_execution_region.py | 9 - .../models/update_account_response.py | 60 -- .../models/update_app_params.py | 191 ----- .../models/update_app_response.py | 70 -- .../models/update_catalog_params.py | 76 -- .../models/update_catalog_response.py | 60 -- .../models/update_email_preferences_body.py | 60 -- .../models/update_environment_params.py | 54 -- .../models/update_environment_response.py | 60 -- .../update_my_team_invitation_params.py | 62 -- .../update_my_team_invitation_response.py | 43 -- .../models/update_organization_params.py | 53 -- .../models/update_organization_response.py | 60 -- .../models/update_password_reset_params.py | 54 -- .../models/update_password_reset_response.py | 54 -- .../models/update_plan_params.py | 54 -- .../models/update_plan_response.py | 60 -- .../models/update_schedule_params.py | 186 ----- .../update_schedule_params_overlap_policy.py | 9 - .../models/update_schedule_params_status.py | 9 - .../models/update_schedule_response.py | 60 -- .../models/update_secret_params.py | 70 -- .../models/update_secret_response.py | 60 -- .../models/update_team_member_params.py | 71 -- .../models/update_team_member_params_role.py | 9 - .../models/update_team_member_response.py | 60 -- .../models/update_team_params.py | 80 --- .../update_team_params_execution_region.py | 9 - .../models/update_team_response.py | 60 -- .../models/update_user_params.py | 254 ------- .../models/update_user_response.py | 60 -- .../models/update_webhook_params.py | 54 -- .../models/update_webhook_response.py | 60 -- .../tower_api_client/models/usage_limit.py | 51 -- src/tower/tower_api_client/models/user.py | 135 ---- .../models/verified_authenticator.py | 68 -- .../models/verify_email_params.py | 54 -- .../models/verify_email_response.py | 60 -- src/tower/tower_api_client/models/webhook.py | 128 ---- .../tower_api_client/models/webhook_state.py | 10 - src/tower/tower_api_client/types.py | 54 -- 560 files changed, 574 insertions(+), 36172 deletions(-) create mode 100644 crates/tower-api/src/models/generate_organization_usage_time_series_response.rs create mode 100644 crates/tower-api/src/models/run_parameter_input.rs create mode 100644 crates/tower-api/src/models/update_app_environment_params.rs create mode 100644 crates/tower-api/src/models/update_app_environment_response.rs create mode 100644 crates/tower-api/src/models/usage_metric_time_series_point.rs delete mode 100644 src/tower/tower_api_client/__init__.py delete mode 100644 src/tower/tower_api_client/api/__init__.py delete mode 100644 src/tower/tower_api_client/api/default/__init__.py delete mode 100644 src/tower/tower_api_client/api/default/acknowledge_alert.py delete mode 100644 src/tower/tower_api_client/api/default/acknowledge_all_alerts.py delete mode 100644 src/tower/tower_api_client/api/default/activate_schedules.py delete mode 100644 src/tower/tower_api_client/api/default/cancel_run.py delete mode 100644 src/tower/tower_api_client/api/default/check_webhook.py delete mode 100644 src/tower/tower_api_client/api/default/claim_device_login_ticket.py delete mode 100644 src/tower/tower_api_client/api/default/create_account.py delete mode 100644 src/tower/tower_api_client/api/default/create_api_key.py delete mode 100644 src/tower/tower_api_client/api/default/create_app.py delete mode 100644 src/tower/tower_api_client/api/default/create_authenticator.py delete mode 100644 src/tower/tower_api_client/api/default/create_catalog.py delete mode 100644 src/tower/tower_api_client/api/default/create_device_login_ticket.py delete mode 100644 src/tower/tower_api_client/api/default/create_environment.py delete mode 100644 src/tower/tower_api_client/api/default/create_guest.py delete mode 100644 src/tower/tower_api_client/api/default/create_password_reset.py delete mode 100644 src/tower/tower_api_client/api/default/create_sandbox_secrets.py delete mode 100644 src/tower/tower_api_client/api/default/create_schedule.py delete mode 100644 src/tower/tower_api_client/api/default/create_secret.py delete mode 100644 src/tower/tower_api_client/api/default/create_session.py delete mode 100644 src/tower/tower_api_client/api/default/create_team.py delete mode 100644 src/tower/tower_api_client/api/default/create_webhook.py delete mode 100644 src/tower/tower_api_client/api/default/deactivate_schedules.py delete mode 100644 src/tower/tower_api_client/api/default/delete_alert.py delete mode 100644 src/tower/tower_api_client/api/default/delete_api_key.py delete mode 100644 src/tower/tower_api_client/api/default/delete_app.py delete mode 100644 src/tower/tower_api_client/api/default/delete_authenticator.py delete mode 100644 src/tower/tower_api_client/api/default/delete_catalog.py delete mode 100644 src/tower/tower_api_client/api/default/delete_guest.py delete mode 100644 src/tower/tower_api_client/api/default/delete_schedule.py delete mode 100644 src/tower/tower_api_client/api/default/delete_secret.py delete mode 100644 src/tower/tower_api_client/api/default/delete_session.py delete mode 100644 src/tower/tower_api_client/api/default/delete_team.py delete mode 100644 src/tower/tower_api_client/api/default/delete_team_invitation.py delete mode 100644 src/tower/tower_api_client/api/default/delete_webhook.py delete mode 100644 src/tower/tower_api_client/api/default/deploy_app.py delete mode 100644 src/tower/tower_api_client/api/default/describe_account.py delete mode 100644 src/tower/tower_api_client/api/default/describe_app.py delete mode 100644 src/tower/tower_api_client/api/default/describe_app_version.py delete mode 100644 src/tower/tower_api_client/api/default/describe_authentication_context.py delete mode 100644 src/tower/tower_api_client/api/default/describe_catalog.py delete mode 100644 src/tower/tower_api_client/api/default/describe_device_login_session.py delete mode 100644 src/tower/tower_api_client/api/default/describe_email_preferences.py delete mode 100644 src/tower/tower_api_client/api/default/describe_organization_usage.py delete mode 100644 src/tower/tower_api_client/api/default/describe_plan.py delete mode 100644 src/tower/tower_api_client/api/default/describe_run.py delete mode 100644 src/tower/tower_api_client/api/default/describe_run_graph.py delete mode 100644 src/tower/tower_api_client/api/default/describe_run_logs.py delete mode 100644 src/tower/tower_api_client/api/default/describe_secrets_key.py delete mode 100644 src/tower/tower_api_client/api/default/describe_session.py delete mode 100644 src/tower/tower_api_client/api/default/describe_team.py delete mode 100644 src/tower/tower_api_client/api/default/describe_webhook.py delete mode 100644 src/tower/tower_api_client/api/default/export_catalogs.py delete mode 100644 src/tower/tower_api_client/api/default/export_secrets.py delete mode 100644 src/tower/tower_api_client/api/default/generate_app_statistics.py delete mode 100644 src/tower/tower_api_client/api/default/generate_authenticator.py delete mode 100644 src/tower/tower_api_client/api/default/generate_run_statistics.py delete mode 100644 src/tower/tower_api_client/api/default/generate_runner_credentials.py delete mode 100644 src/tower/tower_api_client/api/default/invite_team_member.py delete mode 100644 src/tower/tower_api_client/api/default/leave_team.py delete mode 100644 src/tower/tower_api_client/api/default/list_alerts.py delete mode 100644 src/tower/tower_api_client/api/default/list_api_keys.py delete mode 100644 src/tower/tower_api_client/api/default/list_app_environments.py delete mode 100644 src/tower/tower_api_client/api/default/list_app_versions.py delete mode 100644 src/tower/tower_api_client/api/default/list_apps.py delete mode 100644 src/tower/tower_api_client/api/default/list_authenticators.py delete mode 100644 src/tower/tower_api_client/api/default/list_catalogs.py delete mode 100644 src/tower/tower_api_client/api/default/list_environments.py delete mode 100644 src/tower/tower_api_client/api/default/list_guests.py delete mode 100644 src/tower/tower_api_client/api/default/list_my_team_invitations.py delete mode 100644 src/tower/tower_api_client/api/default/list_runners.py delete mode 100644 src/tower/tower_api_client/api/default/list_runs.py delete mode 100644 src/tower/tower_api_client/api/default/list_schedules.py delete mode 100644 src/tower/tower_api_client/api/default/list_secret_environments.py delete mode 100644 src/tower/tower_api_client/api/default/list_secrets.py delete mode 100644 src/tower/tower_api_client/api/default/list_team_invitations.py delete mode 100644 src/tower/tower_api_client/api/default/list_team_members.py delete mode 100644 src/tower/tower_api_client/api/default/list_teams.py delete mode 100644 src/tower/tower_api_client/api/default/list_webhooks.py delete mode 100644 src/tower/tower_api_client/api/default/refresh_session.py delete mode 100644 src/tower/tower_api_client/api/default/regenerate_guest_login_url.py delete mode 100644 src/tower/tower_api_client/api/default/remove_team_member.py delete mode 100644 src/tower/tower_api_client/api/default/resend_email_verification.py delete mode 100644 src/tower/tower_api_client/api/default/resend_team_invitation.py delete mode 100644 src/tower/tower_api_client/api/default/run_app.py delete mode 100644 src/tower/tower_api_client/api/default/search_runs.py delete mode 100644 src/tower/tower_api_client/api/default/stream_alerts.py delete mode 100644 src/tower/tower_api_client/api/default/stream_run_logs.py delete mode 100644 src/tower/tower_api_client/api/default/stream_shouldertaps.py delete mode 100644 src/tower/tower_api_client/api/default/update_account.py delete mode 100644 src/tower/tower_api_client/api/default/update_app.py delete mode 100644 src/tower/tower_api_client/api/default/update_catalog.py delete mode 100644 src/tower/tower_api_client/api/default/update_email_preferences.py delete mode 100644 src/tower/tower_api_client/api/default/update_environment.py delete mode 100644 src/tower/tower_api_client/api/default/update_my_team_invitation.py delete mode 100644 src/tower/tower_api_client/api/default/update_organization.py delete mode 100644 src/tower/tower_api_client/api/default/update_password_reset.py delete mode 100644 src/tower/tower_api_client/api/default/update_plan.py delete mode 100644 src/tower/tower_api_client/api/default/update_schedule.py delete mode 100644 src/tower/tower_api_client/api/default/update_secret.py delete mode 100644 src/tower/tower_api_client/api/default/update_team.py delete mode 100644 src/tower/tower_api_client/api/default/update_team_member.py delete mode 100644 src/tower/tower_api_client/api/default/update_user.py delete mode 100644 src/tower/tower_api_client/api/default/update_webhook.py delete mode 100644 src/tower/tower_api_client/api/default/verify_email.py delete mode 100644 src/tower/tower_api_client/api/feature_flags/__init__.py delete mode 100644 src/tower/tower_api_client/api/feature_flags/get_feature_flag_value.py delete mode 100644 src/tower/tower_api_client/client.py delete mode 100644 src/tower/tower_api_client/errors.py delete mode 100644 src/tower/tower_api_client/models/__init__.py delete mode 100644 src/tower/tower_api_client/models/account.py delete mode 100644 src/tower/tower_api_client/models/acknowledge_alert_response.py delete mode 100644 src/tower/tower_api_client/models/acknowledge_all_alerts_response.py delete mode 100644 src/tower/tower_api_client/models/alert.py delete mode 100644 src/tower/tower_api_client/models/api_key.py delete mode 100644 src/tower/tower_api_client/models/app.py delete mode 100644 src/tower/tower_api_client/models/app_health_status.py delete mode 100644 src/tower/tower_api_client/models/app_statistics.py delete mode 100644 src/tower/tower_api_client/models/app_status.py delete mode 100644 src/tower/tower_api_client/models/app_summary.py delete mode 100644 src/tower/tower_api_client/models/app_version.py delete mode 100644 src/tower/tower_api_client/models/authentication_context.py delete mode 100644 src/tower/tower_api_client/models/batch_schedule_params.py delete mode 100644 src/tower/tower_api_client/models/batch_schedule_response.py delete mode 100644 src/tower/tower_api_client/models/cancel_run_response.py delete mode 100644 src/tower/tower_api_client/models/catalog.py delete mode 100644 src/tower/tower_api_client/models/catalog_property.py delete mode 100644 src/tower/tower_api_client/models/claim_device_login_ticket_params.py delete mode 100644 src/tower/tower_api_client/models/claim_device_login_ticket_response.py delete mode 100644 src/tower/tower_api_client/models/create_account_params.py delete mode 100644 src/tower/tower_api_client/models/create_account_params_flags_struct.py delete mode 100644 src/tower/tower_api_client/models/create_account_response.py delete mode 100644 src/tower/tower_api_client/models/create_api_key_params.py delete mode 100644 src/tower/tower_api_client/models/create_api_key_response.py delete mode 100644 src/tower/tower_api_client/models/create_app_params.py delete mode 100644 src/tower/tower_api_client/models/create_app_response.py delete mode 100644 src/tower/tower_api_client/models/create_authenticator_params.py delete mode 100644 src/tower/tower_api_client/models/create_authenticator_response.py delete mode 100644 src/tower/tower_api_client/models/create_catalog_params.py delete mode 100644 src/tower/tower_api_client/models/create_catalog_params_type.py delete mode 100644 src/tower/tower_api_client/models/create_catalog_response.py delete mode 100644 src/tower/tower_api_client/models/create_device_login_ticket_response.py delete mode 100644 src/tower/tower_api_client/models/create_environment_params.py delete mode 100644 src/tower/tower_api_client/models/create_environment_response.py delete mode 100644 src/tower/tower_api_client/models/create_guest_params.py delete mode 100644 src/tower/tower_api_client/models/create_guest_response.py delete mode 100644 src/tower/tower_api_client/models/create_password_reset_params.py delete mode 100644 src/tower/tower_api_client/models/create_password_reset_response.py delete mode 100644 src/tower/tower_api_client/models/create_sandbox_secrets_params.py delete mode 100644 src/tower/tower_api_client/models/create_sandbox_secrets_response.py delete mode 100644 src/tower/tower_api_client/models/create_schedule_params.py delete mode 100644 src/tower/tower_api_client/models/create_schedule_params_overlap_policy.py delete mode 100644 src/tower/tower_api_client/models/create_schedule_params_status.py delete mode 100644 src/tower/tower_api_client/models/create_schedule_response.py delete mode 100644 src/tower/tower_api_client/models/create_secret_params.py delete mode 100644 src/tower/tower_api_client/models/create_secret_response.py delete mode 100644 src/tower/tower_api_client/models/create_session_params.py delete mode 100644 src/tower/tower_api_client/models/create_session_response.py delete mode 100644 src/tower/tower_api_client/models/create_team_params.py delete mode 100644 src/tower/tower_api_client/models/create_team_response.py delete mode 100644 src/tower/tower_api_client/models/create_webhook_params.py delete mode 100644 src/tower/tower_api_client/models/create_webhook_response.py delete mode 100644 src/tower/tower_api_client/models/delete_api_key_params.py delete mode 100644 src/tower/tower_api_client/models/delete_api_key_response.py delete mode 100644 src/tower/tower_api_client/models/delete_app_response.py delete mode 100644 src/tower/tower_api_client/models/delete_authenticator_params.py delete mode 100644 src/tower/tower_api_client/models/delete_authenticator_response.py delete mode 100644 src/tower/tower_api_client/models/delete_catalog_response.py delete mode 100644 src/tower/tower_api_client/models/delete_guest_output_body.py delete mode 100644 src/tower/tower_api_client/models/delete_schedule_params.py delete mode 100644 src/tower/tower_api_client/models/delete_schedule_response.py delete mode 100644 src/tower/tower_api_client/models/delete_secret_response.py delete mode 100644 src/tower/tower_api_client/models/delete_session_params.py delete mode 100644 src/tower/tower_api_client/models/delete_session_response.py delete mode 100644 src/tower/tower_api_client/models/delete_team_invitation_params.py delete mode 100644 src/tower/tower_api_client/models/delete_team_invitation_response.py delete mode 100644 src/tower/tower_api_client/models/delete_team_params.py delete mode 100644 src/tower/tower_api_client/models/delete_team_response.py delete mode 100644 src/tower/tower_api_client/models/delete_webhook_response.py delete mode 100644 src/tower/tower_api_client/models/deploy_app_json_body.py delete mode 100644 src/tower/tower_api_client/models/deploy_app_response.py delete mode 100644 src/tower/tower_api_client/models/describe_account_body.py delete mode 100644 src/tower/tower_api_client/models/describe_app_response.py delete mode 100644 src/tower/tower_api_client/models/describe_app_version_response.py delete mode 100644 src/tower/tower_api_client/models/describe_authentication_context_body.py delete mode 100644 src/tower/tower_api_client/models/describe_catalog_response.py delete mode 100644 src/tower/tower_api_client/models/describe_device_login_session_response.py delete mode 100644 src/tower/tower_api_client/models/describe_email_preferences_body.py delete mode 100644 src/tower/tower_api_client/models/describe_plan_response.py delete mode 100644 src/tower/tower_api_client/models/describe_run_graph_response.py delete mode 100644 src/tower/tower_api_client/models/describe_run_links.py delete mode 100644 src/tower/tower_api_client/models/describe_run_logs_response.py delete mode 100644 src/tower/tower_api_client/models/describe_run_response.py delete mode 100644 src/tower/tower_api_client/models/describe_secrets_key_response.py delete mode 100644 src/tower/tower_api_client/models/describe_session_response.py delete mode 100644 src/tower/tower_api_client/models/describe_team_response.py delete mode 100644 src/tower/tower_api_client/models/describe_webhook_response.py delete mode 100644 src/tower/tower_api_client/models/email_subscriptions.py delete mode 100644 src/tower/tower_api_client/models/encrypted_catalog_property.py delete mode 100644 src/tower/tower_api_client/models/environment.py delete mode 100644 src/tower/tower_api_client/models/error_detail.py delete mode 100644 src/tower/tower_api_client/models/error_model.py delete mode 100644 src/tower/tower_api_client/models/export_catalogs_params.py delete mode 100644 src/tower/tower_api_client/models/export_catalogs_response.py delete mode 100644 src/tower/tower_api_client/models/export_secrets_params.py delete mode 100644 src/tower/tower_api_client/models/export_secrets_response.py delete mode 100644 src/tower/tower_api_client/models/exported_catalog.py delete mode 100644 src/tower/tower_api_client/models/exported_catalog_property.py delete mode 100644 src/tower/tower_api_client/models/exported_secret.py delete mode 100644 src/tower/tower_api_client/models/feature.py delete mode 100644 src/tower/tower_api_client/models/featurebase_identity.py delete mode 100644 src/tower/tower_api_client/models/generate_app_statistics_response.py delete mode 100644 src/tower/tower_api_client/models/generate_authenticator_response.py delete mode 100644 src/tower/tower_api_client/models/generate_run_statistics_response.py delete mode 100644 src/tower/tower_api_client/models/generate_run_statistics_status_item.py delete mode 100644 src/tower/tower_api_client/models/generate_runner_credentials_response.py delete mode 100644 src/tower/tower_api_client/models/get_feature_flag_response_body.py delete mode 100644 src/tower/tower_api_client/models/get_feature_flag_response_body_value_type.py delete mode 100644 src/tower/tower_api_client/models/guest.py delete mode 100644 src/tower/tower_api_client/models/invite_team_member_params.py delete mode 100644 src/tower/tower_api_client/models/invite_team_member_params_role.py delete mode 100644 src/tower/tower_api_client/models/invite_team_member_response.py delete mode 100644 src/tower/tower_api_client/models/leave_team_response.py delete mode 100644 src/tower/tower_api_client/models/list_alerts_response.py delete mode 100644 src/tower/tower_api_client/models/list_api_keys_response.py delete mode 100644 src/tower/tower_api_client/models/list_app_environments_response.py delete mode 100644 src/tower/tower_api_client/models/list_app_versions_response.py delete mode 100644 src/tower/tower_api_client/models/list_apps_filter.py delete mode 100644 src/tower/tower_api_client/models/list_apps_response.py delete mode 100644 src/tower/tower_api_client/models/list_apps_sort.py delete mode 100644 src/tower/tower_api_client/models/list_authenticators_response.py delete mode 100644 src/tower/tower_api_client/models/list_catalogs_response.py delete mode 100644 src/tower/tower_api_client/models/list_environments_response.py delete mode 100644 src/tower/tower_api_client/models/list_guests_response.py delete mode 100644 src/tower/tower_api_client/models/list_my_team_invitations_response.py delete mode 100644 src/tower/tower_api_client/models/list_runners_response.py delete mode 100644 src/tower/tower_api_client/models/list_runs_response.py delete mode 100644 src/tower/tower_api_client/models/list_runs_status_item.py delete mode 100644 src/tower/tower_api_client/models/list_schedules_response.py delete mode 100644 src/tower/tower_api_client/models/list_secret_environments_response.py delete mode 100644 src/tower/tower_api_client/models/list_secrets_response.py delete mode 100644 src/tower/tower_api_client/models/list_team_invitations_response.py delete mode 100644 src/tower/tower_api_client/models/list_team_members_response.py delete mode 100644 src/tower/tower_api_client/models/list_teams_response.py delete mode 100644 src/tower/tower_api_client/models/list_webhooks_response.py delete mode 100644 src/tower/tower_api_client/models/organization.py delete mode 100644 src/tower/tower_api_client/models/organization_usage.py delete mode 100644 src/tower/tower_api_client/models/pagination.py delete mode 100644 src/tower/tower_api_client/models/parameter.py delete mode 100644 src/tower/tower_api_client/models/plan.py delete mode 100644 src/tower/tower_api_client/models/refresh_session_params.py delete mode 100644 src/tower/tower_api_client/models/refresh_session_response.py delete mode 100644 src/tower/tower_api_client/models/regenerate_guest_login_url_params.py delete mode 100644 src/tower/tower_api_client/models/regenerate_guest_login_url_response.py delete mode 100644 src/tower/tower_api_client/models/remove_team_member_params.py delete mode 100644 src/tower/tower_api_client/models/remove_team_member_response.py delete mode 100644 src/tower/tower_api_client/models/resend_team_invitation_params.py delete mode 100644 src/tower/tower_api_client/models/resend_team_invitation_response.py delete mode 100644 src/tower/tower_api_client/models/run.py delete mode 100644 src/tower/tower_api_client/models/run_app_initiator_data.py delete mode 100644 src/tower/tower_api_client/models/run_app_initiator_data_type.py delete mode 100644 src/tower/tower_api_client/models/run_app_params.py delete mode 100644 src/tower/tower_api_client/models/run_app_params_parameters.py delete mode 100644 src/tower/tower_api_client/models/run_app_response.py delete mode 100644 src/tower/tower_api_client/models/run_attempt.py delete mode 100644 src/tower/tower_api_client/models/run_failure_alert.py delete mode 100644 src/tower/tower_api_client/models/run_graph_node.py delete mode 100644 src/tower/tower_api_client/models/run_graph_run_id.py delete mode 100644 src/tower/tower_api_client/models/run_initiator.py delete mode 100644 src/tower/tower_api_client/models/run_log_line.py delete mode 100644 src/tower/tower_api_client/models/run_log_line_channel.py delete mode 100644 src/tower/tower_api_client/models/run_parameter.py delete mode 100644 src/tower/tower_api_client/models/run_results.py delete mode 100644 src/tower/tower_api_client/models/run_retry_policy.py delete mode 100644 src/tower/tower_api_client/models/run_run_initiator_details.py delete mode 100644 src/tower/tower_api_client/models/run_statistics.py delete mode 100644 src/tower/tower_api_client/models/run_status.py delete mode 100644 src/tower/tower_api_client/models/run_status_group.py delete mode 100644 src/tower/tower_api_client/models/run_timeseries_point.py delete mode 100644 src/tower/tower_api_client/models/runner.py delete mode 100644 src/tower/tower_api_client/models/runner_credentials.py delete mode 100644 src/tower/tower_api_client/models/schedule.py delete mode 100644 src/tower/tower_api_client/models/schedule_app_status.py delete mode 100644 src/tower/tower_api_client/models/schedule_overlap_policy.py delete mode 100644 src/tower/tower_api_client/models/schedule_run_initiator_details.py delete mode 100644 src/tower/tower_api_client/models/schedule_status.py delete mode 100644 src/tower/tower_api_client/models/search_runs_response.py delete mode 100644 src/tower/tower_api_client/models/search_runs_status_item.py delete mode 100644 src/tower/tower_api_client/models/secret.py delete mode 100644 src/tower/tower_api_client/models/session.py delete mode 100644 src/tower/tower_api_client/models/shoulder_tap.py delete mode 100644 src/tower/tower_api_client/models/sse_warning.py delete mode 100644 src/tower/tower_api_client/models/statistics_settings.py delete mode 100644 src/tower/tower_api_client/models/statistics_settings_interval.py delete mode 100644 src/tower/tower_api_client/models/stream_alerts_event_alert.py delete mode 100644 src/tower/tower_api_client/models/stream_alerts_event_error.py delete mode 100644 src/tower/tower_api_client/models/stream_run_logs_event_log.py delete mode 100644 src/tower/tower_api_client/models/stream_run_logs_event_warning.py delete mode 100644 src/tower/tower_api_client/models/stream_shouldertaps_event_shouldertap.py delete mode 100644 src/tower/tower_api_client/models/stream_shouldertaps_event_warning.py delete mode 100644 src/tower/tower_api_client/models/team.py delete mode 100644 src/tower/tower_api_client/models/team_invitation.py delete mode 100644 src/tower/tower_api_client/models/team_membership.py delete mode 100644 src/tower/tower_api_client/models/team_membership_role.py delete mode 100644 src/tower/tower_api_client/models/test_webhook_response.py delete mode 100644 src/tower/tower_api_client/models/token.py delete mode 100644 src/tower/tower_api_client/models/unverified_authenticator.py delete mode 100644 src/tower/tower_api_client/models/update_account_params.py delete mode 100644 src/tower/tower_api_client/models/update_account_params_execution_region.py delete mode 100644 src/tower/tower_api_client/models/update_account_response.py delete mode 100644 src/tower/tower_api_client/models/update_app_params.py delete mode 100644 src/tower/tower_api_client/models/update_app_response.py delete mode 100644 src/tower/tower_api_client/models/update_catalog_params.py delete mode 100644 src/tower/tower_api_client/models/update_catalog_response.py delete mode 100644 src/tower/tower_api_client/models/update_email_preferences_body.py delete mode 100644 src/tower/tower_api_client/models/update_environment_params.py delete mode 100644 src/tower/tower_api_client/models/update_environment_response.py delete mode 100644 src/tower/tower_api_client/models/update_my_team_invitation_params.py delete mode 100644 src/tower/tower_api_client/models/update_my_team_invitation_response.py delete mode 100644 src/tower/tower_api_client/models/update_organization_params.py delete mode 100644 src/tower/tower_api_client/models/update_organization_response.py delete mode 100644 src/tower/tower_api_client/models/update_password_reset_params.py delete mode 100644 src/tower/tower_api_client/models/update_password_reset_response.py delete mode 100644 src/tower/tower_api_client/models/update_plan_params.py delete mode 100644 src/tower/tower_api_client/models/update_plan_response.py delete mode 100644 src/tower/tower_api_client/models/update_schedule_params.py delete mode 100644 src/tower/tower_api_client/models/update_schedule_params_overlap_policy.py delete mode 100644 src/tower/tower_api_client/models/update_schedule_params_status.py delete mode 100644 src/tower/tower_api_client/models/update_schedule_response.py delete mode 100644 src/tower/tower_api_client/models/update_secret_params.py delete mode 100644 src/tower/tower_api_client/models/update_secret_response.py delete mode 100644 src/tower/tower_api_client/models/update_team_member_params.py delete mode 100644 src/tower/tower_api_client/models/update_team_member_params_role.py delete mode 100644 src/tower/tower_api_client/models/update_team_member_response.py delete mode 100644 src/tower/tower_api_client/models/update_team_params.py delete mode 100644 src/tower/tower_api_client/models/update_team_params_execution_region.py delete mode 100644 src/tower/tower_api_client/models/update_team_response.py delete mode 100644 src/tower/tower_api_client/models/update_user_params.py delete mode 100644 src/tower/tower_api_client/models/update_user_response.py delete mode 100644 src/tower/tower_api_client/models/update_webhook_params.py delete mode 100644 src/tower/tower_api_client/models/update_webhook_response.py delete mode 100644 src/tower/tower_api_client/models/usage_limit.py delete mode 100644 src/tower/tower_api_client/models/user.py delete mode 100644 src/tower/tower_api_client/models/verified_authenticator.py delete mode 100644 src/tower/tower_api_client/models/verify_email_params.py delete mode 100644 src/tower/tower_api_client/models/verify_email_response.py delete mode 100644 src/tower/tower_api_client/models/webhook.py delete mode 100644 src/tower/tower_api_client/models/webhook_state.py delete mode 100644 src/tower/tower_api_client/types.py diff --git a/crates/tower-api/README.md b/crates/tower-api/README.md index cf17a590..ed3f5e46 100644 --- a/crates/tower-api/README.md +++ b/crates/tower-api/README.md @@ -8,7 +8,7 @@ For more information, please visit [https://tower.dev](https://tower.dev) This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. -- API version: v0.10.17 +- API version: 0.10.23-preview - Package version: 1.0.0 - Generator version: 7.19.0 - Build package: `org.openapitools.codegen.languages.RustClientCodegen` @@ -23,7 +23,7 @@ tower-api = { path = "./tower-api" } ## Documentation for API Endpoints -All URIs are relative to *https://api.tower.dev/v1* +All URIs are relative to *https://api.staging.tower-dev.net/v1* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- @@ -36,12 +36,10 @@ Class | Method | HTTP request | Description *DefaultApi* | [**create_account**](docs/DefaultApi.md#create_account) | **POST** /accounts | Create account *DefaultApi* | [**create_api_key**](docs/DefaultApi.md#create_api_key) | **POST** /api-keys | Create API Key *DefaultApi* | [**create_app**](docs/DefaultApi.md#create_app) | **POST** /apps | Create app -*DefaultApi* | [**create_authenticator**](docs/DefaultApi.md#create_authenticator) | **POST** /authenticators | Create authenticator *DefaultApi* | [**create_catalog**](docs/DefaultApi.md#create_catalog) | **POST** /catalogs | Create catalog *DefaultApi* | [**create_device_login_ticket**](docs/DefaultApi.md#create_device_login_ticket) | **GET** /login/device | Create device login ticket *DefaultApi* | [**create_environment**](docs/DefaultApi.md#create_environment) | **POST** /environments | Create environment *DefaultApi* | [**create_guest**](docs/DefaultApi.md#create_guest) | **POST** /guests | Create guest -*DefaultApi* | [**create_password_reset**](docs/DefaultApi.md#create_password_reset) | **POST** /accounts/password-reset | Create password reset *DefaultApi* | [**create_sandbox_secrets**](docs/DefaultApi.md#create_sandbox_secrets) | **POST** /sandbox/secrets | Create Tower-provided sandbox secrets *DefaultApi* | [**create_schedule**](docs/DefaultApi.md#create_schedule) | **POST** /schedules | Create schedule *DefaultApi* | [**create_secret**](docs/DefaultApi.md#create_secret) | **POST** /secrets | Create secret @@ -52,7 +50,6 @@ Class | Method | HTTP request | Description *DefaultApi* | [**delete_alert**](docs/DefaultApi.md#delete_alert) | **DELETE** /alerts/{alert_id} | Delete alert *DefaultApi* | [**delete_api_key**](docs/DefaultApi.md#delete_api_key) | **DELETE** /api-keys | Delete API key *DefaultApi* | [**delete_app**](docs/DefaultApi.md#delete_app) | **DELETE** /apps/{name} | Delete app -*DefaultApi* | [**delete_authenticator**](docs/DefaultApi.md#delete_authenticator) | **DELETE** /authenticators | Delete authenticator *DefaultApi* | [**delete_catalog**](docs/DefaultApi.md#delete_catalog) | **DELETE** /catalogs/{name} | Delete catalog *DefaultApi* | [**delete_guest**](docs/DefaultApi.md#delete_guest) | **DELETE** /guests/{guest_id} | Delete guest *DefaultApi* | [**delete_schedule**](docs/DefaultApi.md#delete_schedule) | **DELETE** /schedules | Delete schedule @@ -81,7 +78,7 @@ Class | Method | HTTP request | Description *DefaultApi* | [**export_catalogs**](docs/DefaultApi.md#export_catalogs) | **POST** /catalogs/export | Export catalogs *DefaultApi* | [**export_secrets**](docs/DefaultApi.md#export_secrets) | **POST** /secrets/export | Export secrets *DefaultApi* | [**generate_app_statistics**](docs/DefaultApi.md#generate_app_statistics) | **GET** /stats/apps | Generate app statistics -*DefaultApi* | [**generate_authenticator**](docs/DefaultApi.md#generate_authenticator) | **POST** /authenticators/generate | Generate authenticator +*DefaultApi* | [**generate_organization_usage_time_series**](docs/DefaultApi.md#generate_organization_usage_time_series) | **GET** /usage/time-series | Get organization usage as time series *DefaultApi* | [**generate_run_statistics**](docs/DefaultApi.md#generate_run_statistics) | **GET** /stats/runs | Generate run statistics *DefaultApi* | [**generate_runner_credentials**](docs/DefaultApi.md#generate_runner_credentials) | **POST** /runners/credentials | Generate runner credentials *DefaultApi* | [**invite_team_member**](docs/DefaultApi.md#invite_team_member) | **POST** /teams/{name}/invites | Invite team member @@ -91,7 +88,6 @@ Class | Method | HTTP request | Description *DefaultApi* | [**list_app_environments**](docs/DefaultApi.md#list_app_environments) | **GET** /apps/{name}/environments | List app environments *DefaultApi* | [**list_app_versions**](docs/DefaultApi.md#list_app_versions) | **GET** /apps/{name}/versions | List app versions *DefaultApi* | [**list_apps**](docs/DefaultApi.md#list_apps) | **GET** /apps | List apps -*DefaultApi* | [**list_authenticators**](docs/DefaultApi.md#list_authenticators) | **GET** /authenticators | List authenticators *DefaultApi* | [**list_catalogs**](docs/DefaultApi.md#list_catalogs) | **GET** /catalogs | List catalogs *DefaultApi* | [**list_environments**](docs/DefaultApi.md#list_environments) | **GET** /environments | List environments *DefaultApi* | [**list_guests**](docs/DefaultApi.md#list_guests) | **GET** /guests | List guests @@ -108,7 +104,6 @@ Class | Method | HTTP request | Description *DefaultApi* | [**refresh_session**](docs/DefaultApi.md#refresh_session) | **POST** /session/refresh | Refresh session *DefaultApi* | [**regenerate_guest_login_url**](docs/DefaultApi.md#regenerate_guest_login_url) | **POST** /guests/{guest_id}/login-url | Regenerate guest login URL *DefaultApi* | [**remove_team_member**](docs/DefaultApi.md#remove_team_member) | **DELETE** /teams/{name}/members | Remove team member -*DefaultApi* | [**resend_email_verification**](docs/DefaultApi.md#resend_email_verification) | **POST** /user/resend-verification | Resent email verification *DefaultApi* | [**resend_team_invitation**](docs/DefaultApi.md#resend_team_invitation) | **POST** /teams/{name}/invites/resend | Resend team invitation *DefaultApi* | [**run_app**](docs/DefaultApi.md#run_app) | **POST** /apps/{name}/runs | Run app *DefaultApi* | [**search_runs**](docs/DefaultApi.md#search_runs) | **GET** /runs | Search runs @@ -117,12 +112,12 @@ Class | Method | HTTP request | Description *DefaultApi* | [**stream_shouldertaps**](docs/DefaultApi.md#stream_shouldertaps) | **GET** /shouldertaps/stream | Stream shouldertaps *DefaultApi* | [**update_account**](docs/DefaultApi.md#update_account) | **PUT** /accounts/{name} | Update account *DefaultApi* | [**update_app**](docs/DefaultApi.md#update_app) | **PUT** /apps/{name} | Update app +*DefaultApi* | [**update_app_environment**](docs/DefaultApi.md#update_app_environment) | **PUT** /apps/{name}/environments/{environment} | Update app environment *DefaultApi* | [**update_catalog**](docs/DefaultApi.md#update_catalog) | **PUT** /catalogs/{name} | Update catalog *DefaultApi* | [**update_email_preferences**](docs/DefaultApi.md#update_email_preferences) | **PUT** /user/email-preferences | Update email preferences *DefaultApi* | [**update_environment**](docs/DefaultApi.md#update_environment) | **PUT** /environments/{name} | Update environment *DefaultApi* | [**update_my_team_invitation**](docs/DefaultApi.md#update_my_team_invitation) | **PUT** /team-invites | Update my team invitation *DefaultApi* | [**update_organization**](docs/DefaultApi.md#update_organization) | **PUT** /organizations/{name} | Update organization -*DefaultApi* | [**update_password_reset**](docs/DefaultApi.md#update_password_reset) | **POST** /accounts/password-reset/{code} | Update password reset *DefaultApi* | [**update_plan**](docs/DefaultApi.md#update_plan) | **PUT** /plan | Update plan *DefaultApi* | [**update_schedule**](docs/DefaultApi.md#update_schedule) | **PUT** /schedules/{idOrName} | Update schedule *DefaultApi* | [**update_secret**](docs/DefaultApi.md#update_secret) | **PUT** /secrets/{name} | Update secret @@ -130,7 +125,6 @@ Class | Method | HTTP request | Description *DefaultApi* | [**update_team_member**](docs/DefaultApi.md#update_team_member) | **PUT** /teams/{name}/members | Update team member *DefaultApi* | [**update_user**](docs/DefaultApi.md#update_user) | **PUT** /user | Update user profile *DefaultApi* | [**update_webhook**](docs/DefaultApi.md#update_webhook) | **PUT** /webhooks/{name} | Update webhook -*DefaultApi* | [**verify_email**](docs/DefaultApi.md#verify_email) | **POST** /user/verify | Verify email *FeatureFlagsApi* | [**get_feature_flag_value**](docs/FeatureFlagsApi.md#get_feature_flag_value) | **GET** /feature-flags/{key} | Get feature flag value @@ -160,8 +154,6 @@ Class | Method | HTTP request | Description - [CreateApiKeyResponse](docs/CreateApiKeyResponse.md) - [CreateAppParams](docs/CreateAppParams.md) - [CreateAppResponse](docs/CreateAppResponse.md) - - [CreateAuthenticatorParams](docs/CreateAuthenticatorParams.md) - - [CreateAuthenticatorResponse](docs/CreateAuthenticatorResponse.md) - [CreateCatalogParams](docs/CreateCatalogParams.md) - [CreateCatalogResponse](docs/CreateCatalogResponse.md) - [CreateDeviceLoginTicketResponse](docs/CreateDeviceLoginTicketResponse.md) @@ -169,8 +161,6 @@ Class | Method | HTTP request | Description - [CreateEnvironmentResponse](docs/CreateEnvironmentResponse.md) - [CreateGuestParams](docs/CreateGuestParams.md) - [CreateGuestResponse](docs/CreateGuestResponse.md) - - [CreatePasswordResetParams](docs/CreatePasswordResetParams.md) - - [CreatePasswordResetResponse](docs/CreatePasswordResetResponse.md) - [CreateSandboxSecretsParams](docs/CreateSandboxSecretsParams.md) - [CreateSandboxSecretsResponse](docs/CreateSandboxSecretsResponse.md) - [CreateScheduleParams](docs/CreateScheduleParams.md) @@ -186,8 +176,6 @@ Class | Method | HTTP request | Description - [DeleteApiKeyParams](docs/DeleteApiKeyParams.md) - [DeleteApiKeyResponse](docs/DeleteApiKeyResponse.md) - [DeleteAppResponse](docs/DeleteAppResponse.md) - - [DeleteAuthenticatorParams](docs/DeleteAuthenticatorParams.md) - - [DeleteAuthenticatorResponse](docs/DeleteAuthenticatorResponse.md) - [DeleteCatalogResponse](docs/DeleteCatalogResponse.md) - [DeleteGuestOutputBody](docs/DeleteGuestOutputBody.md) - [DeleteScheduleParams](docs/DeleteScheduleParams.md) @@ -238,7 +226,7 @@ Class | Method | HTTP request | Description - [Feature](docs/Feature.md) - [FeaturebaseIdentity](docs/FeaturebaseIdentity.md) - [GenerateAppStatisticsResponse](docs/GenerateAppStatisticsResponse.md) - - [GenerateAuthenticatorResponse](docs/GenerateAuthenticatorResponse.md) + - [GenerateOrganizationUsageTimeSeriesResponse](docs/GenerateOrganizationUsageTimeSeriesResponse.md) - [GenerateRunStatisticsResponse](docs/GenerateRunStatisticsResponse.md) - [GenerateRunnerCredentialsResponse](docs/GenerateRunnerCredentialsResponse.md) - [GetFeatureFlagResponseBody](docs/GetFeatureFlagResponseBody.md) @@ -251,7 +239,6 @@ Class | Method | HTTP request | Description - [ListAppEnvironmentsResponse](docs/ListAppEnvironmentsResponse.md) - [ListAppVersionsResponse](docs/ListAppVersionsResponse.md) - [ListAppsResponse](docs/ListAppsResponse.md) - - [ListAuthenticatorsResponse](docs/ListAuthenticatorsResponse.md) - [ListCatalogsResponse](docs/ListCatalogsResponse.md) - [ListEnvironmentsResponse](docs/ListEnvironmentsResponse.md) - [ListGuestsResponse](docs/ListGuestsResponse.md) @@ -290,6 +277,7 @@ Class | Method | HTTP request | Description - [RunInitiatorDetails](docs/RunInitiatorDetails.md) - [RunLogLine](docs/RunLogLine.md) - [RunParameter](docs/RunParameter.md) + - [RunParameterInput](docs/RunParameterInput.md) - [RunResults](docs/RunResults.md) - [RunRetryPolicy](docs/RunRetryPolicy.md) - [RunRunInitiatorDetails](docs/RunRunInitiatorDetails.md) @@ -313,9 +301,10 @@ Class | Method | HTTP request | Description - [TeamMembership](docs/TeamMembership.md) - [TestWebhookResponse](docs/TestWebhookResponse.md) - [Token](docs/Token.md) - - [UnverifiedAuthenticator](docs/UnverifiedAuthenticator.md) - [UpdateAccountParams](docs/UpdateAccountParams.md) - [UpdateAccountResponse](docs/UpdateAccountResponse.md) + - [UpdateAppEnvironmentParams](docs/UpdateAppEnvironmentParams.md) + - [UpdateAppEnvironmentResponse](docs/UpdateAppEnvironmentResponse.md) - [UpdateAppParams](docs/UpdateAppParams.md) - [UpdateAppResponse](docs/UpdateAppResponse.md) - [UpdateCatalogParams](docs/UpdateCatalogParams.md) @@ -327,8 +316,6 @@ Class | Method | HTTP request | Description - [UpdateMyTeamInvitationResponse](docs/UpdateMyTeamInvitationResponse.md) - [UpdateOrganizationParams](docs/UpdateOrganizationParams.md) - [UpdateOrganizationResponse](docs/UpdateOrganizationResponse.md) - - [UpdatePasswordResetParams](docs/UpdatePasswordResetParams.md) - - [UpdatePasswordResetResponse](docs/UpdatePasswordResetResponse.md) - [UpdatePlanParams](docs/UpdatePlanParams.md) - [UpdatePlanResponse](docs/UpdatePlanResponse.md) - [UpdateScheduleParams](docs/UpdateScheduleParams.md) @@ -344,10 +331,8 @@ Class | Method | HTTP request | Description - [UpdateWebhookParams](docs/UpdateWebhookParams.md) - [UpdateWebhookResponse](docs/UpdateWebhookResponse.md) - [UsageLimit](docs/UsageLimit.md) + - [UsageMetricTimeSeriesPoint](docs/UsageMetricTimeSeriesPoint.md) - [User](docs/User.md) - - [VerifiedAuthenticator](docs/VerifiedAuthenticator.md) - - [VerifyEmailParams](docs/VerifyEmailParams.md) - - [VerifyEmailResponse](docs/VerifyEmailResponse.md) - [Webhook](docs/Webhook.md) diff --git a/crates/tower-api/src/apis/configuration.rs b/crates/tower-api/src/apis/configuration.rs index 2fb4a64e..32a7e13e 100644 --- a/crates/tower-api/src/apis/configuration.rs +++ b/crates/tower-api/src/apis/configuration.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -36,7 +36,7 @@ impl Configuration { impl Default for Configuration { fn default() -> Self { Configuration { - base_path: "https://api.tower.dev/v1".to_owned(), + base_path: "https://api.staging.tower-dev.net/v1".to_owned(), user_agent: Some("Tower CLI".to_owned()), client: reqwest::Client::new(), basic_auth: None, diff --git a/crates/tower-api/src/apis/default_api.rs b/crates/tower-api/src/apis/default_api.rs index d80db99c..262aa5d1 100644 --- a/crates/tower-api/src/apis/default_api.rs +++ b/crates/tower-api/src/apis/default_api.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -67,12 +67,6 @@ pub struct CreateAppParams { pub create_app_params: models::CreateAppParams, } -/// struct for passing parameters to the method [`create_authenticator`] -#[derive(Clone, Debug)] -pub struct CreateAuthenticatorParams { - pub create_authenticator_params: models::CreateAuthenticatorParams, -} - /// struct for passing parameters to the method [`create_catalog`] #[derive(Clone, Debug)] pub struct CreateCatalogParams { @@ -91,12 +85,6 @@ pub struct CreateGuestParams { pub create_guest_params: models::CreateGuestParams, } -/// struct for passing parameters to the method [`create_password_reset`] -#[derive(Clone, Debug)] -pub struct CreatePasswordResetParams { - pub create_password_reset_params: models::CreatePasswordResetParams, -} - /// struct for passing parameters to the method [`create_sandbox_secrets`] #[derive(Clone, Debug)] pub struct CreateSandboxSecretsParams { @@ -159,12 +147,6 @@ pub struct DeleteAppParams { pub name: String, } -/// struct for passing parameters to the method [`delete_authenticator`] -#[derive(Clone, Debug)] -pub struct DeleteAuthenticatorParams { - pub delete_authenticator_params: models::DeleteAuthenticatorParams, -} - /// struct for passing parameters to the method [`delete_catalog`] #[derive(Clone, Debug)] pub struct DeleteCatalogParams { @@ -234,6 +216,10 @@ pub struct DeployAppParams { pub x_tower_checksum_sha256: Option, /// Size of the uploaded bundle in bytes. pub content_length: Option, + /// The environment to deploy to. + pub environment: Option, + /// Whether to deploy to all environments for this app. If true, the 'environment' query parameter is ignored. + pub all_environments: Option, } /// struct for passing parameters to the method [`describe_account`] @@ -645,6 +631,16 @@ pub struct UpdateAppParams { pub update_app_params: models::UpdateAppParams, } +/// struct for passing parameters to the method [`update_app_environment`] +#[derive(Clone, Debug)] +pub struct UpdateAppEnvironmentParams { + /// The name of the app. + pub name: String, + /// The name of the environment. + pub environment: String, + pub update_app_environment_params: models::UpdateAppEnvironmentParams, +} + /// struct for passing parameters to the method [`update_catalog`] #[derive(Clone, Debug)] pub struct UpdateCatalogParams { @@ -681,14 +677,6 @@ pub struct UpdateOrganizationParams { pub update_organization_params: models::UpdateOrganizationParams, } -/// struct for passing parameters to the method [`update_password_reset`] -#[derive(Clone, Debug)] -pub struct UpdatePasswordResetParams { - /// The password reset code that was sent to you - pub code: String, - pub update_password_reset_params: models::UpdatePasswordResetParams, -} - /// struct for passing parameters to the method [`update_plan`] #[derive(Clone, Debug)] pub struct UpdatePlanParams { @@ -740,12 +728,6 @@ pub struct UpdateWebhookParams { pub update_webhook_params: models::UpdateWebhookParams, } -/// struct for passing parameters to the method [`verify_email`] -#[derive(Clone, Debug)] -pub struct VerifyEmailParams { - pub verify_email_params: models::VerifyEmailParams, -} - /// struct for typed successes of method [`acknowledge_alert`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -818,14 +800,6 @@ pub enum CreateAppSuccess { UnknownValue(serde_json::Value), } -/// struct for typed successes of method [`create_authenticator`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CreateAuthenticatorSuccess { - Status200(models::CreateAuthenticatorResponse), - UnknownValue(serde_json::Value), -} - /// struct for typed successes of method [`create_catalog`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -858,14 +832,6 @@ pub enum CreateGuestSuccess { UnknownValue(serde_json::Value), } -/// struct for typed successes of method [`create_password_reset`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CreatePasswordResetSuccess { - Status200(models::CreatePasswordResetResponse), - UnknownValue(serde_json::Value), -} - /// struct for typed successes of method [`create_sandbox_secrets`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -946,14 +912,6 @@ pub enum DeleteAppSuccess { UnknownValue(serde_json::Value), } -/// struct for typed successes of method [`delete_authenticator`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DeleteAuthenticatorSuccess { - Status200(models::DeleteAuthenticatorResponse), - UnknownValue(serde_json::Value), -} - /// struct for typed successes of method [`delete_catalog`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -1178,11 +1136,11 @@ pub enum GenerateAppStatisticsSuccess { UnknownValue(serde_json::Value), } -/// struct for typed successes of method [`generate_authenticator`] +/// struct for typed successes of method [`generate_organization_usage_time_series`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum GenerateAuthenticatorSuccess { - Status200(models::GenerateAuthenticatorResponse), +pub enum GenerateOrganizationUsageTimeSeriesSuccess { + Status200(models::GenerateOrganizationUsageTimeSeriesResponse), UnknownValue(serde_json::Value), } @@ -1258,14 +1216,6 @@ pub enum ListAppsSuccess { UnknownValue(serde_json::Value), } -/// struct for typed successes of method [`list_authenticators`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListAuthenticatorsSuccess { - Status200(models::ListAuthenticatorsResponse), - UnknownValue(serde_json::Value), -} - /// struct for typed successes of method [`list_catalogs`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -1394,14 +1344,6 @@ pub enum RemoveTeamMemberSuccess { UnknownValue(serde_json::Value), } -/// struct for typed successes of method [`resend_email_verification`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ResendEmailVerificationSuccess { - Status204(), - UnknownValue(serde_json::Value), -} - /// struct for typed successes of method [`resend_team_invitation`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -1466,6 +1408,14 @@ pub enum UpdateAppSuccess { UnknownValue(serde_json::Value), } +/// struct for typed successes of method [`update_app_environment`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateAppEnvironmentSuccess { + Status200(models::UpdateAppEnvironmentResponse), + UnknownValue(serde_json::Value), +} + /// struct for typed successes of method [`update_catalog`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -1506,14 +1456,6 @@ pub enum UpdateOrganizationSuccess { UnknownValue(serde_json::Value), } -/// struct for typed successes of method [`update_password_reset`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UpdatePasswordResetSuccess { - Status200(models::UpdatePasswordResetResponse), - UnknownValue(serde_json::Value), -} - /// struct for typed successes of method [`update_plan`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -1570,14 +1512,6 @@ pub enum UpdateWebhookSuccess { UnknownValue(serde_json::Value), } -/// struct for typed successes of method [`verify_email`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum VerifyEmailSuccess { - Status200(models::VerifyEmailResponse), - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`acknowledge_alert`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -1650,14 +1584,6 @@ pub enum CreateAppError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`create_authenticator`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CreateAuthenticatorError { - DefaultResponse(models::ErrorModel), - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`create_catalog`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -1690,14 +1616,6 @@ pub enum CreateGuestError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`create_password_reset`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CreatePasswordResetError { - DefaultResponse(models::ErrorModel), - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`create_sandbox_secrets`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -1781,14 +1699,6 @@ pub enum DeleteAppError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`delete_authenticator`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DeleteAuthenticatorError { - DefaultResponse(models::ErrorModel), - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`delete_catalog`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -2017,10 +1927,10 @@ pub enum GenerateAppStatisticsError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`generate_authenticator`] +/// struct for typed errors of method [`generate_organization_usage_time_series`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum GenerateAuthenticatorError { +pub enum GenerateOrganizationUsageTimeSeriesError { DefaultResponse(models::ErrorModel), UnknownValue(serde_json::Value), } @@ -2097,14 +2007,6 @@ pub enum ListAppsError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`list_authenticators`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListAuthenticatorsError { - DefaultResponse(models::ErrorModel), - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`list_catalogs`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -2233,14 +2135,6 @@ pub enum RemoveTeamMemberError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`resend_email_verification`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ResendEmailVerificationError { - DefaultResponse(models::ErrorModel), - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`resend_team_invitation`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -2305,6 +2199,14 @@ pub enum UpdateAppError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`update_app_environment`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateAppEnvironmentError { + DefaultResponse(models::ErrorModel), + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`update_catalog`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -2351,14 +2253,6 @@ pub enum UpdateOrganizationError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`update_password_reset`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UpdatePasswordResetError { - DefaultResponse(models::ErrorModel), - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`update_plan`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -2415,14 +2309,6 @@ pub enum UpdateWebhookError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`verify_email`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum VerifyEmailError { - DefaultResponse(models::ErrorModel), - UnknownValue(serde_json::Value), -} - /// Mark an alert as acknowledged pub async fn acknowledge_alert( configuration: &configuration::Configuration, @@ -2940,64 +2826,6 @@ pub async fn create_app( } } -/// Associates an authenticator with your account, where the authenticator is identified by the URL with an otpauth URI scheme. -pub async fn create_authenticator( - configuration: &configuration::Configuration, - params: CreateAuthenticatorParams, -) -> Result, Error> { - let uri_str = format!("{}/authenticators", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-API-Key", value); - }; - req_builder = req_builder.json(¶ms.create_authenticator_params); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - let tower_trace_id = resp - .headers() - .get("x-tower-trace-id") - .and_then(|v| v.to_str().ok()) - .map_or(String::from(DEFAULT_TOWER_TRACE_ID), String::from); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Ok(ResponseContent { - tower_trace_id, - status, - content, - entity, - }) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - tower_trace_id, - status, - content, - entity, - })) - } -} - /// Create a new catalog object in the currently authenticated account. pub async fn create_catalog( configuration: &configuration::Configuration, @@ -3215,53 +3043,6 @@ pub async fn create_guest( } } -/// Starts the password reset process for an account. If an email address exists for the account supplied, you will get a reset password email. -pub async fn create_password_reset( - configuration: &configuration::Configuration, - params: CreatePasswordResetParams, -) -> Result, Error> { - let uri_str = format!("{}/accounts/password-reset", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - req_builder = req_builder.json(¶ms.create_password_reset_params); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - let tower_trace_id = resp - .headers() - .get("x-tower-trace-id") - .and_then(|v| v.to_str().ok()) - .map_or(String::from(DEFAULT_TOWER_TRACE_ID), String::from); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Ok(ResponseContent { - tower_trace_id, - status, - content, - entity, - }) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - tower_trace_id, - status, - content, - entity, - })) - } -} - /// Creates secrets with Tower-provided default values for the specified keys in the given environment. pub async fn create_sandbox_secrets( configuration: &configuration::Configuration, @@ -3835,64 +3616,6 @@ pub async fn delete_app( } } -/// Removes an authenticator from your account so you're no longer required to provide it at login. -pub async fn delete_authenticator( - configuration: &configuration::Configuration, - params: DeleteAuthenticatorParams, -) -> Result, Error> { - let uri_str = format!("{}/authenticators", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-API-Key", value); - }; - req_builder = req_builder.json(¶ms.delete_authenticator_params); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - let tower_trace_id = resp - .headers() - .get("x-tower-trace-id") - .and_then(|v| v.to_str().ok()) - .map_or(String::from(DEFAULT_TOWER_TRACE_ID), String::from); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Ok(ResponseContent { - tower_trace_id, - status, - content, - entity, - }) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - tower_trace_id, - status, - content, - entity, - })) - } -} - /// Delete a new catalog object in the currently authenticated account. pub async fn delete_catalog( configuration: &configuration::Configuration, @@ -4392,6 +4115,12 @@ pub async fn deploy_app( .client .request(reqwest::Method::POST, &uri_str); + if let Some(ref param_value) = params.environment { + req_builder = req_builder.query(&[("environment", ¶m_value.to_string())]); + } + if let Some(ref param_value) = params.all_environments { + req_builder = req_builder.query(&[("all_environments", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } @@ -4863,7 +4592,7 @@ pub async fn describe_email_preferences( } } -/// Describe usage statistics for the user's organization. +/// Describe usage statistics for the user's organization for the current billing cycle. pub async fn describe_organization_usage( configuration: &configuration::Configuration, ) -> Result, Error> @@ -5565,14 +5294,15 @@ pub async fn generate_app_statistics( } } -/// Generates a new authenticator for the user. This is used to set up two-factor authentication. -pub async fn generate_authenticator( +/// Get the current billing cycle usage as a time series. +pub async fn generate_organization_usage_time_series( configuration: &configuration::Configuration, -) -> Result, Error> { - let uri_str = format!("{}/authenticators/generate", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); +) -> Result< + ResponseContent, + Error, +> { + let uri_str = format!("{}/usage/time-series", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); @@ -5602,7 +5332,8 @@ pub async fn generate_authenticator( if !status.is_client_error() && !status.is_server_error() { let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); + let entity: Option = + serde_json::from_str(&content).ok(); Ok(ResponseContent { tower_trace_id, status, @@ -5611,7 +5342,8 @@ pub async fn generate_authenticator( }) } else { let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); + let entity: Option = + serde_json::from_str(&content).ok(); Err(Error::ResponseError(ResponseContent { tower_trace_id, status, @@ -6214,60 +5946,6 @@ pub async fn list_apps( } } -/// Enumerates the authenticators associated with the current users' account -pub async fn list_authenticators( - configuration: &configuration::Configuration, -) -> Result, Error> { - let uri_str = format!("{}/authenticators", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-API-Key", value); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - let tower_trace_id = resp - .headers() - .get("x-tower-trace-id") - .and_then(|v| v.to_str().ok()) - .map_or(String::from(DEFAULT_TOWER_TRACE_ID), String::from); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Ok(ResponseContent { - tower_trace_id, - status, - content, - entity, - }) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - tower_trace_id, - status, - content, - entity, - })) - } -} - /// Lists all the catalogs associated with your current account. pub async fn list_catalogs( configuration: &configuration::Configuration, @@ -7267,62 +6945,6 @@ pub async fn remove_team_member( } } -/// If a user doesn't have a verified email address, this API endpoint will send a new confirmation email to them -pub async fn resend_email_verification( - configuration: &configuration::Configuration, -) -> Result, Error> { - let uri_str = format!("{}/user/resend-verification", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-API-Key", value); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - let tower_trace_id = resp - .headers() - .get("x-tower-trace-id") - .and_then(|v| v.to_str().ok()) - .map_or(String::from(DEFAULT_TOWER_TRACE_ID), String::from); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Ok(ResponseContent { - tower_trace_id, - status, - content, - entity, - }) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - tower_trace_id, - status, - content, - entity, - })) - } -} - /// Resend a team invitation to a user if they need a reminder or if they lost it pub async fn resend_team_invitation( configuration: &configuration::Configuration, @@ -7824,6 +7446,67 @@ pub async fn update_app( } } +/// Update the configuration of an app in a specific environment, such as which version is deployed. +pub async fn update_app_environment( + configuration: &configuration::Configuration, + params: UpdateAppEnvironmentParams, +) -> Result, Error> { + let uri_str = format!( + "{}/apps/{name}/environments/{environment}", + configuration.base_path, + name = crate::apis::urlencode(params.name), + environment = crate::apis::urlencode(params.environment) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let value = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + req_builder = req_builder.header("X-API-Key", value); + }; + req_builder = req_builder.json(¶ms.update_app_environment_params); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + let tower_trace_id = resp + .headers() + .get("x-tower-trace-id") + .and_then(|v| v.to_str().ok()) + .map_or(String::from(DEFAULT_TOWER_TRACE_ID), String::from); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Ok(ResponseContent { + tower_trace_id, + status, + content, + entity, + }) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + tower_trace_id, + status, + content, + entity, + })) + } +} + /// Update a new catalog object in the currently authenticated account. pub async fn update_catalog( configuration: &configuration::Configuration, @@ -8116,57 +7799,6 @@ pub async fn update_organization( } } -/// Updates the password reset code with the new password -pub async fn update_password_reset( - configuration: &configuration::Configuration, - params: UpdatePasswordResetParams, -) -> Result, Error> { - let uri_str = format!( - "{}/accounts/password-reset/{code}", - configuration.base_path, - code = crate::apis::urlencode(params.code) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - req_builder = req_builder.json(¶ms.update_password_reset_params); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - let tower_trace_id = resp - .headers() - .get("x-tower-trace-id") - .and_then(|v| v.to_str().ok()) - .map_or(String::from(DEFAULT_TOWER_TRACE_ID), String::from); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Ok(ResponseContent { - tower_trace_id, - status, - content, - entity, - }) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - tower_trace_id, - status, - content, - entity, - })) - } -} - pub async fn update_plan( configuration: &configuration::Configuration, params: UpdatePlanParams, @@ -8576,61 +8208,3 @@ pub async fn update_webhook( })) } } - -/// If the user hasn't verified their email address, this API endpoint allows them to send a confirmation token they received via email to indeed verify they can receive emails. -pub async fn verify_email( - configuration: &configuration::Configuration, - params: VerifyEmailParams, -) -> Result, Error> { - let uri_str = format!("{}/user/verify", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-API-Key", value); - }; - req_builder = req_builder.json(¶ms.verify_email_params); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - let tower_trace_id = resp - .headers() - .get("x-tower-trace-id") - .and_then(|v| v.to_str().ok()) - .map_or(String::from(DEFAULT_TOWER_TRACE_ID), String::from); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Ok(ResponseContent { - tower_trace_id, - status, - content, - entity, - }) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - tower_trace_id, - status, - content, - entity, - })) - } -} diff --git a/crates/tower-api/src/apis/feature_flags_api.rs b/crates/tower-api/src/apis/feature_flags_api.rs index df1a7e95..ff430533 100644 --- a/crates/tower-api/src/apis/feature_flags_api.rs +++ b/crates/tower-api/src/apis/feature_flags_api.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/account.rs b/crates/tower-api/src/models/account.rs index 6bc16d2f..4b155b74 100644 --- a/crates/tower-api/src/models/account.rs +++ b/crates/tower-api/src/models/account.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/acknowledge_alert_response.rs b/crates/tower-api/src/models/acknowledge_alert_response.rs index 69a4d41e..8d49da94 100644 --- a/crates/tower-api/src/models/acknowledge_alert_response.rs +++ b/crates/tower-api/src/models/acknowledge_alert_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/acknowledge_all_alerts_response.rs b/crates/tower-api/src/models/acknowledge_all_alerts_response.rs index 0d7abb66..9af9a3a2 100644 --- a/crates/tower-api/src/models/acknowledge_all_alerts_response.rs +++ b/crates/tower-api/src/models/acknowledge_all_alerts_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/alert.rs b/crates/tower-api/src/models/alert.rs index 1d0a28f6..f49a7306 100644 --- a/crates/tower-api/src/models/alert.rs +++ b/crates/tower-api/src/models/alert.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/api_key.rs b/crates/tower-api/src/models/api_key.rs index a6ef1419..379e8036 100644 --- a/crates/tower-api/src/models/api_key.rs +++ b/crates/tower-api/src/models/api_key.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/app.rs b/crates/tower-api/src/models/app.rs index e13daf09..a61349f9 100644 --- a/crates/tower-api/src/models/app.rs +++ b/crates/tower-api/src/models/app.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/app_statistics.rs b/crates/tower-api/src/models/app_statistics.rs index ea5e9193..23033725 100644 --- a/crates/tower-api/src/models/app_statistics.rs +++ b/crates/tower-api/src/models/app_statistics.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/app_summary.rs b/crates/tower-api/src/models/app_summary.rs index 1cc996c9..927638eb 100644 --- a/crates/tower-api/src/models/app_summary.rs +++ b/crates/tower-api/src/models/app_summary.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/app_version.rs b/crates/tower-api/src/models/app_version.rs index 7fed8482..764c2524 100644 --- a/crates/tower-api/src/models/app_version.rs +++ b/crates/tower-api/src/models/app_version.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/authentication_context.rs b/crates/tower-api/src/models/authentication_context.rs index db0ea04f..1ed6c0a5 100644 --- a/crates/tower-api/src/models/authentication_context.rs +++ b/crates/tower-api/src/models/authentication_context.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/batch_schedule_params.rs b/crates/tower-api/src/models/batch_schedule_params.rs index 6283b874..6aae6b8f 100644 --- a/crates/tower-api/src/models/batch_schedule_params.rs +++ b/crates/tower-api/src/models/batch_schedule_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/batch_schedule_response.rs b/crates/tower-api/src/models/batch_schedule_response.rs index 3bbfeb99..a5dc5bf9 100644 --- a/crates/tower-api/src/models/batch_schedule_response.rs +++ b/crates/tower-api/src/models/batch_schedule_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/cancel_run_response.rs b/crates/tower-api/src/models/cancel_run_response.rs index 49769543..bd3c6ed0 100644 --- a/crates/tower-api/src/models/cancel_run_response.rs +++ b/crates/tower-api/src/models/cancel_run_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/catalog.rs b/crates/tower-api/src/models/catalog.rs index 47c54003..18b7aba0 100644 --- a/crates/tower-api/src/models/catalog.rs +++ b/crates/tower-api/src/models/catalog.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/catalog_property.rs b/crates/tower-api/src/models/catalog_property.rs index 89ecb996..8e0a0aa4 100644 --- a/crates/tower-api/src/models/catalog_property.rs +++ b/crates/tower-api/src/models/catalog_property.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/claim_device_login_ticket_params.rs b/crates/tower-api/src/models/claim_device_login_ticket_params.rs index 1513f934..37dc711b 100644 --- a/crates/tower-api/src/models/claim_device_login_ticket_params.rs +++ b/crates/tower-api/src/models/claim_device_login_ticket_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/claim_device_login_ticket_response.rs b/crates/tower-api/src/models/claim_device_login_ticket_response.rs index 8d90761f..b42c8c8e 100644 --- a/crates/tower-api/src/models/claim_device_login_ticket_response.rs +++ b/crates/tower-api/src/models/claim_device_login_ticket_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_account_params.rs b/crates/tower-api/src/models/create_account_params.rs index 84a22a12..3cbd0d13 100644 --- a/crates/tower-api/src/models/create_account_params.rs +++ b/crates/tower-api/src/models/create_account_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_account_params_flags_struct.rs b/crates/tower-api/src/models/create_account_params_flags_struct.rs index d5ed4904..5942add0 100644 --- a/crates/tower-api/src/models/create_account_params_flags_struct.rs +++ b/crates/tower-api/src/models/create_account_params_flags_struct.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_account_response.rs b/crates/tower-api/src/models/create_account_response.rs index 16828667..b68d8af6 100644 --- a/crates/tower-api/src/models/create_account_response.rs +++ b/crates/tower-api/src/models/create_account_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_api_key_params.rs b/crates/tower-api/src/models/create_api_key_params.rs index 582d9b5f..b9af5219 100644 --- a/crates/tower-api/src/models/create_api_key_params.rs +++ b/crates/tower-api/src/models/create_api_key_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_api_key_response.rs b/crates/tower-api/src/models/create_api_key_response.rs index d7bacc8f..c1666d58 100644 --- a/crates/tower-api/src/models/create_api_key_response.rs +++ b/crates/tower-api/src/models/create_api_key_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_app_params.rs b/crates/tower-api/src/models/create_app_params.rs index b49de310..9214b501 100644 --- a/crates/tower-api/src/models/create_app_params.rs +++ b/crates/tower-api/src/models/create_app_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_app_response.rs b/crates/tower-api/src/models/create_app_response.rs index 36d1f4b7..5044ac71 100644 --- a/crates/tower-api/src/models/create_app_response.rs +++ b/crates/tower-api/src/models/create_app_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_catalog_params.rs b/crates/tower-api/src/models/create_catalog_params.rs index a48906ae..7d3b3223 100644 --- a/crates/tower-api/src/models/create_catalog_params.rs +++ b/crates/tower-api/src/models/create_catalog_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -60,6 +60,8 @@ pub enum Type { Lakekeeper, #[serde(rename = "tower-catalog")] TowerCatalog, + #[serde(rename = "s3-tables")] + S3Tables, } impl Default for Type { @@ -80,6 +82,7 @@ impl<'de> Deserialize<'de> for Type { "cloudflare-r2-catalog" => Ok(Self::CloudflareR2Catalog), "lakekeeper" => Ok(Self::Lakekeeper), "tower-catalog" => Ok(Self::TowerCatalog), + "s3-tables" => Ok(Self::S3Tables), _ => Err(serde::de::Error::unknown_variant( &s, &[ @@ -88,6 +91,7 @@ impl<'de> Deserialize<'de> for Type { "cloudflare-r2-catalog", "lakekeeper", "tower-catalog", + "s3-tables", ], )), } diff --git a/crates/tower-api/src/models/create_catalog_response.rs b/crates/tower-api/src/models/create_catalog_response.rs index 1b7feab8..27b4839f 100644 --- a/crates/tower-api/src/models/create_catalog_response.rs +++ b/crates/tower-api/src/models/create_catalog_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_device_login_ticket_response.rs b/crates/tower-api/src/models/create_device_login_ticket_response.rs index cf2cdf04..460921e0 100644 --- a/crates/tower-api/src/models/create_device_login_ticket_response.rs +++ b/crates/tower-api/src/models/create_device_login_ticket_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_environment_params.rs b/crates/tower-api/src/models/create_environment_params.rs index 985bfd26..a481fce2 100644 --- a/crates/tower-api/src/models/create_environment_params.rs +++ b/crates/tower-api/src/models/create_environment_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_environment_response.rs b/crates/tower-api/src/models/create_environment_response.rs index b92f1e3d..77096812 100644 --- a/crates/tower-api/src/models/create_environment_response.rs +++ b/crates/tower-api/src/models/create_environment_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_guest_params.rs b/crates/tower-api/src/models/create_guest_params.rs index 1d929417..c2f673fa 100644 --- a/crates/tower-api/src/models/create_guest_params.rs +++ b/crates/tower-api/src/models/create_guest_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_guest_response.rs b/crates/tower-api/src/models/create_guest_response.rs index 797cf9d9..0c7fa372 100644 --- a/crates/tower-api/src/models/create_guest_response.rs +++ b/crates/tower-api/src/models/create_guest_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_sandbox_secrets_params.rs b/crates/tower-api/src/models/create_sandbox_secrets_params.rs index 1cec5160..b5e776fe 100644 --- a/crates/tower-api/src/models/create_sandbox_secrets_params.rs +++ b/crates/tower-api/src/models/create_sandbox_secrets_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_sandbox_secrets_response.rs b/crates/tower-api/src/models/create_sandbox_secrets_response.rs index 85969a9b..92f16b40 100644 --- a/crates/tower-api/src/models/create_sandbox_secrets_response.rs +++ b/crates/tower-api/src/models/create_sandbox_secrets_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_schedule_params.rs b/crates/tower-api/src/models/create_schedule_params.rs index f1f7b453..64754564 100644 --- a/crates/tower-api/src/models/create_schedule_params.rs +++ b/crates/tower-api/src/models/create_schedule_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -21,7 +21,7 @@ pub struct CreateScheduleParams { #[serde_as(as = "DefaultOnNull")] #[serde(rename = "app_name")] pub app_name: String, - /// The specific app version to run (if omitted, will use the app's default version) + /// This property is deprecated and ignored. Schedules inherit the version from their environment. #[serde( rename = "app_version", default, @@ -54,7 +54,7 @@ pub struct CreateScheduleParams { pub overlap_policy: Option>, /// Parameters to pass when running the app #[serde(rename = "parameters", skip_serializing_if = "Option::is_none")] - pub parameters: Option>, + pub parameters: Option>, /// The status of the schedule (defaults to active) #[serde( rename = "status", diff --git a/crates/tower-api/src/models/create_schedule_response.rs b/crates/tower-api/src/models/create_schedule_response.rs index a10c413e..e5d112b0 100644 --- a/crates/tower-api/src/models/create_schedule_response.rs +++ b/crates/tower-api/src/models/create_schedule_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_secret_params.rs b/crates/tower-api/src/models/create_secret_params.rs index 695f87d7..bfd4f63b 100644 --- a/crates/tower-api/src/models/create_secret_params.rs +++ b/crates/tower-api/src/models/create_secret_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_secret_response.rs b/crates/tower-api/src/models/create_secret_response.rs index 613dfc98..c05c3dba 100644 --- a/crates/tower-api/src/models/create_secret_response.rs +++ b/crates/tower-api/src/models/create_secret_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_session_params.rs b/crates/tower-api/src/models/create_session_params.rs index dca56e2b..2bef0be7 100644 --- a/crates/tower-api/src/models/create_session_params.rs +++ b/crates/tower-api/src/models/create_session_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_session_response.rs b/crates/tower-api/src/models/create_session_response.rs index fb8368b2..b232d581 100644 --- a/crates/tower-api/src/models/create_session_response.rs +++ b/crates/tower-api/src/models/create_session_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_team_params.rs b/crates/tower-api/src/models/create_team_params.rs index 9c8d77f3..ae637fb1 100644 --- a/crates/tower-api/src/models/create_team_params.rs +++ b/crates/tower-api/src/models/create_team_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_team_response.rs b/crates/tower-api/src/models/create_team_response.rs index 45004172..12dd7828 100644 --- a/crates/tower-api/src/models/create_team_response.rs +++ b/crates/tower-api/src/models/create_team_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_webhook_params.rs b/crates/tower-api/src/models/create_webhook_params.rs index 613a2a42..131fc637 100644 --- a/crates/tower-api/src/models/create_webhook_params.rs +++ b/crates/tower-api/src/models/create_webhook_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_webhook_response.rs b/crates/tower-api/src/models/create_webhook_response.rs index a558436e..70d257d4 100644 --- a/crates/tower-api/src/models/create_webhook_response.rs +++ b/crates/tower-api/src/models/create_webhook_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_api_key_params.rs b/crates/tower-api/src/models/delete_api_key_params.rs index ceea7328..f66c471a 100644 --- a/crates/tower-api/src/models/delete_api_key_params.rs +++ b/crates/tower-api/src/models/delete_api_key_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_api_key_response.rs b/crates/tower-api/src/models/delete_api_key_response.rs index dd5042f6..32a03db0 100644 --- a/crates/tower-api/src/models/delete_api_key_response.rs +++ b/crates/tower-api/src/models/delete_api_key_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_app_response.rs b/crates/tower-api/src/models/delete_app_response.rs index 6ad3f4e4..65d15608 100644 --- a/crates/tower-api/src/models/delete_app_response.rs +++ b/crates/tower-api/src/models/delete_app_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_catalog_response.rs b/crates/tower-api/src/models/delete_catalog_response.rs index 94a6436f..5ca62f96 100644 --- a/crates/tower-api/src/models/delete_catalog_response.rs +++ b/crates/tower-api/src/models/delete_catalog_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_guest_output_body.rs b/crates/tower-api/src/models/delete_guest_output_body.rs index 494227a2..3a7bd931 100644 --- a/crates/tower-api/src/models/delete_guest_output_body.rs +++ b/crates/tower-api/src/models/delete_guest_output_body.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_schedule_params.rs b/crates/tower-api/src/models/delete_schedule_params.rs index 4cbe866b..8c3a5080 100644 --- a/crates/tower-api/src/models/delete_schedule_params.rs +++ b/crates/tower-api/src/models/delete_schedule_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_schedule_response.rs b/crates/tower-api/src/models/delete_schedule_response.rs index 5a145359..81bc0980 100644 --- a/crates/tower-api/src/models/delete_schedule_response.rs +++ b/crates/tower-api/src/models/delete_schedule_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_secret_response.rs b/crates/tower-api/src/models/delete_secret_response.rs index 13f0c7a5..be06aa72 100644 --- a/crates/tower-api/src/models/delete_secret_response.rs +++ b/crates/tower-api/src/models/delete_secret_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_session_params.rs b/crates/tower-api/src/models/delete_session_params.rs index 02e2b3dc..f883eff9 100644 --- a/crates/tower-api/src/models/delete_session_params.rs +++ b/crates/tower-api/src/models/delete_session_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_session_response.rs b/crates/tower-api/src/models/delete_session_response.rs index 66eeb6cb..65e65b59 100644 --- a/crates/tower-api/src/models/delete_session_response.rs +++ b/crates/tower-api/src/models/delete_session_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_team_invitation_params.rs b/crates/tower-api/src/models/delete_team_invitation_params.rs index edf7fb18..8feda324 100644 --- a/crates/tower-api/src/models/delete_team_invitation_params.rs +++ b/crates/tower-api/src/models/delete_team_invitation_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_team_invitation_response.rs b/crates/tower-api/src/models/delete_team_invitation_response.rs index e86f224f..5231b735 100644 --- a/crates/tower-api/src/models/delete_team_invitation_response.rs +++ b/crates/tower-api/src/models/delete_team_invitation_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_team_params.rs b/crates/tower-api/src/models/delete_team_params.rs index d67705a1..477ae509 100644 --- a/crates/tower-api/src/models/delete_team_params.rs +++ b/crates/tower-api/src/models/delete_team_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_team_response.rs b/crates/tower-api/src/models/delete_team_response.rs index 04902420..22db7e12 100644 --- a/crates/tower-api/src/models/delete_team_response.rs +++ b/crates/tower-api/src/models/delete_team_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_webhook_response.rs b/crates/tower-api/src/models/delete_webhook_response.rs index 327a4fc4..9b2cdd1b 100644 --- a/crates/tower-api/src/models/delete_webhook_response.rs +++ b/crates/tower-api/src/models/delete_webhook_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/deploy_app_request.rs b/crates/tower-api/src/models/deploy_app_request.rs index 4f7a20d5..a80ae751 100644 --- a/crates/tower-api/src/models/deploy_app_request.rs +++ b/crates/tower-api/src/models/deploy_app_request.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/deploy_app_response.rs b/crates/tower-api/src/models/deploy_app_response.rs index a4cb448b..e3fcd5f6 100644 --- a/crates/tower-api/src/models/deploy_app_response.rs +++ b/crates/tower-api/src/models/deploy_app_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_account_body.rs b/crates/tower-api/src/models/describe_account_body.rs index ce51e184..656f5e2b 100644 --- a/crates/tower-api/src/models/describe_account_body.rs +++ b/crates/tower-api/src/models/describe_account_body.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_app_response.rs b/crates/tower-api/src/models/describe_app_response.rs index af78089a..bc38edb4 100644 --- a/crates/tower-api/src/models/describe_app_response.rs +++ b/crates/tower-api/src/models/describe_app_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_app_version_response.rs b/crates/tower-api/src/models/describe_app_version_response.rs index d7d64477..10e4acc5 100644 --- a/crates/tower-api/src/models/describe_app_version_response.rs +++ b/crates/tower-api/src/models/describe_app_version_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_authentication_context_body.rs b/crates/tower-api/src/models/describe_authentication_context_body.rs index 05c1e4fb..cd3aab12 100644 --- a/crates/tower-api/src/models/describe_authentication_context_body.rs +++ b/crates/tower-api/src/models/describe_authentication_context_body.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_catalog_response.rs b/crates/tower-api/src/models/describe_catalog_response.rs index 3bf15cf2..b456d43d 100644 --- a/crates/tower-api/src/models/describe_catalog_response.rs +++ b/crates/tower-api/src/models/describe_catalog_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_device_login_session_response.rs b/crates/tower-api/src/models/describe_device_login_session_response.rs index 8b2e870c..c47d342b 100644 --- a/crates/tower-api/src/models/describe_device_login_session_response.rs +++ b/crates/tower-api/src/models/describe_device_login_session_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_email_preferences_body.rs b/crates/tower-api/src/models/describe_email_preferences_body.rs index b15f801e..3143da7c 100644 --- a/crates/tower-api/src/models/describe_email_preferences_body.rs +++ b/crates/tower-api/src/models/describe_email_preferences_body.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_plan_response.rs b/crates/tower-api/src/models/describe_plan_response.rs index 5028d8db..7251ffcb 100644 --- a/crates/tower-api/src/models/describe_plan_response.rs +++ b/crates/tower-api/src/models/describe_plan_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_run_graph_response.rs b/crates/tower-api/src/models/describe_run_graph_response.rs index 35c2f7d8..1942b9d0 100644 --- a/crates/tower-api/src/models/describe_run_graph_response.rs +++ b/crates/tower-api/src/models/describe_run_graph_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_run_links.rs b/crates/tower-api/src/models/describe_run_links.rs index d676a1f6..4cd160db 100644 --- a/crates/tower-api/src/models/describe_run_links.rs +++ b/crates/tower-api/src/models/describe_run_links.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_run_logs_response.rs b/crates/tower-api/src/models/describe_run_logs_response.rs index 3118866b..36bf267a 100644 --- a/crates/tower-api/src/models/describe_run_logs_response.rs +++ b/crates/tower-api/src/models/describe_run_logs_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_run_response.rs b/crates/tower-api/src/models/describe_run_response.rs index 081e8721..5a140ad8 100644 --- a/crates/tower-api/src/models/describe_run_response.rs +++ b/crates/tower-api/src/models/describe_run_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_secrets_key_response.rs b/crates/tower-api/src/models/describe_secrets_key_response.rs index 16bd9f80..fc132e09 100644 --- a/crates/tower-api/src/models/describe_secrets_key_response.rs +++ b/crates/tower-api/src/models/describe_secrets_key_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_session_response.rs b/crates/tower-api/src/models/describe_session_response.rs index f52d184f..e26bb266 100644 --- a/crates/tower-api/src/models/describe_session_response.rs +++ b/crates/tower-api/src/models/describe_session_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_team_response.rs b/crates/tower-api/src/models/describe_team_response.rs index a1323547..0b343180 100644 --- a/crates/tower-api/src/models/describe_team_response.rs +++ b/crates/tower-api/src/models/describe_team_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_webhook_response.rs b/crates/tower-api/src/models/describe_webhook_response.rs index ef66530c..dd3cd32c 100644 --- a/crates/tower-api/src/models/describe_webhook_response.rs +++ b/crates/tower-api/src/models/describe_webhook_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/email_subscriptions.rs b/crates/tower-api/src/models/email_subscriptions.rs index 18d42b2d..d12e02db 100644 --- a/crates/tower-api/src/models/email_subscriptions.rs +++ b/crates/tower-api/src/models/email_subscriptions.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/encrypted_catalog_property.rs b/crates/tower-api/src/models/encrypted_catalog_property.rs index 227a1afe..5817ac48 100644 --- a/crates/tower-api/src/models/encrypted_catalog_property.rs +++ b/crates/tower-api/src/models/encrypted_catalog_property.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/environment.rs b/crates/tower-api/src/models/environment.rs index 3e3ec43b..a9e9e268 100644 --- a/crates/tower-api/src/models/environment.rs +++ b/crates/tower-api/src/models/environment.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/error_detail.rs b/crates/tower-api/src/models/error_detail.rs index ffc77035..3649ac49 100644 --- a/crates/tower-api/src/models/error_detail.rs +++ b/crates/tower-api/src/models/error_detail.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/error_model.rs b/crates/tower-api/src/models/error_model.rs index 43500163..9dec40ee 100644 --- a/crates/tower-api/src/models/error_model.rs +++ b/crates/tower-api/src/models/error_model.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/event_alert.rs b/crates/tower-api/src/models/event_alert.rs index a43eb580..4a2858a1 100644 --- a/crates/tower-api/src/models/event_alert.rs +++ b/crates/tower-api/src/models/event_alert.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/event_error.rs b/crates/tower-api/src/models/event_error.rs index f55f33bb..3d9c73b5 100644 --- a/crates/tower-api/src/models/event_error.rs +++ b/crates/tower-api/src/models/event_error.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/event_log.rs b/crates/tower-api/src/models/event_log.rs index 00bc043d..7be388c9 100644 --- a/crates/tower-api/src/models/event_log.rs +++ b/crates/tower-api/src/models/event_log.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/event_shouldertap.rs b/crates/tower-api/src/models/event_shouldertap.rs index 38ab0fd6..31fc6a97 100644 --- a/crates/tower-api/src/models/event_shouldertap.rs +++ b/crates/tower-api/src/models/event_shouldertap.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/event_warning.rs b/crates/tower-api/src/models/event_warning.rs index 12907c95..e3a1ab3d 100644 --- a/crates/tower-api/src/models/event_warning.rs +++ b/crates/tower-api/src/models/event_warning.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/export_catalogs_params.rs b/crates/tower-api/src/models/export_catalogs_params.rs index 8e347e07..50c99f91 100644 --- a/crates/tower-api/src/models/export_catalogs_params.rs +++ b/crates/tower-api/src/models/export_catalogs_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/export_catalogs_response.rs b/crates/tower-api/src/models/export_catalogs_response.rs index d2b43036..e96b6e34 100644 --- a/crates/tower-api/src/models/export_catalogs_response.rs +++ b/crates/tower-api/src/models/export_catalogs_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/export_secrets_params.rs b/crates/tower-api/src/models/export_secrets_params.rs index a74c2ca8..1b0fa3c3 100644 --- a/crates/tower-api/src/models/export_secrets_params.rs +++ b/crates/tower-api/src/models/export_secrets_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/export_secrets_response.rs b/crates/tower-api/src/models/export_secrets_response.rs index 32a1dc7d..2df224b0 100644 --- a/crates/tower-api/src/models/export_secrets_response.rs +++ b/crates/tower-api/src/models/export_secrets_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/exported_catalog.rs b/crates/tower-api/src/models/exported_catalog.rs index 24830dd1..e77b98ea 100644 --- a/crates/tower-api/src/models/exported_catalog.rs +++ b/crates/tower-api/src/models/exported_catalog.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/exported_catalog_property.rs b/crates/tower-api/src/models/exported_catalog_property.rs index c0c8ef2f..6550c5be 100644 --- a/crates/tower-api/src/models/exported_catalog_property.rs +++ b/crates/tower-api/src/models/exported_catalog_property.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/exported_secret.rs b/crates/tower-api/src/models/exported_secret.rs index 3ea9181a..0739d088 100644 --- a/crates/tower-api/src/models/exported_secret.rs +++ b/crates/tower-api/src/models/exported_secret.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/feature.rs b/crates/tower-api/src/models/feature.rs index 8ea4778c..a35da13d 100644 --- a/crates/tower-api/src/models/feature.rs +++ b/crates/tower-api/src/models/feature.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/featurebase_identity.rs b/crates/tower-api/src/models/featurebase_identity.rs index edb77672..192c472a 100644 --- a/crates/tower-api/src/models/featurebase_identity.rs +++ b/crates/tower-api/src/models/featurebase_identity.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/generate_app_statistics_response.rs b/crates/tower-api/src/models/generate_app_statistics_response.rs index 87930793..f16b3f04 100644 --- a/crates/tower-api/src/models/generate_app_statistics_response.rs +++ b/crates/tower-api/src/models/generate_app_statistics_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/generate_organization_usage_time_series_response.rs b/crates/tower-api/src/models/generate_organization_usage_time_series_response.rs new file mode 100644 index 00000000..51cfd65a --- /dev/null +++ b/crates/tower-api/src/models/generate_organization_usage_time_series_response.rs @@ -0,0 +1,34 @@ +/* + * Tower API + * + * REST API to interact with Tower Services. + * + * The version of the OpenAPI document: 0.10.23-preview + * Contact: hello@tower.dev + * Generated by: https://openapi-generator.tech + */ +use crate::models; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::{serde_as, DefaultOnNull}; + +#[serde_as] +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GenerateOrganizationUsageTimeSeriesResponse { + /// A URL to the JSON Schema for this object. + #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] + pub schema: Option, + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "series")] + pub series: Vec, +} + +impl GenerateOrganizationUsageTimeSeriesResponse { + pub fn new( + series: Vec, + ) -> GenerateOrganizationUsageTimeSeriesResponse { + GenerateOrganizationUsageTimeSeriesResponse { + schema: None, + series, + } + } +} diff --git a/crates/tower-api/src/models/generate_run_statistics_response.rs b/crates/tower-api/src/models/generate_run_statistics_response.rs index e18b3ebb..e3b351b8 100644 --- a/crates/tower-api/src/models/generate_run_statistics_response.rs +++ b/crates/tower-api/src/models/generate_run_statistics_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/generate_runner_credentials_response.rs b/crates/tower-api/src/models/generate_runner_credentials_response.rs index aca2d164..bec5c307 100644 --- a/crates/tower-api/src/models/generate_runner_credentials_response.rs +++ b/crates/tower-api/src/models/generate_runner_credentials_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/get_feature_flag_response_body.rs b/crates/tower-api/src/models/get_feature_flag_response_body.rs index 0ca2be66..8369303b 100644 --- a/crates/tower-api/src/models/get_feature_flag_response_body.rs +++ b/crates/tower-api/src/models/get_feature_flag_response_body.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/guest.rs b/crates/tower-api/src/models/guest.rs index ea2930cd..42f4e297 100644 --- a/crates/tower-api/src/models/guest.rs +++ b/crates/tower-api/src/models/guest.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/invite_team_member_params.rs b/crates/tower-api/src/models/invite_team_member_params.rs index f730c147..ef3b2ab4 100644 --- a/crates/tower-api/src/models/invite_team_member_params.rs +++ b/crates/tower-api/src/models/invite_team_member_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/invite_team_member_response.rs b/crates/tower-api/src/models/invite_team_member_response.rs index 8011f368..4148d651 100644 --- a/crates/tower-api/src/models/invite_team_member_response.rs +++ b/crates/tower-api/src/models/invite_team_member_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/leave_team_response.rs b/crates/tower-api/src/models/leave_team_response.rs index 095887bc..f7b6f0d9 100644 --- a/crates/tower-api/src/models/leave_team_response.rs +++ b/crates/tower-api/src/models/leave_team_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_alerts_response.rs b/crates/tower-api/src/models/list_alerts_response.rs index 498bf635..e427b507 100644 --- a/crates/tower-api/src/models/list_alerts_response.rs +++ b/crates/tower-api/src/models/list_alerts_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_api_keys_response.rs b/crates/tower-api/src/models/list_api_keys_response.rs index 1fe51b8f..8c2193e2 100644 --- a/crates/tower-api/src/models/list_api_keys_response.rs +++ b/crates/tower-api/src/models/list_api_keys_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_app_environments_response.rs b/crates/tower-api/src/models/list_app_environments_response.rs index e2f1c979..6311e89c 100644 --- a/crates/tower-api/src/models/list_app_environments_response.rs +++ b/crates/tower-api/src/models/list_app_environments_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_app_versions_response.rs b/crates/tower-api/src/models/list_app_versions_response.rs index 926cb45d..456854bf 100644 --- a/crates/tower-api/src/models/list_app_versions_response.rs +++ b/crates/tower-api/src/models/list_app_versions_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_apps_response.rs b/crates/tower-api/src/models/list_apps_response.rs index 216ed560..ca2f17e1 100644 --- a/crates/tower-api/src/models/list_apps_response.rs +++ b/crates/tower-api/src/models/list_apps_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_catalogs_response.rs b/crates/tower-api/src/models/list_catalogs_response.rs index 829e14fd..b98a3b88 100644 --- a/crates/tower-api/src/models/list_catalogs_response.rs +++ b/crates/tower-api/src/models/list_catalogs_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_environments_response.rs b/crates/tower-api/src/models/list_environments_response.rs index 4d7e7ea5..37c29036 100644 --- a/crates/tower-api/src/models/list_environments_response.rs +++ b/crates/tower-api/src/models/list_environments_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_guests_response.rs b/crates/tower-api/src/models/list_guests_response.rs index 9dec442d..8d0597c8 100644 --- a/crates/tower-api/src/models/list_guests_response.rs +++ b/crates/tower-api/src/models/list_guests_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_my_team_invitations_response.rs b/crates/tower-api/src/models/list_my_team_invitations_response.rs index 53a270c3..41b1000b 100644 --- a/crates/tower-api/src/models/list_my_team_invitations_response.rs +++ b/crates/tower-api/src/models/list_my_team_invitations_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_runners_response.rs b/crates/tower-api/src/models/list_runners_response.rs index 745674bd..5f826a46 100644 --- a/crates/tower-api/src/models/list_runners_response.rs +++ b/crates/tower-api/src/models/list_runners_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_runs_response.rs b/crates/tower-api/src/models/list_runs_response.rs index 6f819a1a..4836fa6e 100644 --- a/crates/tower-api/src/models/list_runs_response.rs +++ b/crates/tower-api/src/models/list_runs_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_schedules_response.rs b/crates/tower-api/src/models/list_schedules_response.rs index 209b42ed..6b630f1f 100644 --- a/crates/tower-api/src/models/list_schedules_response.rs +++ b/crates/tower-api/src/models/list_schedules_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_secret_environments_response.rs b/crates/tower-api/src/models/list_secret_environments_response.rs index fdb1d4d1..9dea8f85 100644 --- a/crates/tower-api/src/models/list_secret_environments_response.rs +++ b/crates/tower-api/src/models/list_secret_environments_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_secrets_response.rs b/crates/tower-api/src/models/list_secrets_response.rs index 3292d62c..f6e4f979 100644 --- a/crates/tower-api/src/models/list_secrets_response.rs +++ b/crates/tower-api/src/models/list_secrets_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_team_invitations_response.rs b/crates/tower-api/src/models/list_team_invitations_response.rs index 8ecb25c4..b343ba79 100644 --- a/crates/tower-api/src/models/list_team_invitations_response.rs +++ b/crates/tower-api/src/models/list_team_invitations_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_team_members_response.rs b/crates/tower-api/src/models/list_team_members_response.rs index da6d3ba9..92688eed 100644 --- a/crates/tower-api/src/models/list_team_members_response.rs +++ b/crates/tower-api/src/models/list_team_members_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_teams_response.rs b/crates/tower-api/src/models/list_teams_response.rs index 55c3122e..5351e6d9 100644 --- a/crates/tower-api/src/models/list_teams_response.rs +++ b/crates/tower-api/src/models/list_teams_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_webhooks_response.rs b/crates/tower-api/src/models/list_webhooks_response.rs index abead618..121582fa 100644 --- a/crates/tower-api/src/models/list_webhooks_response.rs +++ b/crates/tower-api/src/models/list_webhooks_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/mod.rs b/crates/tower-api/src/models/mod.rs index 400fb7cb..84ca1cff 100644 --- a/crates/tower-api/src/models/mod.rs +++ b/crates/tower-api/src/models/mod.rs @@ -46,10 +46,6 @@ pub mod create_app_params; pub use self::create_app_params::CreateAppParams; pub mod create_app_response; pub use self::create_app_response::CreateAppResponse; -pub mod create_authenticator_params; -pub use self::create_authenticator_params::CreateAuthenticatorParams; -pub mod create_authenticator_response; -pub use self::create_authenticator_response::CreateAuthenticatorResponse; pub mod create_catalog_params; pub use self::create_catalog_params::CreateCatalogParams; pub mod create_catalog_response; @@ -64,10 +60,6 @@ pub mod create_guest_params; pub use self::create_guest_params::CreateGuestParams; pub mod create_guest_response; pub use self::create_guest_response::CreateGuestResponse; -pub mod create_password_reset_params; -pub use self::create_password_reset_params::CreatePasswordResetParams; -pub mod create_password_reset_response; -pub use self::create_password_reset_response::CreatePasswordResetResponse; pub mod create_sandbox_secrets_params; pub use self::create_sandbox_secrets_params::CreateSandboxSecretsParams; pub mod create_sandbox_secrets_response; @@ -98,10 +90,6 @@ pub mod delete_api_key_response; pub use self::delete_api_key_response::DeleteApiKeyResponse; pub mod delete_app_response; pub use self::delete_app_response::DeleteAppResponse; -pub mod delete_authenticator_params; -pub use self::delete_authenticator_params::DeleteAuthenticatorParams; -pub mod delete_authenticator_response; -pub use self::delete_authenticator_response::DeleteAuthenticatorResponse; pub mod delete_catalog_response; pub use self::delete_catalog_response::DeleteCatalogResponse; pub mod delete_guest_output_body; @@ -202,8 +190,8 @@ pub mod featurebase_identity; pub use self::featurebase_identity::FeaturebaseIdentity; pub mod generate_app_statistics_response; pub use self::generate_app_statistics_response::GenerateAppStatisticsResponse; -pub mod generate_authenticator_response; -pub use self::generate_authenticator_response::GenerateAuthenticatorResponse; +pub mod generate_organization_usage_time_series_response; +pub use self::generate_organization_usage_time_series_response::GenerateOrganizationUsageTimeSeriesResponse; pub mod generate_run_statistics_response; pub use self::generate_run_statistics_response::GenerateRunStatisticsResponse; pub mod generate_runner_credentials_response; @@ -228,8 +216,6 @@ pub mod list_app_versions_response; pub use self::list_app_versions_response::ListAppVersionsResponse; pub mod list_apps_response; pub use self::list_apps_response::ListAppsResponse; -pub mod list_authenticators_response; -pub use self::list_authenticators_response::ListAuthenticatorsResponse; pub mod list_catalogs_response; pub use self::list_catalogs_response::ListCatalogsResponse; pub mod list_environments_response; @@ -306,6 +292,8 @@ pub mod run_log_line; pub use self::run_log_line::RunLogLine; pub mod run_parameter; pub use self::run_parameter::RunParameter; +pub mod run_parameter_input; +pub use self::run_parameter_input::RunParameterInput; pub mod run_results; pub use self::run_results::RunResults; pub mod run_retry_policy; @@ -352,12 +340,14 @@ pub mod test_webhook_response; pub use self::test_webhook_response::TestWebhookResponse; pub mod token; pub use self::token::Token; -pub mod unverified_authenticator; -pub use self::unverified_authenticator::UnverifiedAuthenticator; pub mod update_account_params; pub use self::update_account_params::UpdateAccountParams; pub mod update_account_response; pub use self::update_account_response::UpdateAccountResponse; +pub mod update_app_environment_params; +pub use self::update_app_environment_params::UpdateAppEnvironmentParams; +pub mod update_app_environment_response; +pub use self::update_app_environment_response::UpdateAppEnvironmentResponse; pub mod update_app_params; pub use self::update_app_params::UpdateAppParams; pub mod update_app_response; @@ -380,10 +370,6 @@ pub mod update_organization_params; pub use self::update_organization_params::UpdateOrganizationParams; pub mod update_organization_response; pub use self::update_organization_response::UpdateOrganizationResponse; -pub mod update_password_reset_params; -pub use self::update_password_reset_params::UpdatePasswordResetParams; -pub mod update_password_reset_response; -pub use self::update_password_reset_response::UpdatePasswordResetResponse; pub mod update_plan_params; pub use self::update_plan_params::UpdatePlanParams; pub mod update_plan_response; @@ -414,13 +400,9 @@ pub mod update_webhook_response; pub use self::update_webhook_response::UpdateWebhookResponse; pub mod usage_limit; pub use self::usage_limit::UsageLimit; +pub mod usage_metric_time_series_point; +pub use self::usage_metric_time_series_point::UsageMetricTimeSeriesPoint; pub mod user; pub use self::user::User; -pub mod verified_authenticator; -pub use self::verified_authenticator::VerifiedAuthenticator; -pub mod verify_email_params; -pub use self::verify_email_params::VerifyEmailParams; -pub mod verify_email_response; -pub use self::verify_email_response::VerifyEmailResponse; pub mod webhook; pub use self::webhook::Webhook; diff --git a/crates/tower-api/src/models/organization.rs b/crates/tower-api/src/models/organization.rs index 9ca50392..68971805 100644 --- a/crates/tower-api/src/models/organization.rs +++ b/crates/tower-api/src/models/organization.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/organization_usage.rs b/crates/tower-api/src/models/organization_usage.rs index a78cc92e..fc8d41fa 100644 --- a/crates/tower-api/src/models/organization_usage.rs +++ b/crates/tower-api/src/models/organization_usage.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/pagination.rs b/crates/tower-api/src/models/pagination.rs index d94c1eab..c224e736 100644 --- a/crates/tower-api/src/models/pagination.rs +++ b/crates/tower-api/src/models/pagination.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/parameter.rs b/crates/tower-api/src/models/parameter.rs index 39ea4fbd..a4ec7a2c 100644 --- a/crates/tower-api/src/models/parameter.rs +++ b/crates/tower-api/src/models/parameter.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/plan.rs b/crates/tower-api/src/models/plan.rs index 6b640e6d..57460752 100644 --- a/crates/tower-api/src/models/plan.rs +++ b/crates/tower-api/src/models/plan.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/refresh_session_params.rs b/crates/tower-api/src/models/refresh_session_params.rs index 0350f6e9..2fc5ec7c 100644 --- a/crates/tower-api/src/models/refresh_session_params.rs +++ b/crates/tower-api/src/models/refresh_session_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/refresh_session_response.rs b/crates/tower-api/src/models/refresh_session_response.rs index ba3b045a..dd5e0cf3 100644 --- a/crates/tower-api/src/models/refresh_session_response.rs +++ b/crates/tower-api/src/models/refresh_session_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/regenerate_guest_login_url_params.rs b/crates/tower-api/src/models/regenerate_guest_login_url_params.rs index 25bf9376..26a6fb45 100644 --- a/crates/tower-api/src/models/regenerate_guest_login_url_params.rs +++ b/crates/tower-api/src/models/regenerate_guest_login_url_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/regenerate_guest_login_url_response.rs b/crates/tower-api/src/models/regenerate_guest_login_url_response.rs index 07778e18..f0b44f78 100644 --- a/crates/tower-api/src/models/regenerate_guest_login_url_response.rs +++ b/crates/tower-api/src/models/regenerate_guest_login_url_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/remove_team_member_params.rs b/crates/tower-api/src/models/remove_team_member_params.rs index 6a40c0d9..b1e253fa 100644 --- a/crates/tower-api/src/models/remove_team_member_params.rs +++ b/crates/tower-api/src/models/remove_team_member_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/remove_team_member_response.rs b/crates/tower-api/src/models/remove_team_member_response.rs index 5a21575c..ea19e79f 100644 --- a/crates/tower-api/src/models/remove_team_member_response.rs +++ b/crates/tower-api/src/models/remove_team_member_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/resend_team_invitation_params.rs b/crates/tower-api/src/models/resend_team_invitation_params.rs index 21862271..6b0c9e55 100644 --- a/crates/tower-api/src/models/resend_team_invitation_params.rs +++ b/crates/tower-api/src/models/resend_team_invitation_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/resend_team_invitation_response.rs b/crates/tower-api/src/models/resend_team_invitation_response.rs index aae602ff..bf9affea 100644 --- a/crates/tower-api/src/models/resend_team_invitation_response.rs +++ b/crates/tower-api/src/models/resend_team_invitation_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run.rs b/crates/tower-api/src/models/run.rs index 90011c99..4e93eb69 100644 --- a/crates/tower-api/src/models/run.rs +++ b/crates/tower-api/src/models/run.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -74,8 +74,12 @@ pub struct Run { #[serde_as(as = "DefaultOnNull")] #[serde(rename = "scheduled_at")] pub scheduled_at: String, + /// When the run started executing your code. #[serde(rename = "started_at", deserialize_with = "Option::deserialize")] pub started_at: Option, + /// When the runner environment started to get setup. + #[serde(rename = "starting_at", deserialize_with = "Option::deserialize")] + pub starting_at: Option, #[serde_as(as = "DefaultOnNull")] #[serde(rename = "status")] pub status: Status, @@ -110,6 +114,7 @@ impl Run { run_id: String, scheduled_at: String, started_at: Option, + starting_at: Option, status: Status, status_group: StatusGroup, ) -> Run { @@ -134,6 +139,7 @@ impl Run { run_id, scheduled_at, started_at, + starting_at, status, status_group, subdomain: None, @@ -149,6 +155,8 @@ pub enum Status { Retrying, #[serde(rename = "pending")] Pending, + #[serde(rename = "starting")] + Starting, #[serde(rename = "running")] Running, #[serde(rename = "crashed")] @@ -177,6 +185,7 @@ impl<'de> Deserialize<'de> for Status { "scheduled" => Ok(Self::Scheduled), "retrying" => Ok(Self::Retrying), "pending" => Ok(Self::Pending), + "starting" => Ok(Self::Starting), "running" => Ok(Self::Running), "crashed" => Ok(Self::Crashed), "errored" => Ok(Self::Errored), @@ -188,6 +197,7 @@ impl<'de> Deserialize<'de> for Status { "scheduled", "retrying", "pending", + "starting", "running", "crashed", "errored", diff --git a/crates/tower-api/src/models/run_app_initiator_data.rs b/crates/tower-api/src/models/run_app_initiator_data.rs index 5f6a080c..9efc5f5f 100644 --- a/crates/tower-api/src/models/run_app_initiator_data.rs +++ b/crates/tower-api/src/models/run_app_initiator_data.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_app_params.rs b/crates/tower-api/src/models/run_app_params.rs index a630423e..595f1077 100644 --- a/crates/tower-api/src/models/run_app_params.rs +++ b/crates/tower-api/src/models/run_app_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_app_response.rs b/crates/tower-api/src/models/run_app_response.rs index 480407ca..2d217d43 100644 --- a/crates/tower-api/src/models/run_app_response.rs +++ b/crates/tower-api/src/models/run_app_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_attempt.rs b/crates/tower-api/src/models/run_attempt.rs index 15ca45ac..6f755fce 100644 --- a/crates/tower-api/src/models/run_attempt.rs +++ b/crates/tower-api/src/models/run_attempt.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -24,9 +24,12 @@ pub struct RunAttempt { #[serde_as(as = "DefaultOnNull")] #[serde(rename = "seq")] pub seq: i64, - /// When this attempt started. + /// When the run started executing your code. #[serde(rename = "started_at", deserialize_with = "Option::deserialize")] pub started_at: Option, + /// When the runner environment started to get setup. + #[serde(rename = "starting_at", deserialize_with = "Option::deserialize")] + pub starting_at: Option, /// Terminal status of this attempt. #[serde_as(as = "DefaultOnNull")] #[serde(rename = "status")] @@ -39,6 +42,7 @@ impl RunAttempt { exit_code: Option, seq: i64, started_at: Option, + starting_at: Option, status: String, ) -> RunAttempt { RunAttempt { @@ -46,6 +50,7 @@ impl RunAttempt { exit_code, seq, started_at, + starting_at, status, } } diff --git a/crates/tower-api/src/models/run_failure_alert.rs b/crates/tower-api/src/models/run_failure_alert.rs index 0f30f2d3..c6800254 100644 --- a/crates/tower-api/src/models/run_failure_alert.rs +++ b/crates/tower-api/src/models/run_failure_alert.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_graph_node.rs b/crates/tower-api/src/models/run_graph_node.rs index d0eb6652..5c68a0de 100644 --- a/crates/tower-api/src/models/run_graph_node.rs +++ b/crates/tower-api/src/models/run_graph_node.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_graph_run_id.rs b/crates/tower-api/src/models/run_graph_run_id.rs index b5f3937f..c62c99fc 100644 --- a/crates/tower-api/src/models/run_graph_run_id.rs +++ b/crates/tower-api/src/models/run_graph_run_id.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_initiator.rs b/crates/tower-api/src/models/run_initiator.rs index fac88e3b..b1e59590 100644 --- a/crates/tower-api/src/models/run_initiator.rs +++ b/crates/tower-api/src/models/run_initiator.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_initiator_details.rs b/crates/tower-api/src/models/run_initiator_details.rs index 4c21e555..d89e78dc 100644 --- a/crates/tower-api/src/models/run_initiator_details.rs +++ b/crates/tower-api/src/models/run_initiator_details.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_log_line.rs b/crates/tower-api/src/models/run_log_line.rs index b10efadc..5e9937fa 100644 --- a/crates/tower-api/src/models/run_log_line.rs +++ b/crates/tower-api/src/models/run_log_line.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_parameter.rs b/crates/tower-api/src/models/run_parameter.rs index 4f3fb67b..c288ff00 100644 --- a/crates/tower-api/src/models/run_parameter.rs +++ b/crates/tower-api/src/models/run_parameter.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -17,6 +17,10 @@ pub struct RunParameter { /// Whether this parameter is hidden/secret. Defaults to false. #[serde(rename = "hidden", skip_serializing_if = "Option::is_none")] pub hidden: Option, + /// Whether this parameter's value was supplied as an override at run/schedule creation time (true) or comes from the app version's default (false). + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "is_override")] + pub is_override: bool, #[serde_as(as = "DefaultOnNull")] #[serde(rename = "name")] pub name: String, @@ -26,9 +30,10 @@ pub struct RunParameter { } impl RunParameter { - pub fn new(name: String, value: String) -> RunParameter { + pub fn new(is_override: bool, name: String, value: String) -> RunParameter { RunParameter { hidden: None, + is_override, name, value, } diff --git a/crates/tower-api/src/models/run_parameter_input.rs b/crates/tower-api/src/models/run_parameter_input.rs new file mode 100644 index 00000000..08ffe6dd --- /dev/null +++ b/crates/tower-api/src/models/run_parameter_input.rs @@ -0,0 +1,36 @@ +/* + * Tower API + * + * REST API to interact with Tower Services. + * + * The version of the OpenAPI document: 0.10.23-preview + * Contact: hello@tower.dev + * Generated by: https://openapi-generator.tech + */ +use crate::models; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::{serde_as, DefaultOnNull}; + +#[serde_as] +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RunParameterInput { + /// Whether this parameter is hidden/secret. Defaults to false. + #[serde(rename = "hidden", skip_serializing_if = "Option::is_none")] + pub hidden: Option, + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "name")] + pub name: String, + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "value")] + pub value: String, +} + +impl RunParameterInput { + pub fn new(name: String, value: String) -> RunParameterInput { + RunParameterInput { + hidden: None, + name, + value, + } + } +} diff --git a/crates/tower-api/src/models/run_results.rs b/crates/tower-api/src/models/run_results.rs index 538fcba3..0a8be8ec 100644 --- a/crates/tower-api/src/models/run_results.rs +++ b/crates/tower-api/src/models/run_results.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -35,6 +35,9 @@ pub struct RunResults { #[serde_as(as = "DefaultOnNull")] #[serde(rename = "running")] pub running: i64, + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "starting")] + pub starting: i64, } impl RunResults { @@ -46,6 +49,7 @@ impl RunResults { pending: i64, retrying: i64, running: i64, + starting: i64, ) -> RunResults { RunResults { cancelled, @@ -55,6 +59,7 @@ impl RunResults { pending, retrying, running, + starting, } } } diff --git a/crates/tower-api/src/models/run_retry_policy.rs b/crates/tower-api/src/models/run_retry_policy.rs index 7484ef72..8777f75f 100644 --- a/crates/tower-api/src/models/run_retry_policy.rs +++ b/crates/tower-api/src/models/run_retry_policy.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_run_initiator_details.rs b/crates/tower-api/src/models/run_run_initiator_details.rs index 2f1b3eb4..afd4f8ca 100644 --- a/crates/tower-api/src/models/run_run_initiator_details.rs +++ b/crates/tower-api/src/models/run_run_initiator_details.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_statistics.rs b/crates/tower-api/src/models/run_statistics.rs index 86744b58..2da28570 100644 --- a/crates/tower-api/src/models/run_statistics.rs +++ b/crates/tower-api/src/models/run_statistics.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_timeseries_point.rs b/crates/tower-api/src/models/run_timeseries_point.rs index a4021b24..dc068055 100644 --- a/crates/tower-api/src/models/run_timeseries_point.rs +++ b/crates/tower-api/src/models/run_timeseries_point.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -42,6 +42,9 @@ pub struct RunTimeseriesPoint { #[serde_as(as = "DefaultOnNull")] #[serde(rename = "scheduled")] pub scheduled: i64, + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "starting")] + pub starting: i64, } impl RunTimeseriesPoint { @@ -55,6 +58,7 @@ impl RunTimeseriesPoint { retrying: i64, running: i64, scheduled: i64, + starting: i64, ) -> RunTimeseriesPoint { RunTimeseriesPoint { cancelled, @@ -66,6 +70,7 @@ impl RunTimeseriesPoint { retrying, running, scheduled, + starting, } } } diff --git a/crates/tower-api/src/models/runner.rs b/crates/tower-api/src/models/runner.rs index 50e4c806..a0cb0a72 100644 --- a/crates/tower-api/src/models/runner.rs +++ b/crates/tower-api/src/models/runner.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/runner_credentials.rs b/crates/tower-api/src/models/runner_credentials.rs index 9833f13f..1e002e02 100644 --- a/crates/tower-api/src/models/runner_credentials.rs +++ b/crates/tower-api/src/models/runner_credentials.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/schedule.rs b/crates/tower-api/src/models/schedule.rs index a8dde710..a903f92b 100644 --- a/crates/tower-api/src/models/schedule.rs +++ b/crates/tower-api/src/models/schedule.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -22,7 +22,7 @@ pub struct Schedule { #[serde_as(as = "DefaultOnNull")] #[serde(rename = "app_status")] pub app_status: AppStatus, - /// The specific app version to run, or null for the default version + /// This property is deprecated. Schedules inherit the version from their environment. This field returns the environment's current version. #[serde(rename = "app_version", skip_serializing_if = "Option::is_none")] pub app_version: Option, /// The timestamp when the schedule was created diff --git a/crates/tower-api/src/models/schedule_run_initiator_details.rs b/crates/tower-api/src/models/schedule_run_initiator_details.rs index 78e15549..806fcc65 100644 --- a/crates/tower-api/src/models/schedule_run_initiator_details.rs +++ b/crates/tower-api/src/models/schedule_run_initiator_details.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/search_runs_response.rs b/crates/tower-api/src/models/search_runs_response.rs index bda0b32c..527787f7 100644 --- a/crates/tower-api/src/models/search_runs_response.rs +++ b/crates/tower-api/src/models/search_runs_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/secret.rs b/crates/tower-api/src/models/secret.rs index 29e9025e..70f27a8a 100644 --- a/crates/tower-api/src/models/secret.rs +++ b/crates/tower-api/src/models/secret.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/server_sent_events_inner.rs b/crates/tower-api/src/models/server_sent_events_inner.rs index 37f57f13..9dbf0398 100644 --- a/crates/tower-api/src/models/server_sent_events_inner.rs +++ b/crates/tower-api/src/models/server_sent_events_inner.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/server_sent_events_inner_1.rs b/crates/tower-api/src/models/server_sent_events_inner_1.rs index 5e671541..81f60d01 100644 --- a/crates/tower-api/src/models/server_sent_events_inner_1.rs +++ b/crates/tower-api/src/models/server_sent_events_inner_1.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/server_sent_events_inner_2.rs b/crates/tower-api/src/models/server_sent_events_inner_2.rs index 98911abe..154f6160 100644 --- a/crates/tower-api/src/models/server_sent_events_inner_2.rs +++ b/crates/tower-api/src/models/server_sent_events_inner_2.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/session.rs b/crates/tower-api/src/models/session.rs index 0cba667a..742a5f9a 100644 --- a/crates/tower-api/src/models/session.rs +++ b/crates/tower-api/src/models/session.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/shoulder_tap.rs b/crates/tower-api/src/models/shoulder_tap.rs index dec17e33..31dd8626 100644 --- a/crates/tower-api/src/models/shoulder_tap.rs +++ b/crates/tower-api/src/models/shoulder_tap.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/sse_warning.rs b/crates/tower-api/src/models/sse_warning.rs index 78b4f748..59af41f1 100644 --- a/crates/tower-api/src/models/sse_warning.rs +++ b/crates/tower-api/src/models/sse_warning.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/statistics_settings.rs b/crates/tower-api/src/models/statistics_settings.rs index 6ab7bb5e..68bc7054 100644 --- a/crates/tower-api/src/models/statistics_settings.rs +++ b/crates/tower-api/src/models/statistics_settings.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/team.rs b/crates/tower-api/src/models/team.rs index 08da5e37..50b62fb7 100644 --- a/crates/tower-api/src/models/team.rs +++ b/crates/tower-api/src/models/team.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/team_invitation.rs b/crates/tower-api/src/models/team_invitation.rs index f7aeeff6..426e12fc 100644 --- a/crates/tower-api/src/models/team_invitation.rs +++ b/crates/tower-api/src/models/team_invitation.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/team_membership.rs b/crates/tower-api/src/models/team_membership.rs index 0d19d661..600079a7 100644 --- a/crates/tower-api/src/models/team_membership.rs +++ b/crates/tower-api/src/models/team_membership.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/test_webhook_response.rs b/crates/tower-api/src/models/test_webhook_response.rs index 186b1e56..f7310bce 100644 --- a/crates/tower-api/src/models/test_webhook_response.rs +++ b/crates/tower-api/src/models/test_webhook_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/token.rs b/crates/tower-api/src/models/token.rs index e0ec1806..e6b7b550 100644 --- a/crates/tower-api/src/models/token.rs +++ b/crates/tower-api/src/models/token.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_account_params.rs b/crates/tower-api/src/models/update_account_params.rs index 7190e849..a3a12676 100644 --- a/crates/tower-api/src/models/update_account_params.rs +++ b/crates/tower-api/src/models/update_account_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_account_response.rs b/crates/tower-api/src/models/update_account_response.rs index 09653197..2d7418df 100644 --- a/crates/tower-api/src/models/update_account_response.rs +++ b/crates/tower-api/src/models/update_account_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_app_environment_params.rs b/crates/tower-api/src/models/update_app_environment_params.rs new file mode 100644 index 00000000..a9b0dd4a --- /dev/null +++ b/crates/tower-api/src/models/update_app_environment_params.rs @@ -0,0 +1,33 @@ +/* + * Tower API + * + * REST API to interact with Tower Services. + * + * The version of the OpenAPI document: 0.10.23-preview + * Contact: hello@tower.dev + * Generated by: https://openapi-generator.tech + */ +use crate::models; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::{serde_as, DefaultOnNull}; + +#[serde_as] +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UpdateAppEnvironmentParams { + /// A URL to the JSON Schema for this object. + #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] + pub schema: Option, + /// The version to deploy to this environment, e.g. 'v1', 'v2'. + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "version")] + pub version: String, +} + +impl UpdateAppEnvironmentParams { + pub fn new(version: String) -> UpdateAppEnvironmentParams { + UpdateAppEnvironmentParams { + schema: None, + version, + } + } +} diff --git a/crates/tower-api/src/models/update_app_environment_response.rs b/crates/tower-api/src/models/update_app_environment_response.rs new file mode 100644 index 00000000..9287ac4e --- /dev/null +++ b/crates/tower-api/src/models/update_app_environment_response.rs @@ -0,0 +1,36 @@ +/* + * Tower API + * + * REST API to interact with Tower Services. + * + * The version of the OpenAPI document: 0.10.23-preview + * Contact: hello@tower.dev + * Generated by: https://openapi-generator.tech + */ +use crate::models; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::{serde_as, DefaultOnNull}; + +#[serde_as] +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UpdateAppEnvironmentResponse { + /// A URL to the JSON Schema for this object. + #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] + pub schema: Option, + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "environment")] + pub environment: String, + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "version")] + pub version: String, +} + +impl UpdateAppEnvironmentResponse { + pub fn new(environment: String, version: String) -> UpdateAppEnvironmentResponse { + UpdateAppEnvironmentResponse { + schema: None, + environment, + version, + } + } +} diff --git a/crates/tower-api/src/models/update_app_params.rs b/crates/tower-api/src/models/update_app_params.rs index 72b44704..529df315 100644 --- a/crates/tower-api/src/models/update_app_params.rs +++ b/crates/tower-api/src/models/update_app_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_app_response.rs b/crates/tower-api/src/models/update_app_response.rs index 6aa3fdfa..f0ef7d93 100644 --- a/crates/tower-api/src/models/update_app_response.rs +++ b/crates/tower-api/src/models/update_app_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_catalog_params.rs b/crates/tower-api/src/models/update_catalog_params.rs index 6732636f..54a31fe3 100644 --- a/crates/tower-api/src/models/update_catalog_params.rs +++ b/crates/tower-api/src/models/update_catalog_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_catalog_response.rs b/crates/tower-api/src/models/update_catalog_response.rs index b2db4456..ee4574ad 100644 --- a/crates/tower-api/src/models/update_catalog_response.rs +++ b/crates/tower-api/src/models/update_catalog_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_email_preferences_body.rs b/crates/tower-api/src/models/update_email_preferences_body.rs index 5c0f1e0b..2630ad09 100644 --- a/crates/tower-api/src/models/update_email_preferences_body.rs +++ b/crates/tower-api/src/models/update_email_preferences_body.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_environment_params.rs b/crates/tower-api/src/models/update_environment_params.rs index 9be932eb..a57453f5 100644 --- a/crates/tower-api/src/models/update_environment_params.rs +++ b/crates/tower-api/src/models/update_environment_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_environment_response.rs b/crates/tower-api/src/models/update_environment_response.rs index e7a74643..1d7b9709 100644 --- a/crates/tower-api/src/models/update_environment_response.rs +++ b/crates/tower-api/src/models/update_environment_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_my_team_invitation_params.rs b/crates/tower-api/src/models/update_my_team_invitation_params.rs index 5c17075e..733f32b2 100644 --- a/crates/tower-api/src/models/update_my_team_invitation_params.rs +++ b/crates/tower-api/src/models/update_my_team_invitation_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_my_team_invitation_response.rs b/crates/tower-api/src/models/update_my_team_invitation_response.rs index 8f077b5a..20b4f20a 100644 --- a/crates/tower-api/src/models/update_my_team_invitation_response.rs +++ b/crates/tower-api/src/models/update_my_team_invitation_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_organization_params.rs b/crates/tower-api/src/models/update_organization_params.rs index cf153c0d..45e0b6a0 100644 --- a/crates/tower-api/src/models/update_organization_params.rs +++ b/crates/tower-api/src/models/update_organization_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_organization_response.rs b/crates/tower-api/src/models/update_organization_response.rs index b485de14..b8634563 100644 --- a/crates/tower-api/src/models/update_organization_response.rs +++ b/crates/tower-api/src/models/update_organization_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_plan_params.rs b/crates/tower-api/src/models/update_plan_params.rs index 283ce407..19fb20f4 100644 --- a/crates/tower-api/src/models/update_plan_params.rs +++ b/crates/tower-api/src/models/update_plan_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_plan_response.rs b/crates/tower-api/src/models/update_plan_response.rs index 9cdfcd1b..5f1f5662 100644 --- a/crates/tower-api/src/models/update_plan_response.rs +++ b/crates/tower-api/src/models/update_plan_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_schedule_params.rs b/crates/tower-api/src/models/update_schedule_params.rs index 44a0e210..1d63d0b4 100644 --- a/crates/tower-api/src/models/update_schedule_params.rs +++ b/crates/tower-api/src/models/update_schedule_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -17,7 +17,7 @@ pub struct UpdateScheduleParams { /// A URL to the JSON Schema for this object. #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] pub schema: Option, - /// The specific app version to run (if omitted, will use the app's default version) + /// This property is deprecated and ignored. Schedules inherit the version from their environment. #[serde( rename = "app_version", default, @@ -49,7 +49,7 @@ pub struct UpdateScheduleParams { pub overlap_policy: Option>, /// Parameters to pass when running the app #[serde(rename = "parameters", skip_serializing_if = "Option::is_none")] - pub parameters: Option>, + pub parameters: Option>, /// The status of the schedule #[serde( rename = "status", diff --git a/crates/tower-api/src/models/update_schedule_response.rs b/crates/tower-api/src/models/update_schedule_response.rs index 91949516..0825aacb 100644 --- a/crates/tower-api/src/models/update_schedule_response.rs +++ b/crates/tower-api/src/models/update_schedule_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_secret_params.rs b/crates/tower-api/src/models/update_secret_params.rs index 40a5affe..b4725dc9 100644 --- a/crates/tower-api/src/models/update_secret_params.rs +++ b/crates/tower-api/src/models/update_secret_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_secret_response.rs b/crates/tower-api/src/models/update_secret_response.rs index 33cc1518..c5be5745 100644 --- a/crates/tower-api/src/models/update_secret_response.rs +++ b/crates/tower-api/src/models/update_secret_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_team_member_params.rs b/crates/tower-api/src/models/update_team_member_params.rs index 8886b6e2..0e989caa 100644 --- a/crates/tower-api/src/models/update_team_member_params.rs +++ b/crates/tower-api/src/models/update_team_member_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_team_member_response.rs b/crates/tower-api/src/models/update_team_member_response.rs index 8c530240..a4f09d4d 100644 --- a/crates/tower-api/src/models/update_team_member_response.rs +++ b/crates/tower-api/src/models/update_team_member_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_team_params.rs b/crates/tower-api/src/models/update_team_params.rs index a9796866..ece74dfb 100644 --- a/crates/tower-api/src/models/update_team_params.rs +++ b/crates/tower-api/src/models/update_team_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_team_response.rs b/crates/tower-api/src/models/update_team_response.rs index 8fa559a9..0f9e036c 100644 --- a/crates/tower-api/src/models/update_team_response.rs +++ b/crates/tower-api/src/models/update_team_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_user_params.rs b/crates/tower-api/src/models/update_user_params.rs index 0377d738..a049a267 100644 --- a/crates/tower-api/src/models/update_user_params.rs +++ b/crates/tower-api/src/models/update_user_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_user_response.rs b/crates/tower-api/src/models/update_user_response.rs index 359bb2c3..bf777a83 100644 --- a/crates/tower-api/src/models/update_user_response.rs +++ b/crates/tower-api/src/models/update_user_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_webhook_params.rs b/crates/tower-api/src/models/update_webhook_params.rs index 79b84cfd..afe75e0f 100644 --- a/crates/tower-api/src/models/update_webhook_params.rs +++ b/crates/tower-api/src/models/update_webhook_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_webhook_response.rs b/crates/tower-api/src/models/update_webhook_response.rs index 833f61ca..c5920056 100644 --- a/crates/tower-api/src/models/update_webhook_response.rs +++ b/crates/tower-api/src/models/update_webhook_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/usage_limit.rs b/crates/tower-api/src/models/usage_limit.rs index 985ce95b..e6c15a5c 100644 --- a/crates/tower-api/src/models/usage_limit.rs +++ b/crates/tower-api/src/models/usage_limit.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/usage_metric_time_series_point.rs b/crates/tower-api/src/models/usage_metric_time_series_point.rs new file mode 100644 index 00000000..a6c58730 --- /dev/null +++ b/crates/tower-api/src/models/usage_metric_time_series_point.rs @@ -0,0 +1,57 @@ +/* + * Tower API + * + * REST API to interact with Tower Services. + * + * The version of the OpenAPI document: 0.10.23-preview + * Contact: hello@tower.dev + * Generated by: https://openapi-generator.tech + */ +use crate::models; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::{serde_as, DefaultOnNull}; + +#[serde_as] +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UsageMetricTimeSeriesPoint { + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "date")] + pub date: String, + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "name")] + pub name: Name, + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "value")] + pub value: i64, +} + +impl UsageMetricTimeSeriesPoint { + pub fn new(date: String, name: Name, value: i64) -> UsageMetricTimeSeriesPoint { + UsageMetricTimeSeriesPoint { date, name, value } + } +} +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize)] +pub enum Name { + #[serde(rename = "run_seconds")] + RunSeconds, +} + +impl Default for Name { + fn default() -> Name { + Self::RunSeconds + } +} + +impl<'de> Deserialize<'de> for Name { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + match s.to_lowercase().as_str() { + "run_seconds" => Ok(Self::RunSeconds), + _ => Err(serde::de::Error::unknown_variant(&s, &["run_seconds"])), + } + } +} diff --git a/crates/tower-api/src/models/user.rs b/crates/tower-api/src/models/user.rs index 7c641aed..c389c967 100644 --- a/crates/tower-api/src/models/user.rs +++ b/crates/tower-api/src/models/user.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/webhook.rs b/crates/tower-api/src/models/webhook.rs index 6e3aaab6..2bd17f11 100644 --- a/crates/tower-api/src/models/webhook.rs +++ b/crates/tower-api/src/models/webhook.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: v0.10.17 + * The version of the OpenAPI document: 0.10.23-preview * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/src/tower/tower_api_client/__init__.py b/src/tower/tower_api_client/__init__.py deleted file mode 100644 index 47e2a4d2..00000000 --- a/src/tower/tower_api_client/__init__.py +++ /dev/null @@ -1,8 +0,0 @@ -"""A client library for accessing Tower API""" - -from .client import AuthenticatedClient, Client - -__all__ = ( - "AuthenticatedClient", - "Client", -) diff --git a/src/tower/tower_api_client/api/__init__.py b/src/tower/tower_api_client/api/__init__.py deleted file mode 100644 index 81f9fa24..00000000 --- a/src/tower/tower_api_client/api/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains methods for accessing the API""" diff --git a/src/tower/tower_api_client/api/default/__init__.py b/src/tower/tower_api_client/api/default/__init__.py deleted file mode 100644 index 2d7c0b23..00000000 --- a/src/tower/tower_api_client/api/default/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/src/tower/tower_api_client/api/default/acknowledge_alert.py b/src/tower/tower_api_client/api/default/acknowledge_alert.py deleted file mode 100644 index 299a4494..00000000 --- a/src/tower/tower_api_client/api/default/acknowledge_alert.py +++ /dev/null @@ -1,161 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.acknowledge_alert_response import AcknowledgeAlertResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - alert_seq: int, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/alerts/{alert_seq}/acknowledge".format( - alert_seq=quote(str(alert_seq), safe=""), - ), - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AcknowledgeAlertResponse | ErrorModel: - if response.status_code == 200: - response_200 = AcknowledgeAlertResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AcknowledgeAlertResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - alert_seq: int, - *, - client: AuthenticatedClient, -) -> Response[AcknowledgeAlertResponse | ErrorModel]: - """Acknowledge alert - - Mark an alert as acknowledged - - Args: - alert_seq (int): Seq of the alert to acknowledge - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[AcknowledgeAlertResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - alert_seq=alert_seq, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - alert_seq: int, - *, - client: AuthenticatedClient, -) -> AcknowledgeAlertResponse | ErrorModel | None: - """Acknowledge alert - - Mark an alert as acknowledged - - Args: - alert_seq (int): Seq of the alert to acknowledge - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - AcknowledgeAlertResponse | ErrorModel - """ - - return sync_detailed( - alert_seq=alert_seq, - client=client, - ).parsed - - -async def asyncio_detailed( - alert_seq: int, - *, - client: AuthenticatedClient, -) -> Response[AcknowledgeAlertResponse | ErrorModel]: - """Acknowledge alert - - Mark an alert as acknowledged - - Args: - alert_seq (int): Seq of the alert to acknowledge - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[AcknowledgeAlertResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - alert_seq=alert_seq, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - alert_seq: int, - *, - client: AuthenticatedClient, -) -> AcknowledgeAlertResponse | ErrorModel | None: - """Acknowledge alert - - Mark an alert as acknowledged - - Args: - alert_seq (int): Seq of the alert to acknowledge - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - AcknowledgeAlertResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - alert_seq=alert_seq, - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/acknowledge_all_alerts.py b/src/tower/tower_api_client/api/default/acknowledge_all_alerts.py deleted file mode 100644 index e1ea26bf..00000000 --- a/src/tower/tower_api_client/api/default/acknowledge_all_alerts.py +++ /dev/null @@ -1,134 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.acknowledge_all_alerts_response import AcknowledgeAllAlertsResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/alerts/acknowledge-all", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AcknowledgeAllAlertsResponse | ErrorModel: - if response.status_code == 200: - response_200 = AcknowledgeAllAlertsResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AcknowledgeAllAlertsResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, -) -> Response[AcknowledgeAllAlertsResponse | ErrorModel]: - """Acknowledge all alerts - - Mark all unacknowledged alerts as acknowledged for the current user in the current account - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[AcknowledgeAllAlertsResponse | ErrorModel] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, -) -> AcknowledgeAllAlertsResponse | ErrorModel | None: - """Acknowledge all alerts - - Mark all unacknowledged alerts as acknowledged for the current user in the current account - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - AcknowledgeAllAlertsResponse | ErrorModel - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, -) -> Response[AcknowledgeAllAlertsResponse | ErrorModel]: - """Acknowledge all alerts - - Mark all unacknowledged alerts as acknowledged for the current user in the current account - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[AcknowledgeAllAlertsResponse | ErrorModel] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, -) -> AcknowledgeAllAlertsResponse | ErrorModel | None: - """Acknowledge all alerts - - Mark all unacknowledged alerts as acknowledged for the current user in the current account - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - AcknowledgeAllAlertsResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/activate_schedules.py b/src/tower/tower_api_client/api/default/activate_schedules.py deleted file mode 100644 index d082e662..00000000 --- a/src/tower/tower_api_client/api/default/activate_schedules.py +++ /dev/null @@ -1,167 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.batch_schedule_params import BatchScheduleParams -from ...models.batch_schedule_response import BatchScheduleResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - *, - body: BatchScheduleParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "patch", - "url": "/schedules/activate", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BatchScheduleResponse | ErrorModel: - if response.status_code == 200: - response_200 = BatchScheduleResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BatchScheduleResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: BatchScheduleParams, -) -> Response[BatchScheduleResponse | ErrorModel]: - """Activate multiple schedules - - Activate multiple schedules to enable their execution. - - Args: - body (BatchScheduleParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[BatchScheduleResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: BatchScheduleParams, -) -> BatchScheduleResponse | ErrorModel | None: - """Activate multiple schedules - - Activate multiple schedules to enable their execution. - - Args: - body (BatchScheduleParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - BatchScheduleResponse | ErrorModel - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: BatchScheduleParams, -) -> Response[BatchScheduleResponse | ErrorModel]: - """Activate multiple schedules - - Activate multiple schedules to enable their execution. - - Args: - body (BatchScheduleParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[BatchScheduleResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: BatchScheduleParams, -) -> BatchScheduleResponse | ErrorModel | None: - """Activate multiple schedules - - Activate multiple schedules to enable their execution. - - Args: - body (BatchScheduleParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - BatchScheduleResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/cancel_run.py b/src/tower/tower_api_client/api/default/cancel_run.py deleted file mode 100644 index b36d2245..00000000 --- a/src/tower/tower_api_client/api/default/cancel_run.py +++ /dev/null @@ -1,175 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.cancel_run_response import CancelRunResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - name: str, - seq: int, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/apps/{name}/runs/{seq}".format( - name=quote(str(name), safe=""), - seq=quote(str(seq), safe=""), - ), - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CancelRunResponse | ErrorModel: - if response.status_code == 200: - response_200 = CancelRunResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CancelRunResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - seq: int, - *, - client: AuthenticatedClient, -) -> Response[CancelRunResponse | ErrorModel]: - """Cancel run - - Cancel a run - - Args: - name (str): The name of the app to fetch runs for. - seq (int): The number of the run to fetch. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CancelRunResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - seq=seq, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - seq: int, - *, - client: AuthenticatedClient, -) -> CancelRunResponse | ErrorModel | None: - """Cancel run - - Cancel a run - - Args: - name (str): The name of the app to fetch runs for. - seq (int): The number of the run to fetch. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CancelRunResponse | ErrorModel - """ - - return sync_detailed( - name=name, - seq=seq, - client=client, - ).parsed - - -async def asyncio_detailed( - name: str, - seq: int, - *, - client: AuthenticatedClient, -) -> Response[CancelRunResponse | ErrorModel]: - """Cancel run - - Cancel a run - - Args: - name (str): The name of the app to fetch runs for. - seq (int): The number of the run to fetch. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CancelRunResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - seq=seq, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - seq: int, - *, - client: AuthenticatedClient, -) -> CancelRunResponse | ErrorModel | None: - """Cancel run - - Cancel a run - - Args: - name (str): The name of the app to fetch runs for. - seq (int): The number of the run to fetch. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CancelRunResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - name=name, - seq=seq, - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/check_webhook.py b/src/tower/tower_api_client/api/default/check_webhook.py deleted file mode 100644 index 147bbb13..00000000 --- a/src/tower/tower_api_client/api/default/check_webhook.py +++ /dev/null @@ -1,153 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.test_webhook_response import TestWebhookResponse -from ...types import Response - - -def _get_kwargs( - name: str, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/webhooks/{name}/test".format( - name=quote(str(name), safe=""), - ), - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | TestWebhookResponse: - if response.status_code == 200: - response_200 = TestWebhookResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | TestWebhookResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, -) -> Response[ErrorModel | TestWebhookResponse]: - """Check webhook - - Args: - name (str): The name of the webhook. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | TestWebhookResponse] - """ - - kwargs = _get_kwargs( - name=name, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, -) -> ErrorModel | TestWebhookResponse | None: - """Check webhook - - Args: - name (str): The name of the webhook. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | TestWebhookResponse - """ - - return sync_detailed( - name=name, - client=client, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, -) -> Response[ErrorModel | TestWebhookResponse]: - """Check webhook - - Args: - name (str): The name of the webhook. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | TestWebhookResponse] - """ - - kwargs = _get_kwargs( - name=name, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, -) -> ErrorModel | TestWebhookResponse | None: - """Check webhook - - Args: - name (str): The name of the webhook. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | TestWebhookResponse - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/claim_device_login_ticket.py b/src/tower/tower_api_client/api/default/claim_device_login_ticket.py deleted file mode 100644 index 24909112..00000000 --- a/src/tower/tower_api_client/api/default/claim_device_login_ticket.py +++ /dev/null @@ -1,167 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.claim_device_login_ticket_params import ClaimDeviceLoginTicketParams -from ...models.claim_device_login_ticket_response import ClaimDeviceLoginTicketResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - *, - body: ClaimDeviceLoginTicketParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/login/device/claim", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ClaimDeviceLoginTicketResponse | ErrorModel: - if response.status_code == 200: - response_200 = ClaimDeviceLoginTicketResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ClaimDeviceLoginTicketResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: ClaimDeviceLoginTicketParams, -) -> Response[ClaimDeviceLoginTicketResponse | ErrorModel]: - """Claim a device login ticket - - Claims a device login ticket code for the authenticated user. - - Args: - body (ClaimDeviceLoginTicketParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ClaimDeviceLoginTicketResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: ClaimDeviceLoginTicketParams, -) -> ClaimDeviceLoginTicketResponse | ErrorModel | None: - """Claim a device login ticket - - Claims a device login ticket code for the authenticated user. - - Args: - body (ClaimDeviceLoginTicketParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ClaimDeviceLoginTicketResponse | ErrorModel - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: ClaimDeviceLoginTicketParams, -) -> Response[ClaimDeviceLoginTicketResponse | ErrorModel]: - """Claim a device login ticket - - Claims a device login ticket code for the authenticated user. - - Args: - body (ClaimDeviceLoginTicketParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ClaimDeviceLoginTicketResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: ClaimDeviceLoginTicketParams, -) -> ClaimDeviceLoginTicketResponse | ErrorModel | None: - """Claim a device login ticket - - Claims a device login ticket code for the authenticated user. - - Args: - body (ClaimDeviceLoginTicketParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ClaimDeviceLoginTicketResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/create_account.py b/src/tower/tower_api_client/api/default/create_account.py deleted file mode 100644 index 8a9af191..00000000 --- a/src/tower/tower_api_client/api/default/create_account.py +++ /dev/null @@ -1,167 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.create_account_params import CreateAccountParams -from ...models.create_account_response import CreateAccountResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - *, - body: CreateAccountParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/accounts", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CreateAccountResponse | ErrorModel: - if response.status_code == 200: - response_200 = CreateAccountResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CreateAccountResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateAccountParams, -) -> Response[CreateAccountResponse | ErrorModel]: - """Create account - - This is the primary way that users register new accounts with Tower. - - Args: - body (CreateAccountParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateAccountResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CreateAccountParams, -) -> CreateAccountResponse | ErrorModel | None: - """Create account - - This is the primary way that users register new accounts with Tower. - - Args: - body (CreateAccountParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateAccountResponse | ErrorModel - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateAccountParams, -) -> Response[CreateAccountResponse | ErrorModel]: - """Create account - - This is the primary way that users register new accounts with Tower. - - Args: - body (CreateAccountParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateAccountResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CreateAccountParams, -) -> CreateAccountResponse | ErrorModel | None: - """Create account - - This is the primary way that users register new accounts with Tower. - - Args: - body (CreateAccountParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateAccountResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/create_api_key.py b/src/tower/tower_api_client/api/default/create_api_key.py deleted file mode 100644 index aed81bf8..00000000 --- a/src/tower/tower_api_client/api/default/create_api_key.py +++ /dev/null @@ -1,159 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.create_api_key_params import CreateAPIKeyParams -from ...models.create_api_key_response import CreateAPIKeyResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - *, - body: CreateAPIKeyParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/api-keys", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CreateAPIKeyResponse | ErrorModel: - if response.status_code == 201: - response_201 = CreateAPIKeyResponse.from_dict(response.json()) - - return response_201 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CreateAPIKeyResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: CreateAPIKeyParams, -) -> Response[CreateAPIKeyResponse | ErrorModel]: - """Create API Key - - Args: - body (CreateAPIKeyParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateAPIKeyResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: CreateAPIKeyParams, -) -> CreateAPIKeyResponse | ErrorModel | None: - """Create API Key - - Args: - body (CreateAPIKeyParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateAPIKeyResponse | ErrorModel - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: CreateAPIKeyParams, -) -> Response[CreateAPIKeyResponse | ErrorModel]: - """Create API Key - - Args: - body (CreateAPIKeyParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateAPIKeyResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: CreateAPIKeyParams, -) -> CreateAPIKeyResponse | ErrorModel | None: - """Create API Key - - Args: - body (CreateAPIKeyParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateAPIKeyResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/create_app.py b/src/tower/tower_api_client/api/default/create_app.py deleted file mode 100644 index 8c9dc4ed..00000000 --- a/src/tower/tower_api_client/api/default/create_app.py +++ /dev/null @@ -1,167 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.create_app_params import CreateAppParams -from ...models.create_app_response import CreateAppResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - *, - body: CreateAppParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/apps", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CreateAppResponse | ErrorModel: - if response.status_code == 201: - response_201 = CreateAppResponse.from_dict(response.json()) - - return response_201 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CreateAppResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: CreateAppParams, -) -> Response[CreateAppResponse | ErrorModel]: - """Create app - - Create a new app in the current account. - - Args: - body (CreateAppParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateAppResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: CreateAppParams, -) -> CreateAppResponse | ErrorModel | None: - """Create app - - Create a new app in the current account. - - Args: - body (CreateAppParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateAppResponse | ErrorModel - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: CreateAppParams, -) -> Response[CreateAppResponse | ErrorModel]: - """Create app - - Create a new app in the current account. - - Args: - body (CreateAppParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateAppResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: CreateAppParams, -) -> CreateAppResponse | ErrorModel | None: - """Create app - - Create a new app in the current account. - - Args: - body (CreateAppParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateAppResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/create_authenticator.py b/src/tower/tower_api_client/api/default/create_authenticator.py deleted file mode 100644 index 25d4e6fd..00000000 --- a/src/tower/tower_api_client/api/default/create_authenticator.py +++ /dev/null @@ -1,171 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.create_authenticator_params import CreateAuthenticatorParams -from ...models.create_authenticator_response import CreateAuthenticatorResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - *, - body: CreateAuthenticatorParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/authenticators", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CreateAuthenticatorResponse | ErrorModel: - if response.status_code == 200: - response_200 = CreateAuthenticatorResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CreateAuthenticatorResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: CreateAuthenticatorParams, -) -> Response[CreateAuthenticatorResponse | ErrorModel]: - """Create authenticator - - Associates an authenticator with your account, where the authenticator is identified by the URL with - an otpauth URI scheme. - - Args: - body (CreateAuthenticatorParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateAuthenticatorResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: CreateAuthenticatorParams, -) -> CreateAuthenticatorResponse | ErrorModel | None: - """Create authenticator - - Associates an authenticator with your account, where the authenticator is identified by the URL with - an otpauth URI scheme. - - Args: - body (CreateAuthenticatorParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateAuthenticatorResponse | ErrorModel - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: CreateAuthenticatorParams, -) -> Response[CreateAuthenticatorResponse | ErrorModel]: - """Create authenticator - - Associates an authenticator with your account, where the authenticator is identified by the URL with - an otpauth URI scheme. - - Args: - body (CreateAuthenticatorParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateAuthenticatorResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: CreateAuthenticatorParams, -) -> CreateAuthenticatorResponse | ErrorModel | None: - """Create authenticator - - Associates an authenticator with your account, where the authenticator is identified by the URL with - an otpauth URI scheme. - - Args: - body (CreateAuthenticatorParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateAuthenticatorResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/create_catalog.py b/src/tower/tower_api_client/api/default/create_catalog.py deleted file mode 100644 index 37914243..00000000 --- a/src/tower/tower_api_client/api/default/create_catalog.py +++ /dev/null @@ -1,167 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.create_catalog_params import CreateCatalogParams -from ...models.create_catalog_response import CreateCatalogResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - *, - body: CreateCatalogParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/catalogs", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CreateCatalogResponse | ErrorModel: - if response.status_code == 200: - response_200 = CreateCatalogResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CreateCatalogResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: CreateCatalogParams, -) -> Response[CreateCatalogResponse | ErrorModel]: - """Create catalog - - Create a new catalog object in the currently authenticated account. - - Args: - body (CreateCatalogParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateCatalogResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: CreateCatalogParams, -) -> CreateCatalogResponse | ErrorModel | None: - """Create catalog - - Create a new catalog object in the currently authenticated account. - - Args: - body (CreateCatalogParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateCatalogResponse | ErrorModel - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: CreateCatalogParams, -) -> Response[CreateCatalogResponse | ErrorModel]: - """Create catalog - - Create a new catalog object in the currently authenticated account. - - Args: - body (CreateCatalogParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateCatalogResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: CreateCatalogParams, -) -> CreateCatalogResponse | ErrorModel | None: - """Create catalog - - Create a new catalog object in the currently authenticated account. - - Args: - body (CreateCatalogParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateCatalogResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/create_device_login_ticket.py b/src/tower/tower_api_client/api/default/create_device_login_ticket.py deleted file mode 100644 index bb067340..00000000 --- a/src/tower/tower_api_client/api/default/create_device_login_ticket.py +++ /dev/null @@ -1,136 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.create_device_login_ticket_response import ( - CreateDeviceLoginTicketResponse, -) -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/login/device", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CreateDeviceLoginTicketResponse | ErrorModel: - if response.status_code == 200: - response_200 = CreateDeviceLoginTicketResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CreateDeviceLoginTicketResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[CreateDeviceLoginTicketResponse | ErrorModel]: - """Create device login ticket - - Creates a new device login ticket and returns the codes and urls needed for authentication. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateDeviceLoginTicketResponse | ErrorModel] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, -) -> CreateDeviceLoginTicketResponse | ErrorModel | None: - """Create device login ticket - - Creates a new device login ticket and returns the codes and urls needed for authentication. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateDeviceLoginTicketResponse | ErrorModel - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[CreateDeviceLoginTicketResponse | ErrorModel]: - """Create device login ticket - - Creates a new device login ticket and returns the codes and urls needed for authentication. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateDeviceLoginTicketResponse | ErrorModel] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, -) -> CreateDeviceLoginTicketResponse | ErrorModel | None: - """Create device login ticket - - Creates a new device login ticket and returns the codes and urls needed for authentication. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateDeviceLoginTicketResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/create_environment.py b/src/tower/tower_api_client/api/default/create_environment.py deleted file mode 100644 index b4328f20..00000000 --- a/src/tower/tower_api_client/api/default/create_environment.py +++ /dev/null @@ -1,167 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.create_environment_params import CreateEnvironmentParams -from ...models.create_environment_response import CreateEnvironmentResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - *, - body: CreateEnvironmentParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/environments", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CreateEnvironmentResponse | ErrorModel: - if response.status_code == 201: - response_201 = CreateEnvironmentResponse.from_dict(response.json()) - - return response_201 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CreateEnvironmentResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: CreateEnvironmentParams, -) -> Response[CreateEnvironmentResponse | ErrorModel]: - """Create environment - - Create a new environment for an app. - - Args: - body (CreateEnvironmentParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateEnvironmentResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: CreateEnvironmentParams, -) -> CreateEnvironmentResponse | ErrorModel | None: - """Create environment - - Create a new environment for an app. - - Args: - body (CreateEnvironmentParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateEnvironmentResponse | ErrorModel - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: CreateEnvironmentParams, -) -> Response[CreateEnvironmentResponse | ErrorModel]: - """Create environment - - Create a new environment for an app. - - Args: - body (CreateEnvironmentParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateEnvironmentResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: CreateEnvironmentParams, -) -> CreateEnvironmentResponse | ErrorModel | None: - """Create environment - - Create a new environment for an app. - - Args: - body (CreateEnvironmentParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateEnvironmentResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/create_guest.py b/src/tower/tower_api_client/api/default/create_guest.py deleted file mode 100644 index 31e8fa61..00000000 --- a/src/tower/tower_api_client/api/default/create_guest.py +++ /dev/null @@ -1,171 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.create_guest_params import CreateGuestParams -from ...models.create_guest_response import CreateGuestResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - *, - body: CreateGuestParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/guests", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CreateGuestResponse | ErrorModel: - if response.status_code == 200: - response_200 = CreateGuestResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CreateGuestResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: CreateGuestParams, -) -> Response[CreateGuestResponse | ErrorModel]: - """Create guest - - Creates a new guest with access to a specific externally accessible app and returns a login URL to - share with them. - - Args: - body (CreateGuestParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateGuestResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: CreateGuestParams, -) -> CreateGuestResponse | ErrorModel | None: - """Create guest - - Creates a new guest with access to a specific externally accessible app and returns a login URL to - share with them. - - Args: - body (CreateGuestParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateGuestResponse | ErrorModel - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: CreateGuestParams, -) -> Response[CreateGuestResponse | ErrorModel]: - """Create guest - - Creates a new guest with access to a specific externally accessible app and returns a login URL to - share with them. - - Args: - body (CreateGuestParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateGuestResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: CreateGuestParams, -) -> CreateGuestResponse | ErrorModel | None: - """Create guest - - Creates a new guest with access to a specific externally accessible app and returns a login URL to - share with them. - - Args: - body (CreateGuestParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateGuestResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/create_password_reset.py b/src/tower/tower_api_client/api/default/create_password_reset.py deleted file mode 100644 index d109aa3a..00000000 --- a/src/tower/tower_api_client/api/default/create_password_reset.py +++ /dev/null @@ -1,171 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.create_password_reset_params import CreatePasswordResetParams -from ...models.create_password_reset_response import CreatePasswordResetResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - *, - body: CreatePasswordResetParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/accounts/password-reset", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CreatePasswordResetResponse | ErrorModel: - if response.status_code == 200: - response_200 = CreatePasswordResetResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CreatePasswordResetResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CreatePasswordResetParams, -) -> Response[CreatePasswordResetResponse | ErrorModel]: - """Create password reset - - Starts the password reset process for an account. If an email address exists for the account - supplied, you will get a reset password email. - - Args: - body (CreatePasswordResetParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreatePasswordResetResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CreatePasswordResetParams, -) -> CreatePasswordResetResponse | ErrorModel | None: - """Create password reset - - Starts the password reset process for an account. If an email address exists for the account - supplied, you will get a reset password email. - - Args: - body (CreatePasswordResetParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreatePasswordResetResponse | ErrorModel - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CreatePasswordResetParams, -) -> Response[CreatePasswordResetResponse | ErrorModel]: - """Create password reset - - Starts the password reset process for an account. If an email address exists for the account - supplied, you will get a reset password email. - - Args: - body (CreatePasswordResetParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreatePasswordResetResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CreatePasswordResetParams, -) -> CreatePasswordResetResponse | ErrorModel | None: - """Create password reset - - Starts the password reset process for an account. If an email address exists for the account - supplied, you will get a reset password email. - - Args: - body (CreatePasswordResetParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreatePasswordResetResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/create_sandbox_secrets.py b/src/tower/tower_api_client/api/default/create_sandbox_secrets.py deleted file mode 100644 index 9bb07efb..00000000 --- a/src/tower/tower_api_client/api/default/create_sandbox_secrets.py +++ /dev/null @@ -1,167 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.create_sandbox_secrets_params import CreateSandboxSecretsParams -from ...models.create_sandbox_secrets_response import CreateSandboxSecretsResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - *, - body: CreateSandboxSecretsParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/sandbox/secrets", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CreateSandboxSecretsResponse | ErrorModel: - if response.status_code == 200: - response_200 = CreateSandboxSecretsResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CreateSandboxSecretsResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: CreateSandboxSecretsParams, -) -> Response[CreateSandboxSecretsResponse | ErrorModel]: - """Create Tower-provided sandbox secrets - - Creates secrets with Tower-provided default values for the specified keys in the given environment. - - Args: - body (CreateSandboxSecretsParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateSandboxSecretsResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: CreateSandboxSecretsParams, -) -> CreateSandboxSecretsResponse | ErrorModel | None: - """Create Tower-provided sandbox secrets - - Creates secrets with Tower-provided default values for the specified keys in the given environment. - - Args: - body (CreateSandboxSecretsParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateSandboxSecretsResponse | ErrorModel - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: CreateSandboxSecretsParams, -) -> Response[CreateSandboxSecretsResponse | ErrorModel]: - """Create Tower-provided sandbox secrets - - Creates secrets with Tower-provided default values for the specified keys in the given environment. - - Args: - body (CreateSandboxSecretsParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateSandboxSecretsResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: CreateSandboxSecretsParams, -) -> CreateSandboxSecretsResponse | ErrorModel | None: - """Create Tower-provided sandbox secrets - - Creates secrets with Tower-provided default values for the specified keys in the given environment. - - Args: - body (CreateSandboxSecretsParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateSandboxSecretsResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/create_schedule.py b/src/tower/tower_api_client/api/default/create_schedule.py deleted file mode 100644 index 6d78e1ac..00000000 --- a/src/tower/tower_api_client/api/default/create_schedule.py +++ /dev/null @@ -1,167 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.create_schedule_params import CreateScheduleParams -from ...models.create_schedule_response import CreateScheduleResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - *, - body: CreateScheduleParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/schedules", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CreateScheduleResponse | ErrorModel: - if response.status_code == 201: - response_201 = CreateScheduleResponse.from_dict(response.json()) - - return response_201 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CreateScheduleResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: CreateScheduleParams, -) -> Response[CreateScheduleResponse | ErrorModel]: - """Create schedule - - Create a new schedule for an app. - - Args: - body (CreateScheduleParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateScheduleResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: CreateScheduleParams, -) -> CreateScheduleResponse | ErrorModel | None: - """Create schedule - - Create a new schedule for an app. - - Args: - body (CreateScheduleParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateScheduleResponse | ErrorModel - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: CreateScheduleParams, -) -> Response[CreateScheduleResponse | ErrorModel]: - """Create schedule - - Create a new schedule for an app. - - Args: - body (CreateScheduleParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateScheduleResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: CreateScheduleParams, -) -> CreateScheduleResponse | ErrorModel | None: - """Create schedule - - Create a new schedule for an app. - - Args: - body (CreateScheduleParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateScheduleResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/create_secret.py b/src/tower/tower_api_client/api/default/create_secret.py deleted file mode 100644 index 9b4975ad..00000000 --- a/src/tower/tower_api_client/api/default/create_secret.py +++ /dev/null @@ -1,189 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.create_secret_params import CreateSecretParams -from ...models.create_secret_response import CreateSecretResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - *, - body: CreateSecretParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/secrets", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CreateSecretResponse | ErrorModel | None: - if response.status_code == 201: - response_201 = CreateSecretResponse.from_dict(response.json()) - - return response_201 - - if response.status_code == 401: - response_401 = ErrorModel.from_dict(response.json()) - - return response_401 - - if response.status_code == 409: - response_409 = ErrorModel.from_dict(response.json()) - - return response_409 - - if response.status_code == 412: - response_412 = ErrorModel.from_dict(response.json()) - - return response_412 - - if response.status_code == 500: - response_500 = ErrorModel.from_dict(response.json()) - - return response_500 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CreateSecretResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: CreateSecretParams, -) -> Response[CreateSecretResponse | ErrorModel]: - """Create secret - - Creates a new secret and associates it with the current account. - - Args: - body (CreateSecretParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateSecretResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: CreateSecretParams, -) -> CreateSecretResponse | ErrorModel | None: - """Create secret - - Creates a new secret and associates it with the current account. - - Args: - body (CreateSecretParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateSecretResponse | ErrorModel - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: CreateSecretParams, -) -> Response[CreateSecretResponse | ErrorModel]: - """Create secret - - Creates a new secret and associates it with the current account. - - Args: - body (CreateSecretParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateSecretResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: CreateSecretParams, -) -> CreateSecretResponse | ErrorModel | None: - """Create secret - - Creates a new secret and associates it with the current account. - - Args: - body (CreateSecretParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateSecretResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/create_session.py b/src/tower/tower_api_client/api/default/create_session.py deleted file mode 100644 index e7d74a0c..00000000 --- a/src/tower/tower_api_client/api/default/create_session.py +++ /dev/null @@ -1,167 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.create_session_params import CreateSessionParams -from ...models.create_session_response import CreateSessionResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - *, - body: CreateSessionParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/session", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CreateSessionResponse | ErrorModel: - if response.status_code == 200: - response_200 = CreateSessionResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CreateSessionResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateSessionParams, -) -> Response[CreateSessionResponse | ErrorModel]: - """Create session - - Create a new session and return it. - - Args: - body (CreateSessionParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateSessionResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CreateSessionParams, -) -> CreateSessionResponse | ErrorModel | None: - """Create session - - Create a new session and return it. - - Args: - body (CreateSessionParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateSessionResponse | ErrorModel - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateSessionParams, -) -> Response[CreateSessionResponse | ErrorModel]: - """Create session - - Create a new session and return it. - - Args: - body (CreateSessionParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateSessionResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CreateSessionParams, -) -> CreateSessionResponse | ErrorModel | None: - """Create session - - Create a new session and return it. - - Args: - body (CreateSessionParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateSessionResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/create_team.py b/src/tower/tower_api_client/api/default/create_team.py deleted file mode 100644 index 84ecd3d1..00000000 --- a/src/tower/tower_api_client/api/default/create_team.py +++ /dev/null @@ -1,167 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.create_team_params import CreateTeamParams -from ...models.create_team_response import CreateTeamResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - *, - body: CreateTeamParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/teams", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CreateTeamResponse | ErrorModel: - if response.status_code == 200: - response_200 = CreateTeamResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CreateTeamResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: CreateTeamParams, -) -> Response[CreateTeamResponse | ErrorModel]: - """Create team - - Create a new team - - Args: - body (CreateTeamParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateTeamResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: CreateTeamParams, -) -> CreateTeamResponse | ErrorModel | None: - """Create team - - Create a new team - - Args: - body (CreateTeamParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateTeamResponse | ErrorModel - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: CreateTeamParams, -) -> Response[CreateTeamResponse | ErrorModel]: - """Create team - - Create a new team - - Args: - body (CreateTeamParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateTeamResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: CreateTeamParams, -) -> CreateTeamResponse | ErrorModel | None: - """Create team - - Create a new team - - Args: - body (CreateTeamParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateTeamResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/create_webhook.py b/src/tower/tower_api_client/api/default/create_webhook.py deleted file mode 100644 index d6b875d7..00000000 --- a/src/tower/tower_api_client/api/default/create_webhook.py +++ /dev/null @@ -1,159 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.create_webhook_params import CreateWebhookParams -from ...models.create_webhook_response import CreateWebhookResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - *, - body: CreateWebhookParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/webhooks", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CreateWebhookResponse | ErrorModel: - if response.status_code == 201: - response_201 = CreateWebhookResponse.from_dict(response.json()) - - return response_201 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CreateWebhookResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: CreateWebhookParams, -) -> Response[CreateWebhookResponse | ErrorModel]: - """Create webhook - - Args: - body (CreateWebhookParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateWebhookResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: CreateWebhookParams, -) -> CreateWebhookResponse | ErrorModel | None: - """Create webhook - - Args: - body (CreateWebhookParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateWebhookResponse | ErrorModel - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: CreateWebhookParams, -) -> Response[CreateWebhookResponse | ErrorModel]: - """Create webhook - - Args: - body (CreateWebhookParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateWebhookResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: CreateWebhookParams, -) -> CreateWebhookResponse | ErrorModel | None: - """Create webhook - - Args: - body (CreateWebhookParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateWebhookResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/deactivate_schedules.py b/src/tower/tower_api_client/api/default/deactivate_schedules.py deleted file mode 100644 index bddd15ad..00000000 --- a/src/tower/tower_api_client/api/default/deactivate_schedules.py +++ /dev/null @@ -1,167 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.batch_schedule_params import BatchScheduleParams -from ...models.batch_schedule_response import BatchScheduleResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - *, - body: BatchScheduleParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "patch", - "url": "/schedules/deactivate", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BatchScheduleResponse | ErrorModel: - if response.status_code == 200: - response_200 = BatchScheduleResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BatchScheduleResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: BatchScheduleParams, -) -> Response[BatchScheduleResponse | ErrorModel]: - """Deactivate multiple schedules - - Deactivate multiple schedules to disable their execution. - - Args: - body (BatchScheduleParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[BatchScheduleResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: BatchScheduleParams, -) -> BatchScheduleResponse | ErrorModel | None: - """Deactivate multiple schedules - - Deactivate multiple schedules to disable their execution. - - Args: - body (BatchScheduleParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - BatchScheduleResponse | ErrorModel - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: BatchScheduleParams, -) -> Response[BatchScheduleResponse | ErrorModel]: - """Deactivate multiple schedules - - Deactivate multiple schedules to disable their execution. - - Args: - body (BatchScheduleParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[BatchScheduleResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: BatchScheduleParams, -) -> BatchScheduleResponse | ErrorModel | None: - """Deactivate multiple schedules - - Deactivate multiple schedules to disable their execution. - - Args: - body (BatchScheduleParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - BatchScheduleResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/delete_alert.py b/src/tower/tower_api_client/api/default/delete_alert.py deleted file mode 100644 index 0bc6152a..00000000 --- a/src/tower/tower_api_client/api/default/delete_alert.py +++ /dev/null @@ -1,159 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - alert_id: str, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/alerts/{alert_id}".format( - alert_id=quote(str(alert_id), safe=""), - ), - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | ErrorModel: - if response.status_code == 204: - response_204 = cast(Any, None) - return response_204 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - alert_id: str, - *, - client: AuthenticatedClient, -) -> Response[Any | ErrorModel]: - """Delete alert - - Permanently delete an alert - - Args: - alert_id (str): ID of the alert to delete - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Any | ErrorModel] - """ - - kwargs = _get_kwargs( - alert_id=alert_id, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - alert_id: str, - *, - client: AuthenticatedClient, -) -> Any | ErrorModel | None: - """Delete alert - - Permanently delete an alert - - Args: - alert_id (str): ID of the alert to delete - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Any | ErrorModel - """ - - return sync_detailed( - alert_id=alert_id, - client=client, - ).parsed - - -async def asyncio_detailed( - alert_id: str, - *, - client: AuthenticatedClient, -) -> Response[Any | ErrorModel]: - """Delete alert - - Permanently delete an alert - - Args: - alert_id (str): ID of the alert to delete - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Any | ErrorModel] - """ - - kwargs = _get_kwargs( - alert_id=alert_id, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - alert_id: str, - *, - client: AuthenticatedClient, -) -> Any | ErrorModel | None: - """Delete alert - - Permanently delete an alert - - Args: - alert_id (str): ID of the alert to delete - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Any | ErrorModel - """ - - return ( - await asyncio_detailed( - alert_id=alert_id, - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/delete_api_key.py b/src/tower/tower_api_client/api/default/delete_api_key.py deleted file mode 100644 index b7670cf7..00000000 --- a/src/tower/tower_api_client/api/default/delete_api_key.py +++ /dev/null @@ -1,159 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.delete_api_key_params import DeleteAPIKeyParams -from ...models.delete_api_key_response import DeleteAPIKeyResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - *, - body: DeleteAPIKeyParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/api-keys", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DeleteAPIKeyResponse | ErrorModel: - if response.status_code == 200: - response_200 = DeleteAPIKeyResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DeleteAPIKeyResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: DeleteAPIKeyParams, -) -> Response[DeleteAPIKeyResponse | ErrorModel]: - """Delete API key - - Args: - body (DeleteAPIKeyParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DeleteAPIKeyResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: DeleteAPIKeyParams, -) -> DeleteAPIKeyResponse | ErrorModel | None: - """Delete API key - - Args: - body (DeleteAPIKeyParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DeleteAPIKeyResponse | ErrorModel - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: DeleteAPIKeyParams, -) -> Response[DeleteAPIKeyResponse | ErrorModel]: - """Delete API key - - Args: - body (DeleteAPIKeyParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DeleteAPIKeyResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: DeleteAPIKeyParams, -) -> DeleteAPIKeyResponse | ErrorModel | None: - """Delete API key - - Args: - body (DeleteAPIKeyParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DeleteAPIKeyResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/delete_app.py b/src/tower/tower_api_client/api/default/delete_app.py deleted file mode 100644 index 6fcd2184..00000000 --- a/src/tower/tower_api_client/api/default/delete_app.py +++ /dev/null @@ -1,161 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.delete_app_response import DeleteAppResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - name: str, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/apps/{name}".format( - name=quote(str(name), safe=""), - ), - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DeleteAppResponse | ErrorModel: - if response.status_code == 200: - response_200 = DeleteAppResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DeleteAppResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, -) -> Response[DeleteAppResponse | ErrorModel]: - """Delete app - - Delete one of your apps, the associated code, and all the runs as well. - - Args: - name (str): The name of the app to delete. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DeleteAppResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, -) -> DeleteAppResponse | ErrorModel | None: - """Delete app - - Delete one of your apps, the associated code, and all the runs as well. - - Args: - name (str): The name of the app to delete. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DeleteAppResponse | ErrorModel - """ - - return sync_detailed( - name=name, - client=client, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, -) -> Response[DeleteAppResponse | ErrorModel]: - """Delete app - - Delete one of your apps, the associated code, and all the runs as well. - - Args: - name (str): The name of the app to delete. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DeleteAppResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, -) -> DeleteAppResponse | ErrorModel | None: - """Delete app - - Delete one of your apps, the associated code, and all the runs as well. - - Args: - name (str): The name of the app to delete. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DeleteAppResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/delete_authenticator.py b/src/tower/tower_api_client/api/default/delete_authenticator.py deleted file mode 100644 index 29997b88..00000000 --- a/src/tower/tower_api_client/api/default/delete_authenticator.py +++ /dev/null @@ -1,167 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.delete_authenticator_params import DeleteAuthenticatorParams -from ...models.delete_authenticator_response import DeleteAuthenticatorResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - *, - body: DeleteAuthenticatorParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/authenticators", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DeleteAuthenticatorResponse | ErrorModel: - if response.status_code == 200: - response_200 = DeleteAuthenticatorResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DeleteAuthenticatorResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: DeleteAuthenticatorParams, -) -> Response[DeleteAuthenticatorResponse | ErrorModel]: - """Delete authenticator - - Removes an authenticator from your account so you're no longer required to provide it at login. - - Args: - body (DeleteAuthenticatorParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DeleteAuthenticatorResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: DeleteAuthenticatorParams, -) -> DeleteAuthenticatorResponse | ErrorModel | None: - """Delete authenticator - - Removes an authenticator from your account so you're no longer required to provide it at login. - - Args: - body (DeleteAuthenticatorParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DeleteAuthenticatorResponse | ErrorModel - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: DeleteAuthenticatorParams, -) -> Response[DeleteAuthenticatorResponse | ErrorModel]: - """Delete authenticator - - Removes an authenticator from your account so you're no longer required to provide it at login. - - Args: - body (DeleteAuthenticatorParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DeleteAuthenticatorResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: DeleteAuthenticatorParams, -) -> DeleteAuthenticatorResponse | ErrorModel | None: - """Delete authenticator - - Removes an authenticator from your account so you're no longer required to provide it at login. - - Args: - body (DeleteAuthenticatorParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DeleteAuthenticatorResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/delete_catalog.py b/src/tower/tower_api_client/api/default/delete_catalog.py deleted file mode 100644 index 3a967033..00000000 --- a/src/tower/tower_api_client/api/default/delete_catalog.py +++ /dev/null @@ -1,182 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.delete_catalog_response import DeleteCatalogResponse -from ...models.error_model import ErrorModel -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - name: str, - *, - environment: str | Unset = "default", -) -> dict[str, Any]: - params: dict[str, Any] = {} - - params["environment"] = environment - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/catalogs/{name}".format( - name=quote(str(name), safe=""), - ), - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DeleteCatalogResponse | ErrorModel: - if response.status_code == 204: - response_204 = DeleteCatalogResponse.from_dict(response.json()) - - return response_204 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DeleteCatalogResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, - environment: str | Unset = "default", -) -> Response[DeleteCatalogResponse | ErrorModel]: - """Delete catalog - - Delete a new catalog object in the currently authenticated account. - - Args: - name (str): The name of the catalog to update. - environment (str | Unset): The environment of the catalog to delete. Default: 'default'. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DeleteCatalogResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - environment=environment, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, - environment: str | Unset = "default", -) -> DeleteCatalogResponse | ErrorModel | None: - """Delete catalog - - Delete a new catalog object in the currently authenticated account. - - Args: - name (str): The name of the catalog to update. - environment (str | Unset): The environment of the catalog to delete. Default: 'default'. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DeleteCatalogResponse | ErrorModel - """ - - return sync_detailed( - name=name, - client=client, - environment=environment, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, - environment: str | Unset = "default", -) -> Response[DeleteCatalogResponse | ErrorModel]: - """Delete catalog - - Delete a new catalog object in the currently authenticated account. - - Args: - name (str): The name of the catalog to update. - environment (str | Unset): The environment of the catalog to delete. Default: 'default'. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DeleteCatalogResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - environment=environment, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, - environment: str | Unset = "default", -) -> DeleteCatalogResponse | ErrorModel | None: - """Delete catalog - - Delete a new catalog object in the currently authenticated account. - - Args: - name (str): The name of the catalog to update. - environment (str | Unset): The environment of the catalog to delete. Default: 'default'. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DeleteCatalogResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - environment=environment, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/delete_guest.py b/src/tower/tower_api_client/api/default/delete_guest.py deleted file mode 100644 index 36ae7014..00000000 --- a/src/tower/tower_api_client/api/default/delete_guest.py +++ /dev/null @@ -1,161 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.delete_guest_output_body import DeleteGuestOutputBody -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - guest_id: str, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/guests/{guest_id}".format( - guest_id=quote(str(guest_id), safe=""), - ), - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DeleteGuestOutputBody | ErrorModel: - if response.status_code == 204: - response_204 = DeleteGuestOutputBody.from_dict(response.json()) - - return response_204 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DeleteGuestOutputBody | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - guest_id: str, - *, - client: AuthenticatedClient, -) -> Response[DeleteGuestOutputBody | ErrorModel]: - """Delete guest - - Deletes a guest and revokes their access. Any active sessions will be invalidated. - - Args: - guest_id (str): The ID of the guest to delete. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DeleteGuestOutputBody | ErrorModel] - """ - - kwargs = _get_kwargs( - guest_id=guest_id, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - guest_id: str, - *, - client: AuthenticatedClient, -) -> DeleteGuestOutputBody | ErrorModel | None: - """Delete guest - - Deletes a guest and revokes their access. Any active sessions will be invalidated. - - Args: - guest_id (str): The ID of the guest to delete. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DeleteGuestOutputBody | ErrorModel - """ - - return sync_detailed( - guest_id=guest_id, - client=client, - ).parsed - - -async def asyncio_detailed( - guest_id: str, - *, - client: AuthenticatedClient, -) -> Response[DeleteGuestOutputBody | ErrorModel]: - """Delete guest - - Deletes a guest and revokes their access. Any active sessions will be invalidated. - - Args: - guest_id (str): The ID of the guest to delete. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DeleteGuestOutputBody | ErrorModel] - """ - - kwargs = _get_kwargs( - guest_id=guest_id, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - guest_id: str, - *, - client: AuthenticatedClient, -) -> DeleteGuestOutputBody | ErrorModel | None: - """Delete guest - - Deletes a guest and revokes their access. Any active sessions will be invalidated. - - Args: - guest_id (str): The ID of the guest to delete. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DeleteGuestOutputBody | ErrorModel - """ - - return ( - await asyncio_detailed( - guest_id=guest_id, - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/delete_schedule.py b/src/tower/tower_api_client/api/default/delete_schedule.py deleted file mode 100644 index a1b0e9d2..00000000 --- a/src/tower/tower_api_client/api/default/delete_schedule.py +++ /dev/null @@ -1,167 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.delete_schedule_params import DeleteScheduleParams -from ...models.delete_schedule_response import DeleteScheduleResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - *, - body: DeleteScheduleParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/schedules", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DeleteScheduleResponse | ErrorModel: - if response.status_code == 200: - response_200 = DeleteScheduleResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DeleteScheduleResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: DeleteScheduleParams, -) -> Response[DeleteScheduleResponse | ErrorModel]: - """Delete schedule - - Delete an existing schedule for an app. - - Args: - body (DeleteScheduleParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DeleteScheduleResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: DeleteScheduleParams, -) -> DeleteScheduleResponse | ErrorModel | None: - """Delete schedule - - Delete an existing schedule for an app. - - Args: - body (DeleteScheduleParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DeleteScheduleResponse | ErrorModel - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: DeleteScheduleParams, -) -> Response[DeleteScheduleResponse | ErrorModel]: - """Delete schedule - - Delete an existing schedule for an app. - - Args: - body (DeleteScheduleParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DeleteScheduleResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: DeleteScheduleParams, -) -> DeleteScheduleResponse | ErrorModel | None: - """Delete schedule - - Delete an existing schedule for an app. - - Args: - body (DeleteScheduleParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DeleteScheduleResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/delete_secret.py b/src/tower/tower_api_client/api/default/delete_secret.py deleted file mode 100644 index 3e0228f0..00000000 --- a/src/tower/tower_api_client/api/default/delete_secret.py +++ /dev/null @@ -1,182 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.delete_secret_response import DeleteSecretResponse -from ...models.error_model import ErrorModel -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - name: str, - *, - environment: str | Unset = UNSET, -) -> dict[str, Any]: - params: dict[str, Any] = {} - - params["environment"] = environment - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/secrets/{name}".format( - name=quote(str(name), safe=""), - ), - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DeleteSecretResponse | ErrorModel: - if response.status_code == 200: - response_200 = DeleteSecretResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DeleteSecretResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, - environment: str | Unset = UNSET, -) -> Response[DeleteSecretResponse | ErrorModel]: - """Delete secret - - Delete a secret by name. - - Args: - name (str): The name of the secret to delete. - environment (str | Unset): The environment of the secret to delete. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DeleteSecretResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - environment=environment, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, - environment: str | Unset = UNSET, -) -> DeleteSecretResponse | ErrorModel | None: - """Delete secret - - Delete a secret by name. - - Args: - name (str): The name of the secret to delete. - environment (str | Unset): The environment of the secret to delete. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DeleteSecretResponse | ErrorModel - """ - - return sync_detailed( - name=name, - client=client, - environment=environment, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, - environment: str | Unset = UNSET, -) -> Response[DeleteSecretResponse | ErrorModel]: - """Delete secret - - Delete a secret by name. - - Args: - name (str): The name of the secret to delete. - environment (str | Unset): The environment of the secret to delete. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DeleteSecretResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - environment=environment, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, - environment: str | Unset = UNSET, -) -> DeleteSecretResponse | ErrorModel | None: - """Delete secret - - Delete a secret by name. - - Args: - name (str): The name of the secret to delete. - environment (str | Unset): The environment of the secret to delete. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DeleteSecretResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - environment=environment, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/delete_session.py b/src/tower/tower_api_client/api/default/delete_session.py deleted file mode 100644 index 388eb413..00000000 --- a/src/tower/tower_api_client/api/default/delete_session.py +++ /dev/null @@ -1,168 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.delete_session_params import DeleteSessionParams -from ...models.delete_session_response import DeleteSessionResponse -from ...models.error_model import ErrorModel -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - body: DeleteSessionParams | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/session", - } - - if not isinstance(body, Unset): - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DeleteSessionResponse | ErrorModel: - if response.status_code == 200: - response_200 = DeleteSessionResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DeleteSessionResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: DeleteSessionParams | Unset = UNSET, -) -> Response[DeleteSessionResponse | ErrorModel]: - """Delete session - - Terminate a session and revoke the access keys associated with it. - - Args: - body (DeleteSessionParams | Unset): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DeleteSessionResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: DeleteSessionParams | Unset = UNSET, -) -> DeleteSessionResponse | ErrorModel | None: - """Delete session - - Terminate a session and revoke the access keys associated with it. - - Args: - body (DeleteSessionParams | Unset): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DeleteSessionResponse | ErrorModel - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: DeleteSessionParams | Unset = UNSET, -) -> Response[DeleteSessionResponse | ErrorModel]: - """Delete session - - Terminate a session and revoke the access keys associated with it. - - Args: - body (DeleteSessionParams | Unset): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DeleteSessionResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: DeleteSessionParams | Unset = UNSET, -) -> DeleteSessionResponse | ErrorModel | None: - """Delete session - - Terminate a session and revoke the access keys associated with it. - - Args: - body (DeleteSessionParams | Unset): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DeleteSessionResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/delete_team.py b/src/tower/tower_api_client/api/default/delete_team.py deleted file mode 100644 index e3602c40..00000000 --- a/src/tower/tower_api_client/api/default/delete_team.py +++ /dev/null @@ -1,167 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.delete_team_params import DeleteTeamParams -from ...models.delete_team_response import DeleteTeamResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - *, - body: DeleteTeamParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/teams", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DeleteTeamResponse | ErrorModel: - if response.status_code == 200: - response_200 = DeleteTeamResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DeleteTeamResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: DeleteTeamParams, -) -> Response[DeleteTeamResponse | ErrorModel]: - """Delete team - - Delete a new team - - Args: - body (DeleteTeamParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DeleteTeamResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: DeleteTeamParams, -) -> DeleteTeamResponse | ErrorModel | None: - """Delete team - - Delete a new team - - Args: - body (DeleteTeamParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DeleteTeamResponse | ErrorModel - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: DeleteTeamParams, -) -> Response[DeleteTeamResponse | ErrorModel]: - """Delete team - - Delete a new team - - Args: - body (DeleteTeamParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DeleteTeamResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: DeleteTeamParams, -) -> DeleteTeamResponse | ErrorModel | None: - """Delete team - - Delete a new team - - Args: - body (DeleteTeamParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DeleteTeamResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/delete_team_invitation.py b/src/tower/tower_api_client/api/default/delete_team_invitation.py deleted file mode 100644 index 82868305..00000000 --- a/src/tower/tower_api_client/api/default/delete_team_invitation.py +++ /dev/null @@ -1,183 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.delete_team_invitation_params import DeleteTeamInvitationParams -from ...models.delete_team_invitation_response import DeleteTeamInvitationResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - name: str, - *, - body: DeleteTeamInvitationParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/teams/{name}/invites".format( - name=quote(str(name), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DeleteTeamInvitationResponse | ErrorModel: - if response.status_code == 200: - response_200 = DeleteTeamInvitationResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DeleteTeamInvitationResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, - body: DeleteTeamInvitationParams, -) -> Response[DeleteTeamInvitationResponse | ErrorModel]: - """Delete team invitation - - Delete a pending team invitation that you have previously sent - - Args: - name (str): The name of the team to remove someone from - body (DeleteTeamInvitationParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DeleteTeamInvitationResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, - body: DeleteTeamInvitationParams, -) -> DeleteTeamInvitationResponse | ErrorModel | None: - """Delete team invitation - - Delete a pending team invitation that you have previously sent - - Args: - name (str): The name of the team to remove someone from - body (DeleteTeamInvitationParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DeleteTeamInvitationResponse | ErrorModel - """ - - return sync_detailed( - name=name, - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, - body: DeleteTeamInvitationParams, -) -> Response[DeleteTeamInvitationResponse | ErrorModel]: - """Delete team invitation - - Delete a pending team invitation that you have previously sent - - Args: - name (str): The name of the team to remove someone from - body (DeleteTeamInvitationParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DeleteTeamInvitationResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, - body: DeleteTeamInvitationParams, -) -> DeleteTeamInvitationResponse | ErrorModel | None: - """Delete team invitation - - Delete a pending team invitation that you have previously sent - - Args: - name (str): The name of the team to remove someone from - body (DeleteTeamInvitationParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DeleteTeamInvitationResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/delete_webhook.py b/src/tower/tower_api_client/api/default/delete_webhook.py deleted file mode 100644 index 5d5ca282..00000000 --- a/src/tower/tower_api_client/api/default/delete_webhook.py +++ /dev/null @@ -1,153 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.delete_webhook_response import DeleteWebhookResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - name: str, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/webhooks/{name}".format( - name=quote(str(name), safe=""), - ), - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DeleteWebhookResponse | ErrorModel: - if response.status_code == 200: - response_200 = DeleteWebhookResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DeleteWebhookResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, -) -> Response[DeleteWebhookResponse | ErrorModel]: - """Delete webhook - - Args: - name (str): The name of the webhook. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DeleteWebhookResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, -) -> DeleteWebhookResponse | ErrorModel | None: - """Delete webhook - - Args: - name (str): The name of the webhook. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DeleteWebhookResponse | ErrorModel - """ - - return sync_detailed( - name=name, - client=client, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, -) -> Response[DeleteWebhookResponse | ErrorModel]: - """Delete webhook - - Args: - name (str): The name of the webhook. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DeleteWebhookResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, -) -> DeleteWebhookResponse | ErrorModel | None: - """Delete webhook - - Args: - name (str): The name of the webhook. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DeleteWebhookResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/deploy_app.py b/src/tower/tower_api_client/api/default/deploy_app.py deleted file mode 100644 index 902a7b34..00000000 --- a/src/tower/tower_api_client/api/default/deploy_app.py +++ /dev/null @@ -1,256 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.deploy_app_json_body import DeployAppJsonBody -from ...models.deploy_app_response import DeployAppResponse -from ...models.error_model import ErrorModel -from ...types import UNSET, File, Response, Unset - - -def _get_kwargs( - name: str, - *, - body: DeployAppJsonBody | File | Unset = UNSET, - x_tower_checksum_sha256: str | Unset = UNSET, - content_length: int | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_tower_checksum_sha256, Unset): - headers["X-Tower-Checksum-SHA256"] = x_tower_checksum_sha256 - - if not isinstance(content_length, Unset): - headers["Content-Length"] = str(content_length) - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/apps/{name}/deploy".format( - name=quote(str(name), safe=""), - ), - } - - if isinstance(body, DeployAppJsonBody): - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - if isinstance(body, File): - _kwargs["content"] = body.payload - - headers["Content-Type"] = "application/octet-stream" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DeployAppResponse | ErrorModel | None: - if response.status_code == 201: - response_201 = DeployAppResponse.from_dict(response.json()) - - return response_201 - - if response.status_code == 400: - response_400 = ErrorModel.from_dict(response.json()) - - return response_400 - - if response.status_code == 422: - response_422 = ErrorModel.from_dict(response.json()) - - return response_422 - - if response.status_code == 500: - response_500 = ErrorModel.from_dict(response.json()) - - return response_500 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DeployAppResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, - body: DeployAppJsonBody | File | Unset = UNSET, - x_tower_checksum_sha256: str | Unset = UNSET, - content_length: int | Unset = UNSET, -) -> Response[DeployAppResponse | ErrorModel]: - """Deploy app - - Deploy a new version of an app. Accepts either a TAR file upload (application/tar) or a JSON body - with source_uri (application/json) for deploying from a GitHub repository. - - Args: - name (str): The name of the app to deploy. - x_tower_checksum_sha256 (str | Unset): The SHA256 hash of the content, used to verify - integrity. - content_length (int | Unset): Size of the uploaded bundle in bytes. - body (DeployAppJsonBody): Example: {'source_uri': 'https://github.com/tower/tower- - examples/tree/main/01-hello-world'}. - body (File): A .tar or .tar.gz file containing the code to deploy and MANIFEST Example: - . - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DeployAppResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - body=body, - x_tower_checksum_sha256=x_tower_checksum_sha256, - content_length=content_length, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, - body: DeployAppJsonBody | File | Unset = UNSET, - x_tower_checksum_sha256: str | Unset = UNSET, - content_length: int | Unset = UNSET, -) -> DeployAppResponse | ErrorModel | None: - """Deploy app - - Deploy a new version of an app. Accepts either a TAR file upload (application/tar) or a JSON body - with source_uri (application/json) for deploying from a GitHub repository. - - Args: - name (str): The name of the app to deploy. - x_tower_checksum_sha256 (str | Unset): The SHA256 hash of the content, used to verify - integrity. - content_length (int | Unset): Size of the uploaded bundle in bytes. - body (DeployAppJsonBody): Example: {'source_uri': 'https://github.com/tower/tower- - examples/tree/main/01-hello-world'}. - body (File): A .tar or .tar.gz file containing the code to deploy and MANIFEST Example: - . - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DeployAppResponse | ErrorModel - """ - - return sync_detailed( - name=name, - client=client, - body=body, - x_tower_checksum_sha256=x_tower_checksum_sha256, - content_length=content_length, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, - body: DeployAppJsonBody | File | Unset = UNSET, - x_tower_checksum_sha256: str | Unset = UNSET, - content_length: int | Unset = UNSET, -) -> Response[DeployAppResponse | ErrorModel]: - """Deploy app - - Deploy a new version of an app. Accepts either a TAR file upload (application/tar) or a JSON body - with source_uri (application/json) for deploying from a GitHub repository. - - Args: - name (str): The name of the app to deploy. - x_tower_checksum_sha256 (str | Unset): The SHA256 hash of the content, used to verify - integrity. - content_length (int | Unset): Size of the uploaded bundle in bytes. - body (DeployAppJsonBody): Example: {'source_uri': 'https://github.com/tower/tower- - examples/tree/main/01-hello-world'}. - body (File): A .tar or .tar.gz file containing the code to deploy and MANIFEST Example: - . - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DeployAppResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - body=body, - x_tower_checksum_sha256=x_tower_checksum_sha256, - content_length=content_length, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, - body: DeployAppJsonBody | File | Unset = UNSET, - x_tower_checksum_sha256: str | Unset = UNSET, - content_length: int | Unset = UNSET, -) -> DeployAppResponse | ErrorModel | None: - """Deploy app - - Deploy a new version of an app. Accepts either a TAR file upload (application/tar) or a JSON body - with source_uri (application/json) for deploying from a GitHub repository. - - Args: - name (str): The name of the app to deploy. - x_tower_checksum_sha256 (str | Unset): The SHA256 hash of the content, used to verify - integrity. - content_length (int | Unset): Size of the uploaded bundle in bytes. - body (DeployAppJsonBody): Example: {'source_uri': 'https://github.com/tower/tower- - examples/tree/main/01-hello-world'}. - body (File): A .tar or .tar.gz file containing the code to deploy and MANIFEST Example: - . - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DeployAppResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - body=body, - x_tower_checksum_sha256=x_tower_checksum_sha256, - content_length=content_length, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_account.py b/src/tower/tower_api_client/api/default/describe_account.py deleted file mode 100644 index 67354661..00000000 --- a/src/tower/tower_api_client/api/default/describe_account.py +++ /dev/null @@ -1,161 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.describe_account_body import DescribeAccountBody -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - name: str, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/accounts/{name}".format( - name=quote(str(name), safe=""), - ), - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DescribeAccountBody | ErrorModel: - if response.status_code == 200: - response_200 = DescribeAccountBody.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DescribeAccountBody | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, -) -> Response[DescribeAccountBody | ErrorModel]: - """Describe account - - Get information about a specific account by name. - - Args: - name (str): The name of the account to describe - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DescribeAccountBody | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, -) -> DescribeAccountBody | ErrorModel | None: - """Describe account - - Get information about a specific account by name. - - Args: - name (str): The name of the account to describe - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DescribeAccountBody | ErrorModel - """ - - return sync_detailed( - name=name, - client=client, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, -) -> Response[DescribeAccountBody | ErrorModel]: - """Describe account - - Get information about a specific account by name. - - Args: - name (str): The name of the account to describe - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DescribeAccountBody | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, -) -> DescribeAccountBody | ErrorModel | None: - """Describe account - - Get information about a specific account by name. - - Args: - name (str): The name of the account to describe - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DescribeAccountBody | ErrorModel - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_app.py b/src/tower/tower_api_client/api/default/describe_app.py deleted file mode 100644 index c9561e96..00000000 --- a/src/tower/tower_api_client/api/default/describe_app.py +++ /dev/null @@ -1,246 +0,0 @@ -import datetime -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.describe_app_response import DescribeAppResponse -from ...models.error_model import ErrorModel -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - name: str, - *, - runs: int | Unset = UNSET, - start_at: datetime.datetime | Unset = UNSET, - end_at: datetime.datetime | Unset = UNSET, - timezone: str | Unset = "UTC", -) -> dict[str, Any]: - params: dict[str, Any] = {} - - params["runs"] = runs - - json_start_at: str | Unset = UNSET - if not isinstance(start_at, Unset): - json_start_at = start_at.isoformat() - params["start_at"] = json_start_at - - json_end_at: str | Unset = UNSET - if not isinstance(end_at, Unset): - json_end_at = end_at.isoformat() - params["end_at"] = json_end_at - - params["timezone"] = timezone - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/apps/{name}".format( - name=quote(str(name), safe=""), - ), - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DescribeAppResponse | ErrorModel: - if response.status_code == 200: - response_200 = DescribeAppResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DescribeAppResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, - runs: int | Unset = UNSET, - start_at: datetime.datetime | Unset = UNSET, - end_at: datetime.datetime | Unset = UNSET, - timezone: str | Unset = "UTC", -) -> Response[DescribeAppResponse | ErrorModel]: - """Describe app - - Get all the runs for the current account. - - Args: - name (str): The name of the app to fetch. - runs (int | Unset): The number of recent runs to fetch for the app. - start_at (datetime.datetime | Unset): Filter runs scheduled after this datetime - (inclusive). Provide timestamps in ISO-8601 format. - end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime - (inclusive). Provide timestamps in ISO-8601 format. - timezone (str | Unset): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to - UTC. Default: 'UTC'. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DescribeAppResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - runs=runs, - start_at=start_at, - end_at=end_at, - timezone=timezone, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, - runs: int | Unset = UNSET, - start_at: datetime.datetime | Unset = UNSET, - end_at: datetime.datetime | Unset = UNSET, - timezone: str | Unset = "UTC", -) -> DescribeAppResponse | ErrorModel | None: - """Describe app - - Get all the runs for the current account. - - Args: - name (str): The name of the app to fetch. - runs (int | Unset): The number of recent runs to fetch for the app. - start_at (datetime.datetime | Unset): Filter runs scheduled after this datetime - (inclusive). Provide timestamps in ISO-8601 format. - end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime - (inclusive). Provide timestamps in ISO-8601 format. - timezone (str | Unset): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to - UTC. Default: 'UTC'. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DescribeAppResponse | ErrorModel - """ - - return sync_detailed( - name=name, - client=client, - runs=runs, - start_at=start_at, - end_at=end_at, - timezone=timezone, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, - runs: int | Unset = UNSET, - start_at: datetime.datetime | Unset = UNSET, - end_at: datetime.datetime | Unset = UNSET, - timezone: str | Unset = "UTC", -) -> Response[DescribeAppResponse | ErrorModel]: - """Describe app - - Get all the runs for the current account. - - Args: - name (str): The name of the app to fetch. - runs (int | Unset): The number of recent runs to fetch for the app. - start_at (datetime.datetime | Unset): Filter runs scheduled after this datetime - (inclusive). Provide timestamps in ISO-8601 format. - end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime - (inclusive). Provide timestamps in ISO-8601 format. - timezone (str | Unset): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to - UTC. Default: 'UTC'. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DescribeAppResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - runs=runs, - start_at=start_at, - end_at=end_at, - timezone=timezone, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, - runs: int | Unset = UNSET, - start_at: datetime.datetime | Unset = UNSET, - end_at: datetime.datetime | Unset = UNSET, - timezone: str | Unset = "UTC", -) -> DescribeAppResponse | ErrorModel | None: - """Describe app - - Get all the runs for the current account. - - Args: - name (str): The name of the app to fetch. - runs (int | Unset): The number of recent runs to fetch for the app. - start_at (datetime.datetime | Unset): Filter runs scheduled after this datetime - (inclusive). Provide timestamps in ISO-8601 format. - end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime - (inclusive). Provide timestamps in ISO-8601 format. - timezone (str | Unset): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to - UTC. Default: 'UTC'. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DescribeAppResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - runs=runs, - start_at=start_at, - end_at=end_at, - timezone=timezone, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_app_version.py b/src/tower/tower_api_client/api/default/describe_app_version.py deleted file mode 100644 index 88d8c45e..00000000 --- a/src/tower/tower_api_client/api/default/describe_app_version.py +++ /dev/null @@ -1,175 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.describe_app_version_response import DescribeAppVersionResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - name: str, - num: str, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/apps/{name}/versions/{num}".format( - name=quote(str(name), safe=""), - num=quote(str(num), safe=""), - ), - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DescribeAppVersionResponse | ErrorModel: - if response.status_code == 200: - response_200 = DescribeAppVersionResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DescribeAppVersionResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - num: str, - *, - client: AuthenticatedClient, -) -> Response[DescribeAppVersionResponse | ErrorModel]: - """Describe app version - - Describe an app version for an app in the current account. - - Args: - name (str): The name of the app to get the version for. - num (str): The version string to get the version for. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DescribeAppVersionResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - num=num, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - num: str, - *, - client: AuthenticatedClient, -) -> DescribeAppVersionResponse | ErrorModel | None: - """Describe app version - - Describe an app version for an app in the current account. - - Args: - name (str): The name of the app to get the version for. - num (str): The version string to get the version for. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DescribeAppVersionResponse | ErrorModel - """ - - return sync_detailed( - name=name, - num=num, - client=client, - ).parsed - - -async def asyncio_detailed( - name: str, - num: str, - *, - client: AuthenticatedClient, -) -> Response[DescribeAppVersionResponse | ErrorModel]: - """Describe app version - - Describe an app version for an app in the current account. - - Args: - name (str): The name of the app to get the version for. - num (str): The version string to get the version for. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DescribeAppVersionResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - num=num, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - num: str, - *, - client: AuthenticatedClient, -) -> DescribeAppVersionResponse | ErrorModel | None: - """Describe app version - - Describe an app version for an app in the current account. - - Args: - name (str): The name of the app to get the version for. - num (str): The version string to get the version for. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DescribeAppVersionResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - name=name, - num=num, - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_authentication_context.py b/src/tower/tower_api_client/api/default/describe_authentication_context.py deleted file mode 100644 index be67bb9b..00000000 --- a/src/tower/tower_api_client/api/default/describe_authentication_context.py +++ /dev/null @@ -1,140 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.describe_authentication_context_body import ( - DescribeAuthenticationContextBody, -) -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/user/auth-context", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DescribeAuthenticationContextBody | ErrorModel: - if response.status_code == 200: - response_200 = DescribeAuthenticationContextBody.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DescribeAuthenticationContextBody | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, -) -> Response[DescribeAuthenticationContextBody | ErrorModel]: - """Describe authentication context - - This API endpoint returns information about the current authentication context for the user that's - used for various internal processes in Tower UI. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DescribeAuthenticationContextBody | ErrorModel] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, -) -> DescribeAuthenticationContextBody | ErrorModel | None: - """Describe authentication context - - This API endpoint returns information about the current authentication context for the user that's - used for various internal processes in Tower UI. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DescribeAuthenticationContextBody | ErrorModel - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, -) -> Response[DescribeAuthenticationContextBody | ErrorModel]: - """Describe authentication context - - This API endpoint returns information about the current authentication context for the user that's - used for various internal processes in Tower UI. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DescribeAuthenticationContextBody | ErrorModel] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, -) -> DescribeAuthenticationContextBody | ErrorModel | None: - """Describe authentication context - - This API endpoint returns information about the current authentication context for the user that's - used for various internal processes in Tower UI. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DescribeAuthenticationContextBody | ErrorModel - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_catalog.py b/src/tower/tower_api_client/api/default/describe_catalog.py deleted file mode 100644 index 9f990bb3..00000000 --- a/src/tower/tower_api_client/api/default/describe_catalog.py +++ /dev/null @@ -1,182 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.describe_catalog_response import DescribeCatalogResponse -from ...models.error_model import ErrorModel -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - name: str, - *, - environment: str | Unset = "default", -) -> dict[str, Any]: - params: dict[str, Any] = {} - - params["environment"] = environment - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/catalogs/{name}".format( - name=quote(str(name), safe=""), - ), - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DescribeCatalogResponse | ErrorModel: - if response.status_code == 200: - response_200 = DescribeCatalogResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DescribeCatalogResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, - environment: str | Unset = "default", -) -> Response[DescribeCatalogResponse | ErrorModel]: - """Describe catalog - - Returns details for a specific catalog, including its property names and previews. - - Args: - name (str): The name of the catalog. - environment (str | Unset): The environment of the catalog. Default: 'default'. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DescribeCatalogResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - environment=environment, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, - environment: str | Unset = "default", -) -> DescribeCatalogResponse | ErrorModel | None: - """Describe catalog - - Returns details for a specific catalog, including its property names and previews. - - Args: - name (str): The name of the catalog. - environment (str | Unset): The environment of the catalog. Default: 'default'. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DescribeCatalogResponse | ErrorModel - """ - - return sync_detailed( - name=name, - client=client, - environment=environment, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, - environment: str | Unset = "default", -) -> Response[DescribeCatalogResponse | ErrorModel]: - """Describe catalog - - Returns details for a specific catalog, including its property names and previews. - - Args: - name (str): The name of the catalog. - environment (str | Unset): The environment of the catalog. Default: 'default'. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DescribeCatalogResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - environment=environment, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, - environment: str | Unset = "default", -) -> DescribeCatalogResponse | ErrorModel | None: - """Describe catalog - - Returns details for a specific catalog, including its property names and previews. - - Args: - name (str): The name of the catalog. - environment (str | Unset): The environment of the catalog. Default: 'default'. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DescribeCatalogResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - environment=environment, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_device_login_session.py b/src/tower/tower_api_client/api/default/describe_device_login_session.py deleted file mode 100644 index 500b35d1..00000000 --- a/src/tower/tower_api_client/api/default/describe_device_login_session.py +++ /dev/null @@ -1,163 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.describe_device_login_session_response import ( - DescribeDeviceLoginSessionResponse, -) -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - device_code: str, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/login/device/{device_code}".format( - device_code=quote(str(device_code), safe=""), - ), - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DescribeDeviceLoginSessionResponse | ErrorModel: - if response.status_code == 200: - response_200 = DescribeDeviceLoginSessionResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DescribeDeviceLoginSessionResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - device_code: str, - *, - client: AuthenticatedClient | Client, -) -> Response[DescribeDeviceLoginSessionResponse | ErrorModel]: - """Describe device login session - - Checks if a device login code has been claimed and returns the user session if so. - - Args: - device_code (str): The device code to check. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DescribeDeviceLoginSessionResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - device_code=device_code, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - device_code: str, - *, - client: AuthenticatedClient | Client, -) -> DescribeDeviceLoginSessionResponse | ErrorModel | None: - """Describe device login session - - Checks if a device login code has been claimed and returns the user session if so. - - Args: - device_code (str): The device code to check. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DescribeDeviceLoginSessionResponse | ErrorModel - """ - - return sync_detailed( - device_code=device_code, - client=client, - ).parsed - - -async def asyncio_detailed( - device_code: str, - *, - client: AuthenticatedClient | Client, -) -> Response[DescribeDeviceLoginSessionResponse | ErrorModel]: - """Describe device login session - - Checks if a device login code has been claimed and returns the user session if so. - - Args: - device_code (str): The device code to check. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DescribeDeviceLoginSessionResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - device_code=device_code, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - device_code: str, - *, - client: AuthenticatedClient | Client, -) -> DescribeDeviceLoginSessionResponse | ErrorModel | None: - """Describe device login session - - Checks if a device login code has been claimed and returns the user session if so. - - Args: - device_code (str): The device code to check. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DescribeDeviceLoginSessionResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - device_code=device_code, - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_email_preferences.py b/src/tower/tower_api_client/api/default/describe_email_preferences.py deleted file mode 100644 index aa842aac..00000000 --- a/src/tower/tower_api_client/api/default/describe_email_preferences.py +++ /dev/null @@ -1,134 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.describe_email_preferences_body import DescribeEmailPreferencesBody -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/user/email-preferences", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DescribeEmailPreferencesBody | ErrorModel: - if response.status_code == 200: - response_200 = DescribeEmailPreferencesBody.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DescribeEmailPreferencesBody | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, -) -> Response[DescribeEmailPreferencesBody | ErrorModel]: - """Describe email preferences - - Describes the current user's email preferences. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DescribeEmailPreferencesBody | ErrorModel] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, -) -> DescribeEmailPreferencesBody | ErrorModel | None: - """Describe email preferences - - Describes the current user's email preferences. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DescribeEmailPreferencesBody | ErrorModel - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, -) -> Response[DescribeEmailPreferencesBody | ErrorModel]: - """Describe email preferences - - Describes the current user's email preferences. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DescribeEmailPreferencesBody | ErrorModel] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, -) -> DescribeEmailPreferencesBody | ErrorModel | None: - """Describe email preferences - - Describes the current user's email preferences. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DescribeEmailPreferencesBody | ErrorModel - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_organization_usage.py b/src/tower/tower_api_client/api/default/describe_organization_usage.py deleted file mode 100644 index 9cfc44c2..00000000 --- a/src/tower/tower_api_client/api/default/describe_organization_usage.py +++ /dev/null @@ -1,134 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.organization_usage import OrganizationUsage -from ...types import Response - - -def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/usage", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | OrganizationUsage: - if response.status_code == 200: - response_200 = OrganizationUsage.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | OrganizationUsage]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, -) -> Response[ErrorModel | OrganizationUsage]: - """Describe organization usage - - Describe usage statistics for the user's organization. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | OrganizationUsage] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, -) -> ErrorModel | OrganizationUsage | None: - """Describe organization usage - - Describe usage statistics for the user's organization. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | OrganizationUsage - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, -) -> Response[ErrorModel | OrganizationUsage]: - """Describe organization usage - - Describe usage statistics for the user's organization. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | OrganizationUsage] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, -) -> ErrorModel | OrganizationUsage | None: - """Describe organization usage - - Describe usage statistics for the user's organization. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | OrganizationUsage - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_plan.py b/src/tower/tower_api_client/api/default/describe_plan.py deleted file mode 100644 index 1648caad..00000000 --- a/src/tower/tower_api_client/api/default/describe_plan.py +++ /dev/null @@ -1,181 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.describe_plan_response import DescribePlanResponse -from ...models.error_model import ErrorModel -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - page: int | Unset = 1, - page_size: int | Unset = 20, -) -> dict[str, Any]: - params: dict[str, Any] = {} - - params["page"] = page - - params["page_size"] = page_size - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/plan", - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DescribePlanResponse | ErrorModel: - if response.status_code == 200: - response_200 = DescribePlanResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DescribePlanResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, -) -> Response[DescribePlanResponse | ErrorModel]: - """Describe plan - - Get the current plan for the account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DescribePlanResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - page=page, - page_size=page_size, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, -) -> DescribePlanResponse | ErrorModel | None: - """Describe plan - - Get the current plan for the account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DescribePlanResponse | ErrorModel - """ - - return sync_detailed( - client=client, - page=page, - page_size=page_size, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, -) -> Response[DescribePlanResponse | ErrorModel]: - """Describe plan - - Get the current plan for the account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DescribePlanResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - page=page, - page_size=page_size, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, -) -> DescribePlanResponse | ErrorModel | None: - """Describe plan - - Get the current plan for the account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DescribePlanResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - client=client, - page=page, - page_size=page_size, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_run.py b/src/tower/tower_api_client/api/default/describe_run.py deleted file mode 100644 index 7b8ef617..00000000 --- a/src/tower/tower_api_client/api/default/describe_run.py +++ /dev/null @@ -1,187 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.describe_run_response import DescribeRunResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - name: str, - seq: int, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/apps/{name}/runs/{seq}".format( - name=quote(str(name), safe=""), - seq=quote(str(seq), safe=""), - ), - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DescribeRunResponse | ErrorModel | None: - if response.status_code == 200: - response_200 = DescribeRunResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 401: - response_401 = ErrorModel.from_dict(response.json()) - - return response_401 - - if response.status_code == 404: - response_404 = ErrorModel.from_dict(response.json()) - - return response_404 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DescribeRunResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - seq: int, - *, - client: AuthenticatedClient, -) -> Response[DescribeRunResponse | ErrorModel]: - """Describe run - - Describe a run of an app. - - Args: - name (str): The name of the app to fetch runs for. - seq (int): The number of the run to fetch. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DescribeRunResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - seq=seq, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - seq: int, - *, - client: AuthenticatedClient, -) -> DescribeRunResponse | ErrorModel | None: - """Describe run - - Describe a run of an app. - - Args: - name (str): The name of the app to fetch runs for. - seq (int): The number of the run to fetch. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DescribeRunResponse | ErrorModel - """ - - return sync_detailed( - name=name, - seq=seq, - client=client, - ).parsed - - -async def asyncio_detailed( - name: str, - seq: int, - *, - client: AuthenticatedClient, -) -> Response[DescribeRunResponse | ErrorModel]: - """Describe run - - Describe a run of an app. - - Args: - name (str): The name of the app to fetch runs for. - seq (int): The number of the run to fetch. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DescribeRunResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - seq=seq, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - seq: int, - *, - client: AuthenticatedClient, -) -> DescribeRunResponse | ErrorModel | None: - """Describe run - - Describe a run of an app. - - Args: - name (str): The name of the app to fetch runs for. - seq (int): The number of the run to fetch. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DescribeRunResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - name=name, - seq=seq, - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_run_graph.py b/src/tower/tower_api_client/api/default/describe_run_graph.py deleted file mode 100644 index f12583be..00000000 --- a/src/tower/tower_api_client/api/default/describe_run_graph.py +++ /dev/null @@ -1,187 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.describe_run_graph_response import DescribeRunGraphResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - name: str, - seq: int, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/apps/{name}/runs/{seq}/graph".format( - name=quote(str(name), safe=""), - seq=quote(str(seq), safe=""), - ), - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DescribeRunGraphResponse | ErrorModel | None: - if response.status_code == 200: - response_200 = DescribeRunGraphResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 401: - response_401 = ErrorModel.from_dict(response.json()) - - return response_401 - - if response.status_code == 404: - response_404 = ErrorModel.from_dict(response.json()) - - return response_404 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DescribeRunGraphResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - seq: int, - *, - client: AuthenticatedClient, -) -> Response[DescribeRunGraphResponse | ErrorModel]: - """Describe run graph - - Describe the graph that a run belongs to. - - Args: - name (str): The name of the app. - seq (int): The number of the run to fetch. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DescribeRunGraphResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - seq=seq, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - seq: int, - *, - client: AuthenticatedClient, -) -> DescribeRunGraphResponse | ErrorModel | None: - """Describe run graph - - Describe the graph that a run belongs to. - - Args: - name (str): The name of the app. - seq (int): The number of the run to fetch. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DescribeRunGraphResponse | ErrorModel - """ - - return sync_detailed( - name=name, - seq=seq, - client=client, - ).parsed - - -async def asyncio_detailed( - name: str, - seq: int, - *, - client: AuthenticatedClient, -) -> Response[DescribeRunGraphResponse | ErrorModel]: - """Describe run graph - - Describe the graph that a run belongs to. - - Args: - name (str): The name of the app. - seq (int): The number of the run to fetch. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DescribeRunGraphResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - seq=seq, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - seq: int, - *, - client: AuthenticatedClient, -) -> DescribeRunGraphResponse | ErrorModel | None: - """Describe run graph - - Describe the graph that a run belongs to. - - Args: - name (str): The name of the app. - seq (int): The number of the run to fetch. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DescribeRunGraphResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - name=name, - seq=seq, - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_run_logs.py b/src/tower/tower_api_client/api/default/describe_run_logs.py deleted file mode 100644 index 0d205fdf..00000000 --- a/src/tower/tower_api_client/api/default/describe_run_logs.py +++ /dev/null @@ -1,200 +0,0 @@ -import datetime -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.describe_run_logs_response import DescribeRunLogsResponse -from ...models.error_model import ErrorModel -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - name: str, - seq: int, - *, - start_at: datetime.datetime | Unset = UNSET, -) -> dict[str, Any]: - params: dict[str, Any] = {} - - json_start_at: str | Unset = UNSET - if not isinstance(start_at, Unset): - json_start_at = start_at.isoformat() - params["start_at"] = json_start_at - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/apps/{name}/runs/{seq}/logs".format( - name=quote(str(name), safe=""), - seq=quote(str(seq), safe=""), - ), - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DescribeRunLogsResponse | ErrorModel: - if response.status_code == 200: - response_200 = DescribeRunLogsResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DescribeRunLogsResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - seq: int, - *, - client: AuthenticatedClient, - start_at: datetime.datetime | Unset = UNSET, -) -> Response[DescribeRunLogsResponse | ErrorModel]: - """Describe run logs - - Retrieves the logs associated with a particular run of an app. - - Args: - name (str): The name of the app to get logs for. - seq (int): The sequence number of the run to get logs for. - start_at (datetime.datetime | Unset): Fetch logs from this timestamp onwards (inclusive). - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DescribeRunLogsResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - seq=seq, - start_at=start_at, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - seq: int, - *, - client: AuthenticatedClient, - start_at: datetime.datetime | Unset = UNSET, -) -> DescribeRunLogsResponse | ErrorModel | None: - """Describe run logs - - Retrieves the logs associated with a particular run of an app. - - Args: - name (str): The name of the app to get logs for. - seq (int): The sequence number of the run to get logs for. - start_at (datetime.datetime | Unset): Fetch logs from this timestamp onwards (inclusive). - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DescribeRunLogsResponse | ErrorModel - """ - - return sync_detailed( - name=name, - seq=seq, - client=client, - start_at=start_at, - ).parsed - - -async def asyncio_detailed( - name: str, - seq: int, - *, - client: AuthenticatedClient, - start_at: datetime.datetime | Unset = UNSET, -) -> Response[DescribeRunLogsResponse | ErrorModel]: - """Describe run logs - - Retrieves the logs associated with a particular run of an app. - - Args: - name (str): The name of the app to get logs for. - seq (int): The sequence number of the run to get logs for. - start_at (datetime.datetime | Unset): Fetch logs from this timestamp onwards (inclusive). - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DescribeRunLogsResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - seq=seq, - start_at=start_at, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - seq: int, - *, - client: AuthenticatedClient, - start_at: datetime.datetime | Unset = UNSET, -) -> DescribeRunLogsResponse | ErrorModel | None: - """Describe run logs - - Retrieves the logs associated with a particular run of an app. - - Args: - name (str): The name of the app to get logs for. - seq (int): The sequence number of the run to get logs for. - start_at (datetime.datetime | Unset): Fetch logs from this timestamp onwards (inclusive). - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DescribeRunLogsResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - name=name, - seq=seq, - client=client, - start_at=start_at, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_secrets_key.py b/src/tower/tower_api_client/api/default/describe_secrets_key.py deleted file mode 100644 index cf2a3e8e..00000000 --- a/src/tower/tower_api_client/api/default/describe_secrets_key.py +++ /dev/null @@ -1,166 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.describe_secrets_key_response import DescribeSecretsKeyResponse -from ...models.error_model import ErrorModel -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - format_: str | Unset = UNSET, -) -> dict[str, Any]: - params: dict[str, Any] = {} - - params["format"] = format_ - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/secrets/key", - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DescribeSecretsKeyResponse | ErrorModel: - if response.status_code == 200: - response_200 = DescribeSecretsKeyResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DescribeSecretsKeyResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - format_: str | Unset = UNSET, -) -> Response[DescribeSecretsKeyResponse | ErrorModel]: - """Describe encryption key - - Gets the encryption key used for encrypting secrets that you want to create in Tower. - - Args: - format_ (str | Unset): The format to return the key in. Options are 'pkcs1' and 'spki'. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DescribeSecretsKeyResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - format_=format_, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - format_: str | Unset = UNSET, -) -> DescribeSecretsKeyResponse | ErrorModel | None: - """Describe encryption key - - Gets the encryption key used for encrypting secrets that you want to create in Tower. - - Args: - format_ (str | Unset): The format to return the key in. Options are 'pkcs1' and 'spki'. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DescribeSecretsKeyResponse | ErrorModel - """ - - return sync_detailed( - client=client, - format_=format_, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - format_: str | Unset = UNSET, -) -> Response[DescribeSecretsKeyResponse | ErrorModel]: - """Describe encryption key - - Gets the encryption key used for encrypting secrets that you want to create in Tower. - - Args: - format_ (str | Unset): The format to return the key in. Options are 'pkcs1' and 'spki'. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DescribeSecretsKeyResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - format_=format_, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - format_: str | Unset = UNSET, -) -> DescribeSecretsKeyResponse | ErrorModel | None: - """Describe encryption key - - Gets the encryption key used for encrypting secrets that you want to create in Tower. - - Args: - format_ (str | Unset): The format to return the key in. Options are 'pkcs1' and 'spki'. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DescribeSecretsKeyResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - client=client, - format_=format_, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_session.py b/src/tower/tower_api_client/api/default/describe_session.py deleted file mode 100644 index c050a314..00000000 --- a/src/tower/tower_api_client/api/default/describe_session.py +++ /dev/null @@ -1,134 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.describe_session_response import DescribeSessionResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/session", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DescribeSessionResponse | ErrorModel: - if response.status_code == 200: - response_200 = DescribeSessionResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DescribeSessionResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, -) -> Response[DescribeSessionResponse | ErrorModel]: - """Describe session - - Validate your current session and return the user information associated with the session. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DescribeSessionResponse | ErrorModel] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, -) -> DescribeSessionResponse | ErrorModel | None: - """Describe session - - Validate your current session and return the user information associated with the session. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DescribeSessionResponse | ErrorModel - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, -) -> Response[DescribeSessionResponse | ErrorModel]: - """Describe session - - Validate your current session and return the user information associated with the session. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DescribeSessionResponse | ErrorModel] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, -) -> DescribeSessionResponse | ErrorModel | None: - """Describe session - - Validate your current session and return the user information associated with the session. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DescribeSessionResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_team.py b/src/tower/tower_api_client/api/default/describe_team.py deleted file mode 100644 index 83ae525c..00000000 --- a/src/tower/tower_api_client/api/default/describe_team.py +++ /dev/null @@ -1,161 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.describe_team_response import DescribeTeamResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - name: str, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/teams/{name}".format( - name=quote(str(name), safe=""), - ), - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DescribeTeamResponse | ErrorModel: - if response.status_code == 200: - response_200 = DescribeTeamResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DescribeTeamResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, -) -> Response[DescribeTeamResponse | ErrorModel]: - """Describe team - - Get details about a team, including its members and invitations. - - Args: - name (str): The name of the team to fetch. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DescribeTeamResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, -) -> DescribeTeamResponse | ErrorModel | None: - """Describe team - - Get details about a team, including its members and invitations. - - Args: - name (str): The name of the team to fetch. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DescribeTeamResponse | ErrorModel - """ - - return sync_detailed( - name=name, - client=client, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, -) -> Response[DescribeTeamResponse | ErrorModel]: - """Describe team - - Get details about a team, including its members and invitations. - - Args: - name (str): The name of the team to fetch. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DescribeTeamResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, -) -> DescribeTeamResponse | ErrorModel | None: - """Describe team - - Get details about a team, including its members and invitations. - - Args: - name (str): The name of the team to fetch. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DescribeTeamResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_webhook.py b/src/tower/tower_api_client/api/default/describe_webhook.py deleted file mode 100644 index 43ec17a1..00000000 --- a/src/tower/tower_api_client/api/default/describe_webhook.py +++ /dev/null @@ -1,153 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.describe_webhook_response import DescribeWebhookResponse -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs( - name: str, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/webhooks/{name}".format( - name=quote(str(name), safe=""), - ), - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DescribeWebhookResponse | ErrorModel: - if response.status_code == 200: - response_200 = DescribeWebhookResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DescribeWebhookResponse | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, -) -> Response[DescribeWebhookResponse | ErrorModel]: - """Describe webhook - - Args: - name (str): The name of the webhook. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DescribeWebhookResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, -) -> DescribeWebhookResponse | ErrorModel | None: - """Describe webhook - - Args: - name (str): The name of the webhook. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DescribeWebhookResponse | ErrorModel - """ - - return sync_detailed( - name=name, - client=client, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, -) -> Response[DescribeWebhookResponse | ErrorModel]: - """Describe webhook - - Args: - name (str): The name of the webhook. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[DescribeWebhookResponse | ErrorModel] - """ - - kwargs = _get_kwargs( - name=name, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, -) -> DescribeWebhookResponse | ErrorModel | None: - """Describe webhook - - Args: - name (str): The name of the webhook. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - DescribeWebhookResponse | ErrorModel - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/export_catalogs.py b/src/tower/tower_api_client/api/default/export_catalogs.py deleted file mode 100644 index 093e5f30..00000000 --- a/src/tower/tower_api_client/api/default/export_catalogs.py +++ /dev/null @@ -1,167 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.export_catalogs_params import ExportCatalogsParams -from ...models.export_catalogs_response import ExportCatalogsResponse -from ...types import Response - - -def _get_kwargs( - *, - body: ExportCatalogsParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/catalogs/export", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | ExportCatalogsResponse: - if response.status_code == 200: - response_200 = ExportCatalogsResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | ExportCatalogsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: ExportCatalogsParams, -) -> Response[ErrorModel | ExportCatalogsResponse]: - """Export catalogs - - Lists all the catalogs in your current account and re-encrypt them with the public key you supplied. - - Args: - body (ExportCatalogsParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ExportCatalogsResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: ExportCatalogsParams, -) -> ErrorModel | ExportCatalogsResponse | None: - """Export catalogs - - Lists all the catalogs in your current account and re-encrypt them with the public key you supplied. - - Args: - body (ExportCatalogsParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ExportCatalogsResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: ExportCatalogsParams, -) -> Response[ErrorModel | ExportCatalogsResponse]: - """Export catalogs - - Lists all the catalogs in your current account and re-encrypt them with the public key you supplied. - - Args: - body (ExportCatalogsParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ExportCatalogsResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: ExportCatalogsParams, -) -> ErrorModel | ExportCatalogsResponse | None: - """Export catalogs - - Lists all the catalogs in your current account and re-encrypt them with the public key you supplied. - - Args: - body (ExportCatalogsParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ExportCatalogsResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/export_secrets.py b/src/tower/tower_api_client/api/default/export_secrets.py deleted file mode 100644 index 3433482b..00000000 --- a/src/tower/tower_api_client/api/default/export_secrets.py +++ /dev/null @@ -1,167 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.export_secrets_params import ExportSecretsParams -from ...models.export_secrets_response import ExportSecretsResponse -from ...types import Response - - -def _get_kwargs( - *, - body: ExportSecretsParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/secrets/export", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | ExportSecretsResponse: - if response.status_code == 200: - response_200 = ExportSecretsResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | ExportSecretsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: ExportSecretsParams, -) -> Response[ErrorModel | ExportSecretsResponse]: - """Export secrets - - Lists all the secrets in your current account and re-encrypt them with the public key you supplied. - - Args: - body (ExportSecretsParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ExportSecretsResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: ExportSecretsParams, -) -> ErrorModel | ExportSecretsResponse | None: - """Export secrets - - Lists all the secrets in your current account and re-encrypt them with the public key you supplied. - - Args: - body (ExportSecretsParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ExportSecretsResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: ExportSecretsParams, -) -> Response[ErrorModel | ExportSecretsResponse]: - """Export secrets - - Lists all the secrets in your current account and re-encrypt them with the public key you supplied. - - Args: - body (ExportSecretsParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ExportSecretsResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: ExportSecretsParams, -) -> ErrorModel | ExportSecretsResponse | None: - """Export secrets - - Lists all the secrets in your current account and re-encrypt them with the public key you supplied. - - Args: - body (ExportSecretsParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ExportSecretsResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/generate_app_statistics.py b/src/tower/tower_api_client/api/default/generate_app_statistics.py deleted file mode 100644 index 3b9d7db4..00000000 --- a/src/tower/tower_api_client/api/default/generate_app_statistics.py +++ /dev/null @@ -1,170 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.generate_app_statistics_response import GenerateAppStatisticsResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - environment: str | Unset = UNSET, -) -> dict[str, Any]: - params: dict[str, Any] = {} - - params["environment"] = environment - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/stats/apps", - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | GenerateAppStatisticsResponse: - if response.status_code == 200: - response_200 = GenerateAppStatisticsResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | GenerateAppStatisticsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - environment: str | Unset = UNSET, -) -> Response[ErrorModel | GenerateAppStatisticsResponse]: - """Generate app statistics - - Generates current statistics about apps - - Args: - environment (str | Unset): The environment to filter the statistics by. If not provided, - statistics for all environments will be returned. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | GenerateAppStatisticsResponse] - """ - - kwargs = _get_kwargs( - environment=environment, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - environment: str | Unset = UNSET, -) -> ErrorModel | GenerateAppStatisticsResponse | None: - """Generate app statistics - - Generates current statistics about apps - - Args: - environment (str | Unset): The environment to filter the statistics by. If not provided, - statistics for all environments will be returned. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | GenerateAppStatisticsResponse - """ - - return sync_detailed( - client=client, - environment=environment, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - environment: str | Unset = UNSET, -) -> Response[ErrorModel | GenerateAppStatisticsResponse]: - """Generate app statistics - - Generates current statistics about apps - - Args: - environment (str | Unset): The environment to filter the statistics by. If not provided, - statistics for all environments will be returned. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | GenerateAppStatisticsResponse] - """ - - kwargs = _get_kwargs( - environment=environment, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - environment: str | Unset = UNSET, -) -> ErrorModel | GenerateAppStatisticsResponse | None: - """Generate app statistics - - Generates current statistics about apps - - Args: - environment (str | Unset): The environment to filter the statistics by. If not provided, - statistics for all environments will be returned. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | GenerateAppStatisticsResponse - """ - - return ( - await asyncio_detailed( - client=client, - environment=environment, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/generate_authenticator.py b/src/tower/tower_api_client/api/default/generate_authenticator.py deleted file mode 100644 index a2f21bb8..00000000 --- a/src/tower/tower_api_client/api/default/generate_authenticator.py +++ /dev/null @@ -1,134 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.generate_authenticator_response import GenerateAuthenticatorResponse -from ...types import Response - - -def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/authenticators/generate", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | GenerateAuthenticatorResponse: - if response.status_code == 200: - response_200 = GenerateAuthenticatorResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | GenerateAuthenticatorResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, -) -> Response[ErrorModel | GenerateAuthenticatorResponse]: - """Generate authenticator - - Generates a new authenticator for the user. This is used to set up two-factor authentication. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | GenerateAuthenticatorResponse] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, -) -> ErrorModel | GenerateAuthenticatorResponse | None: - """Generate authenticator - - Generates a new authenticator for the user. This is used to set up two-factor authentication. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | GenerateAuthenticatorResponse - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, -) -> Response[ErrorModel | GenerateAuthenticatorResponse]: - """Generate authenticator - - Generates a new authenticator for the user. This is used to set up two-factor authentication. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | GenerateAuthenticatorResponse] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, -) -> ErrorModel | GenerateAuthenticatorResponse | None: - """Generate authenticator - - Generates a new authenticator for the user. This is used to set up two-factor authentication. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | GenerateAuthenticatorResponse - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/generate_run_statistics.py b/src/tower/tower_api_client/api/default/generate_run_statistics.py deleted file mode 100644 index 7f73b450..00000000 --- a/src/tower/tower_api_client/api/default/generate_run_statistics.py +++ /dev/null @@ -1,251 +0,0 @@ -import datetime -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.generate_run_statistics_response import GenerateRunStatisticsResponse -from ...models.generate_run_statistics_status_item import ( - GenerateRunStatisticsStatusItem, -) -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - status: list[GenerateRunStatisticsStatusItem] | Unset = UNSET, - start_at: datetime.datetime, - end_at: datetime.datetime, - timezone: str | Unset = "UTC", - environment: str | Unset = UNSET, -) -> dict[str, Any]: - params: dict[str, Any] = {} - - json_status: list[str] | Unset = UNSET - if not isinstance(status, Unset): - json_status = [] - for status_item_data in status: - status_item = status_item_data.value - json_status.append(status_item) - - params["status"] = json_status - - json_start_at = start_at.isoformat() - params["start_at"] = json_start_at - - json_end_at = end_at.isoformat() - params["end_at"] = json_end_at - - params["timezone"] = timezone - - params["environment"] = environment - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/stats/runs", - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | GenerateRunStatisticsResponse: - if response.status_code == 200: - response_200 = GenerateRunStatisticsResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | GenerateRunStatisticsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - status: list[GenerateRunStatisticsStatusItem] | Unset = UNSET, - start_at: datetime.datetime, - end_at: datetime.datetime, - timezone: str | Unset = "UTC", - environment: str | Unset = UNSET, -) -> Response[ErrorModel | GenerateRunStatisticsResponse]: - """Generate run statistics - - Generates statistics about runs over a specified time period. - - Args: - status (list[GenerateRunStatisticsStatusItem] | Unset): Filter runs by status(es). Define - multiple with a comma-separated list. Supplying none will return all statuses. - start_at (datetime.datetime): Start date and time for statistics (inclusive) - end_at (datetime.datetime): End date and time for statistics (inclusive) - timezone (str | Unset): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to - UTC. Default: 'UTC'. - environment (str | Unset): Filter runs by environment. If not provided, all environments - will be included. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | GenerateRunStatisticsResponse] - """ - - kwargs = _get_kwargs( - status=status, - start_at=start_at, - end_at=end_at, - timezone=timezone, - environment=environment, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - status: list[GenerateRunStatisticsStatusItem] | Unset = UNSET, - start_at: datetime.datetime, - end_at: datetime.datetime, - timezone: str | Unset = "UTC", - environment: str | Unset = UNSET, -) -> ErrorModel | GenerateRunStatisticsResponse | None: - """Generate run statistics - - Generates statistics about runs over a specified time period. - - Args: - status (list[GenerateRunStatisticsStatusItem] | Unset): Filter runs by status(es). Define - multiple with a comma-separated list. Supplying none will return all statuses. - start_at (datetime.datetime): Start date and time for statistics (inclusive) - end_at (datetime.datetime): End date and time for statistics (inclusive) - timezone (str | Unset): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to - UTC. Default: 'UTC'. - environment (str | Unset): Filter runs by environment. If not provided, all environments - will be included. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | GenerateRunStatisticsResponse - """ - - return sync_detailed( - client=client, - status=status, - start_at=start_at, - end_at=end_at, - timezone=timezone, - environment=environment, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - status: list[GenerateRunStatisticsStatusItem] | Unset = UNSET, - start_at: datetime.datetime, - end_at: datetime.datetime, - timezone: str | Unset = "UTC", - environment: str | Unset = UNSET, -) -> Response[ErrorModel | GenerateRunStatisticsResponse]: - """Generate run statistics - - Generates statistics about runs over a specified time period. - - Args: - status (list[GenerateRunStatisticsStatusItem] | Unset): Filter runs by status(es). Define - multiple with a comma-separated list. Supplying none will return all statuses. - start_at (datetime.datetime): Start date and time for statistics (inclusive) - end_at (datetime.datetime): End date and time for statistics (inclusive) - timezone (str | Unset): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to - UTC. Default: 'UTC'. - environment (str | Unset): Filter runs by environment. If not provided, all environments - will be included. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | GenerateRunStatisticsResponse] - """ - - kwargs = _get_kwargs( - status=status, - start_at=start_at, - end_at=end_at, - timezone=timezone, - environment=environment, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - status: list[GenerateRunStatisticsStatusItem] | Unset = UNSET, - start_at: datetime.datetime, - end_at: datetime.datetime, - timezone: str | Unset = "UTC", - environment: str | Unset = UNSET, -) -> ErrorModel | GenerateRunStatisticsResponse | None: - """Generate run statistics - - Generates statistics about runs over a specified time period. - - Args: - status (list[GenerateRunStatisticsStatusItem] | Unset): Filter runs by status(es). Define - multiple with a comma-separated list. Supplying none will return all statuses. - start_at (datetime.datetime): Start date and time for statistics (inclusive) - end_at (datetime.datetime): End date and time for statistics (inclusive) - timezone (str | Unset): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to - UTC. Default: 'UTC'. - environment (str | Unset): Filter runs by environment. If not provided, all environments - will be included. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | GenerateRunStatisticsResponse - """ - - return ( - await asyncio_detailed( - client=client, - status=status, - start_at=start_at, - end_at=end_at, - timezone=timezone, - environment=environment, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/generate_runner_credentials.py b/src/tower/tower_api_client/api/default/generate_runner_credentials.py deleted file mode 100644 index 818f8ee8..00000000 --- a/src/tower/tower_api_client/api/default/generate_runner_credentials.py +++ /dev/null @@ -1,140 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.generate_runner_credentials_response import ( - GenerateRunnerCredentialsResponse, -) -from ...types import Response - - -def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/runners/credentials", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | GenerateRunnerCredentialsResponse: - if response.status_code == 200: - response_200 = GenerateRunnerCredentialsResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | GenerateRunnerCredentialsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, -) -> Response[ErrorModel | GenerateRunnerCredentialsResponse]: - """Generate runner credentials - - Uses your current authentication context to generate runner credentials that are used for - authenticating runner requests - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | GenerateRunnerCredentialsResponse] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, -) -> ErrorModel | GenerateRunnerCredentialsResponse | None: - """Generate runner credentials - - Uses your current authentication context to generate runner credentials that are used for - authenticating runner requests - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | GenerateRunnerCredentialsResponse - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, -) -> Response[ErrorModel | GenerateRunnerCredentialsResponse]: - """Generate runner credentials - - Uses your current authentication context to generate runner credentials that are used for - authenticating runner requests - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | GenerateRunnerCredentialsResponse] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, -) -> ErrorModel | GenerateRunnerCredentialsResponse | None: - """Generate runner credentials - - Uses your current authentication context to generate runner credentials that are used for - authenticating runner requests - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | GenerateRunnerCredentialsResponse - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/invite_team_member.py b/src/tower/tower_api_client/api/default/invite_team_member.py deleted file mode 100644 index 272fe5b8..00000000 --- a/src/tower/tower_api_client/api/default/invite_team_member.py +++ /dev/null @@ -1,183 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.invite_team_member_params import InviteTeamMemberParams -from ...models.invite_team_member_response import InviteTeamMemberResponse -from ...types import Response - - -def _get_kwargs( - name: str, - *, - body: InviteTeamMemberParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/teams/{name}/invites".format( - name=quote(str(name), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | InviteTeamMemberResponse: - if response.status_code == 200: - response_200 = InviteTeamMemberResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | InviteTeamMemberResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, - body: InviteTeamMemberParams, -) -> Response[ErrorModel | InviteTeamMemberResponse]: - """Invite team member - - Invite a new team - - Args: - name (str): The name of the team to invite someone to - body (InviteTeamMemberParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | InviteTeamMemberResponse] - """ - - kwargs = _get_kwargs( - name=name, - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, - body: InviteTeamMemberParams, -) -> ErrorModel | InviteTeamMemberResponse | None: - """Invite team member - - Invite a new team - - Args: - name (str): The name of the team to invite someone to - body (InviteTeamMemberParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | InviteTeamMemberResponse - """ - - return sync_detailed( - name=name, - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, - body: InviteTeamMemberParams, -) -> Response[ErrorModel | InviteTeamMemberResponse]: - """Invite team member - - Invite a new team - - Args: - name (str): The name of the team to invite someone to - body (InviteTeamMemberParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | InviteTeamMemberResponse] - """ - - kwargs = _get_kwargs( - name=name, - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, - body: InviteTeamMemberParams, -) -> ErrorModel | InviteTeamMemberResponse | None: - """Invite team member - - Invite a new team - - Args: - name (str): The name of the team to invite someone to - body (InviteTeamMemberParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | InviteTeamMemberResponse - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/leave_team.py b/src/tower/tower_api_client/api/default/leave_team.py deleted file mode 100644 index b9fc369c..00000000 --- a/src/tower/tower_api_client/api/default/leave_team.py +++ /dev/null @@ -1,165 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.leave_team_response import LeaveTeamResponse -from ...types import Response - - -def _get_kwargs( - name: str, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/teams/{name}/leave".format( - name=quote(str(name), safe=""), - ), - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | LeaveTeamResponse: - if response.status_code == 200: - response_200 = LeaveTeamResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | LeaveTeamResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, -) -> Response[ErrorModel | LeaveTeamResponse]: - """Leave team - - Remove yourself from a team. If you're the last member of a team, you cannot remove yourself. You - should delete the team instead. - - Args: - name (str): The name of the team to leave - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | LeaveTeamResponse] - """ - - kwargs = _get_kwargs( - name=name, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, -) -> ErrorModel | LeaveTeamResponse | None: - """Leave team - - Remove yourself from a team. If you're the last member of a team, you cannot remove yourself. You - should delete the team instead. - - Args: - name (str): The name of the team to leave - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | LeaveTeamResponse - """ - - return sync_detailed( - name=name, - client=client, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, -) -> Response[ErrorModel | LeaveTeamResponse]: - """Leave team - - Remove yourself from a team. If you're the last member of a team, you cannot remove yourself. You - should delete the team instead. - - Args: - name (str): The name of the team to leave - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | LeaveTeamResponse] - """ - - kwargs = _get_kwargs( - name=name, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, -) -> ErrorModel | LeaveTeamResponse | None: - """Leave team - - Remove yourself from a team. If you're the last member of a team, you cannot remove yourself. You - should delete the team instead. - - Args: - name (str): The name of the team to leave - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | LeaveTeamResponse - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/list_alerts.py b/src/tower/tower_api_client/api/default/list_alerts.py deleted file mode 100644 index 2011c877..00000000 --- a/src/tower/tower_api_client/api/default/list_alerts.py +++ /dev/null @@ -1,271 +0,0 @@ -import datetime -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.list_alerts_response import ListAlertsResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - page: int | Unset = 1, - page_size: int | Unset = 20, - alert_type: str | Unset = UNSET, - start_at: datetime.datetime | Unset = UNSET, - end_at: datetime.datetime | Unset = UNSET, - acked: str | Unset = UNSET, - environment: str | Unset = UNSET, -) -> dict[str, Any]: - params: dict[str, Any] = {} - - params["page"] = page - - params["page_size"] = page_size - - params["alert_type"] = alert_type - - json_start_at: str | Unset = UNSET - if not isinstance(start_at, Unset): - json_start_at = start_at.isoformat() - params["start_at"] = json_start_at - - json_end_at: str | Unset = UNSET - if not isinstance(end_at, Unset): - json_end_at = end_at.isoformat() - params["end_at"] = json_end_at - - params["acked"] = acked - - params["environment"] = environment - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/alerts", - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | ListAlertsResponse: - if response.status_code == 200: - response_200 = ListAlertsResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | ListAlertsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, - alert_type: str | Unset = UNSET, - start_at: datetime.datetime | Unset = UNSET, - end_at: datetime.datetime | Unset = UNSET, - acked: str | Unset = UNSET, - environment: str | Unset = UNSET, -) -> Response[ErrorModel | ListAlertsResponse]: - """List alerts - - List alerts for the current account with optional filtering - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - alert_type (str | Unset): Filter alerts by alert type - start_at (datetime.datetime | Unset): Filter alerts created after or at this datetime - (inclusive) - end_at (datetime.datetime | Unset): Filter alerts created before or at this datetime - (inclusive) - acked (str | Unset): Filter alerts by acknowledged status. - environment (str | Unset): Filter alerts by environment (e.g., production, staging) - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListAlertsResponse] - """ - - kwargs = _get_kwargs( - page=page, - page_size=page_size, - alert_type=alert_type, - start_at=start_at, - end_at=end_at, - acked=acked, - environment=environment, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, - alert_type: str | Unset = UNSET, - start_at: datetime.datetime | Unset = UNSET, - end_at: datetime.datetime | Unset = UNSET, - acked: str | Unset = UNSET, - environment: str | Unset = UNSET, -) -> ErrorModel | ListAlertsResponse | None: - """List alerts - - List alerts for the current account with optional filtering - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - alert_type (str | Unset): Filter alerts by alert type - start_at (datetime.datetime | Unset): Filter alerts created after or at this datetime - (inclusive) - end_at (datetime.datetime | Unset): Filter alerts created before or at this datetime - (inclusive) - acked (str | Unset): Filter alerts by acknowledged status. - environment (str | Unset): Filter alerts by environment (e.g., production, staging) - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListAlertsResponse - """ - - return sync_detailed( - client=client, - page=page, - page_size=page_size, - alert_type=alert_type, - start_at=start_at, - end_at=end_at, - acked=acked, - environment=environment, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, - alert_type: str | Unset = UNSET, - start_at: datetime.datetime | Unset = UNSET, - end_at: datetime.datetime | Unset = UNSET, - acked: str | Unset = UNSET, - environment: str | Unset = UNSET, -) -> Response[ErrorModel | ListAlertsResponse]: - """List alerts - - List alerts for the current account with optional filtering - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - alert_type (str | Unset): Filter alerts by alert type - start_at (datetime.datetime | Unset): Filter alerts created after or at this datetime - (inclusive) - end_at (datetime.datetime | Unset): Filter alerts created before or at this datetime - (inclusive) - acked (str | Unset): Filter alerts by acknowledged status. - environment (str | Unset): Filter alerts by environment (e.g., production, staging) - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListAlertsResponse] - """ - - kwargs = _get_kwargs( - page=page, - page_size=page_size, - alert_type=alert_type, - start_at=start_at, - end_at=end_at, - acked=acked, - environment=environment, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, - alert_type: str | Unset = UNSET, - start_at: datetime.datetime | Unset = UNSET, - end_at: datetime.datetime | Unset = UNSET, - acked: str | Unset = UNSET, - environment: str | Unset = UNSET, -) -> ErrorModel | ListAlertsResponse | None: - """List alerts - - List alerts for the current account with optional filtering - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - alert_type (str | Unset): Filter alerts by alert type - start_at (datetime.datetime | Unset): Filter alerts created after or at this datetime - (inclusive) - end_at (datetime.datetime | Unset): Filter alerts created before or at this datetime - (inclusive) - acked (str | Unset): Filter alerts by acknowledged status. - environment (str | Unset): Filter alerts by environment (e.g., production, staging) - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListAlertsResponse - """ - - return ( - await asyncio_detailed( - client=client, - page=page, - page_size=page_size, - alert_type=alert_type, - start_at=start_at, - end_at=end_at, - acked=acked, - environment=environment, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/list_api_keys.py b/src/tower/tower_api_client/api/default/list_api_keys.py deleted file mode 100644 index 27df54b3..00000000 --- a/src/tower/tower_api_client/api/default/list_api_keys.py +++ /dev/null @@ -1,181 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.list_api_keys_response import ListAPIKeysResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - page: int | Unset = 1, - page_size: int | Unset = 20, -) -> dict[str, Any]: - params: dict[str, Any] = {} - - params["page"] = page - - params["page_size"] = page_size - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/api-keys", - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | ListAPIKeysResponse: - if response.status_code == 200: - response_200 = ListAPIKeysResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | ListAPIKeysResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, -) -> Response[ErrorModel | ListAPIKeysResponse]: - """List API keys - - List all the API keys associated with your current account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListAPIKeysResponse] - """ - - kwargs = _get_kwargs( - page=page, - page_size=page_size, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, -) -> ErrorModel | ListAPIKeysResponse | None: - """List API keys - - List all the API keys associated with your current account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListAPIKeysResponse - """ - - return sync_detailed( - client=client, - page=page, - page_size=page_size, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, -) -> Response[ErrorModel | ListAPIKeysResponse]: - """List API keys - - List all the API keys associated with your current account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListAPIKeysResponse] - """ - - kwargs = _get_kwargs( - page=page, - page_size=page_size, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, -) -> ErrorModel | ListAPIKeysResponse | None: - """List API keys - - List all the API keys associated with your current account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListAPIKeysResponse - """ - - return ( - await asyncio_detailed( - client=client, - page=page, - page_size=page_size, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/list_app_environments.py b/src/tower/tower_api_client/api/default/list_app_environments.py deleted file mode 100644 index 61bb3790..00000000 --- a/src/tower/tower_api_client/api/default/list_app_environments.py +++ /dev/null @@ -1,161 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.list_app_environments_response import ListAppEnvironmentsResponse -from ...types import Response - - -def _get_kwargs( - name: str, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/apps/{name}/environments".format( - name=quote(str(name), safe=""), - ), - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | ListAppEnvironmentsResponse: - if response.status_code == 200: - response_200 = ListAppEnvironmentsResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | ListAppEnvironmentsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, -) -> Response[ErrorModel | ListAppEnvironmentsResponse]: - """List app environments - - Generates a list of all the known environments for a given app in the current account. - - Args: - name (str): The name of the app to get the version for. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListAppEnvironmentsResponse] - """ - - kwargs = _get_kwargs( - name=name, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, -) -> ErrorModel | ListAppEnvironmentsResponse | None: - """List app environments - - Generates a list of all the known environments for a given app in the current account. - - Args: - name (str): The name of the app to get the version for. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListAppEnvironmentsResponse - """ - - return sync_detailed( - name=name, - client=client, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, -) -> Response[ErrorModel | ListAppEnvironmentsResponse]: - """List app environments - - Generates a list of all the known environments for a given app in the current account. - - Args: - name (str): The name of the app to get the version for. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListAppEnvironmentsResponse] - """ - - kwargs = _get_kwargs( - name=name, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, -) -> ErrorModel | ListAppEnvironmentsResponse | None: - """List app environments - - Generates a list of all the known environments for a given app in the current account. - - Args: - name (str): The name of the app to get the version for. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListAppEnvironmentsResponse - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/list_app_versions.py b/src/tower/tower_api_client/api/default/list_app_versions.py deleted file mode 100644 index a3414d4c..00000000 --- a/src/tower/tower_api_client/api/default/list_app_versions.py +++ /dev/null @@ -1,161 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.list_app_versions_response import ListAppVersionsResponse -from ...types import Response - - -def _get_kwargs( - name: str, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/apps/{name}/versions".format( - name=quote(str(name), safe=""), - ), - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | ListAppVersionsResponse: - if response.status_code == 200: - response_200 = ListAppVersionsResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | ListAppVersionsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, -) -> Response[ErrorModel | ListAppVersionsResponse]: - """List app versions - - List all versions of an app in the current account, sorted with the most recent first. - - Args: - name (str): The name of the app to list versions for. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListAppVersionsResponse] - """ - - kwargs = _get_kwargs( - name=name, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, -) -> ErrorModel | ListAppVersionsResponse | None: - """List app versions - - List all versions of an app in the current account, sorted with the most recent first. - - Args: - name (str): The name of the app to list versions for. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListAppVersionsResponse - """ - - return sync_detailed( - name=name, - client=client, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, -) -> Response[ErrorModel | ListAppVersionsResponse]: - """List app versions - - List all versions of an app in the current account, sorted with the most recent first. - - Args: - name (str): The name of the app to list versions for. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListAppVersionsResponse] - """ - - kwargs = _get_kwargs( - name=name, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, -) -> ErrorModel | ListAppVersionsResponse | None: - """List app versions - - List all versions of an app in the current account, sorted with the most recent first. - - Args: - name (str): The name of the app to list versions for. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListAppVersionsResponse - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/list_apps.py b/src/tower/tower_api_client/api/default/list_apps.py deleted file mode 100644 index c71e0f10..00000000 --- a/src/tower/tower_api_client/api/default/list_apps.py +++ /dev/null @@ -1,274 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.list_apps_filter import ListAppsFilter -from ...models.list_apps_response import ListAppsResponse -from ...models.list_apps_sort import ListAppsSort -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - page: int | Unset = 1, - page_size: int | Unset = 20, - query: str | Unset = UNSET, - num_runs: int | Unset = 20, - sort: ListAppsSort | Unset = ListAppsSort.CREATED_AT, - filter_: ListAppsFilter | Unset = UNSET, - environment: str | Unset = UNSET, -) -> dict[str, Any]: - params: dict[str, Any] = {} - - params["page"] = page - - params["page_size"] = page_size - - params["query"] = query - - params["num_runs"] = num_runs - - json_sort: str | Unset = UNSET - if not isinstance(sort, Unset): - json_sort = sort.value - - params["sort"] = json_sort - - json_filter_: str | Unset = UNSET - if not isinstance(filter_, Unset): - json_filter_ = filter_.value - - params["filter"] = json_filter_ - - params["environment"] = environment - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/apps", - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | ListAppsResponse: - if response.status_code == 200: - response_200 = ListAppsResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | ListAppsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, - query: str | Unset = UNSET, - num_runs: int | Unset = 20, - sort: ListAppsSort | Unset = ListAppsSort.CREATED_AT, - filter_: ListAppsFilter | Unset = UNSET, - environment: str | Unset = UNSET, -) -> Response[ErrorModel | ListAppsResponse]: - """List apps - - Get all the apps for the current account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - query (str | Unset): The search query to filter apps by. - num_runs (int | Unset): Number of recent runs to fetch (-1 for all runs, defaults to 20) - Default: 20. - sort (ListAppsSort | Unset): Sort order for the results. Default: ListAppsSort.CREATED_AT. - filter_ (ListAppsFilter | Unset): Filter to see apps with certain statuses. - environment (str | Unset): The environment to filter the apps by. If not provided, apps - for all environments will be returned. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListAppsResponse] - """ - - kwargs = _get_kwargs( - page=page, - page_size=page_size, - query=query, - num_runs=num_runs, - sort=sort, - filter_=filter_, - environment=environment, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, - query: str | Unset = UNSET, - num_runs: int | Unset = 20, - sort: ListAppsSort | Unset = ListAppsSort.CREATED_AT, - filter_: ListAppsFilter | Unset = UNSET, - environment: str | Unset = UNSET, -) -> ErrorModel | ListAppsResponse | None: - """List apps - - Get all the apps for the current account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - query (str | Unset): The search query to filter apps by. - num_runs (int | Unset): Number of recent runs to fetch (-1 for all runs, defaults to 20) - Default: 20. - sort (ListAppsSort | Unset): Sort order for the results. Default: ListAppsSort.CREATED_AT. - filter_ (ListAppsFilter | Unset): Filter to see apps with certain statuses. - environment (str | Unset): The environment to filter the apps by. If not provided, apps - for all environments will be returned. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListAppsResponse - """ - - return sync_detailed( - client=client, - page=page, - page_size=page_size, - query=query, - num_runs=num_runs, - sort=sort, - filter_=filter_, - environment=environment, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, - query: str | Unset = UNSET, - num_runs: int | Unset = 20, - sort: ListAppsSort | Unset = ListAppsSort.CREATED_AT, - filter_: ListAppsFilter | Unset = UNSET, - environment: str | Unset = UNSET, -) -> Response[ErrorModel | ListAppsResponse]: - """List apps - - Get all the apps for the current account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - query (str | Unset): The search query to filter apps by. - num_runs (int | Unset): Number of recent runs to fetch (-1 for all runs, defaults to 20) - Default: 20. - sort (ListAppsSort | Unset): Sort order for the results. Default: ListAppsSort.CREATED_AT. - filter_ (ListAppsFilter | Unset): Filter to see apps with certain statuses. - environment (str | Unset): The environment to filter the apps by. If not provided, apps - for all environments will be returned. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListAppsResponse] - """ - - kwargs = _get_kwargs( - page=page, - page_size=page_size, - query=query, - num_runs=num_runs, - sort=sort, - filter_=filter_, - environment=environment, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, - query: str | Unset = UNSET, - num_runs: int | Unset = 20, - sort: ListAppsSort | Unset = ListAppsSort.CREATED_AT, - filter_: ListAppsFilter | Unset = UNSET, - environment: str | Unset = UNSET, -) -> ErrorModel | ListAppsResponse | None: - """List apps - - Get all the apps for the current account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - query (str | Unset): The search query to filter apps by. - num_runs (int | Unset): Number of recent runs to fetch (-1 for all runs, defaults to 20) - Default: 20. - sort (ListAppsSort | Unset): Sort order for the results. Default: ListAppsSort.CREATED_AT. - filter_ (ListAppsFilter | Unset): Filter to see apps with certain statuses. - environment (str | Unset): The environment to filter the apps by. If not provided, apps - for all environments will be returned. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListAppsResponse - """ - - return ( - await asyncio_detailed( - client=client, - page=page, - page_size=page_size, - query=query, - num_runs=num_runs, - sort=sort, - filter_=filter_, - environment=environment, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/list_authenticators.py b/src/tower/tower_api_client/api/default/list_authenticators.py deleted file mode 100644 index 9029a659..00000000 --- a/src/tower/tower_api_client/api/default/list_authenticators.py +++ /dev/null @@ -1,134 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.list_authenticators_response import ListAuthenticatorsResponse -from ...types import Response - - -def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/authenticators", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | ListAuthenticatorsResponse: - if response.status_code == 200: - response_200 = ListAuthenticatorsResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | ListAuthenticatorsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, -) -> Response[ErrorModel | ListAuthenticatorsResponse]: - """List authenticators - - Enumerates the authenticators associated with the current users' account - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListAuthenticatorsResponse] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, -) -> ErrorModel | ListAuthenticatorsResponse | None: - """List authenticators - - Enumerates the authenticators associated with the current users' account - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListAuthenticatorsResponse - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, -) -> Response[ErrorModel | ListAuthenticatorsResponse]: - """List authenticators - - Enumerates the authenticators associated with the current users' account - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListAuthenticatorsResponse] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, -) -> ErrorModel | ListAuthenticatorsResponse | None: - """List authenticators - - Enumerates the authenticators associated with the current users' account - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListAuthenticatorsResponse - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/list_catalogs.py b/src/tower/tower_api_client/api/default/list_catalogs.py deleted file mode 100644 index b559eb5b..00000000 --- a/src/tower/tower_api_client/api/default/list_catalogs.py +++ /dev/null @@ -1,215 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.list_catalogs_response import ListCatalogsResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - page: int | Unset = 1, - page_size: int | Unset = 20, - environment: str | Unset = UNSET, - all_: bool | Unset = UNSET, -) -> dict[str, Any]: - params: dict[str, Any] = {} - - params["page"] = page - - params["page_size"] = page_size - - params["environment"] = environment - - params["all"] = all_ - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/catalogs", - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | ListCatalogsResponse: - if response.status_code == 200: - response_200 = ListCatalogsResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | ListCatalogsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, - environment: str | Unset = UNSET, - all_: bool | Unset = UNSET, -) -> Response[ErrorModel | ListCatalogsResponse]: - """List catalogs - - Lists all the catalogs associated with your current account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - environment (str | Unset): The environment to filter by. - all_ (bool | Unset): Whether to fetch all catalogs across all environments or only for the - current environment. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListCatalogsResponse] - """ - - kwargs = _get_kwargs( - page=page, - page_size=page_size, - environment=environment, - all_=all_, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, - environment: str | Unset = UNSET, - all_: bool | Unset = UNSET, -) -> ErrorModel | ListCatalogsResponse | None: - """List catalogs - - Lists all the catalogs associated with your current account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - environment (str | Unset): The environment to filter by. - all_ (bool | Unset): Whether to fetch all catalogs across all environments or only for the - current environment. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListCatalogsResponse - """ - - return sync_detailed( - client=client, - page=page, - page_size=page_size, - environment=environment, - all_=all_, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, - environment: str | Unset = UNSET, - all_: bool | Unset = UNSET, -) -> Response[ErrorModel | ListCatalogsResponse]: - """List catalogs - - Lists all the catalogs associated with your current account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - environment (str | Unset): The environment to filter by. - all_ (bool | Unset): Whether to fetch all catalogs across all environments or only for the - current environment. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListCatalogsResponse] - """ - - kwargs = _get_kwargs( - page=page, - page_size=page_size, - environment=environment, - all_=all_, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, - environment: str | Unset = UNSET, - all_: bool | Unset = UNSET, -) -> ErrorModel | ListCatalogsResponse | None: - """List catalogs - - Lists all the catalogs associated with your current account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - environment (str | Unset): The environment to filter by. - all_ (bool | Unset): Whether to fetch all catalogs across all environments or only for the - current environment. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListCatalogsResponse - """ - - return ( - await asyncio_detailed( - client=client, - page=page, - page_size=page_size, - environment=environment, - all_=all_, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/list_environments.py b/src/tower/tower_api_client/api/default/list_environments.py deleted file mode 100644 index cdf077dc..00000000 --- a/src/tower/tower_api_client/api/default/list_environments.py +++ /dev/null @@ -1,181 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.list_environments_response import ListEnvironmentsResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - page: int | Unset = 1, - page_size: int | Unset = 20, -) -> dict[str, Any]: - params: dict[str, Any] = {} - - params["page"] = page - - params["page_size"] = page_size - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/environments", - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | ListEnvironmentsResponse: - if response.status_code == 200: - response_200 = ListEnvironmentsResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | ListEnvironmentsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, -) -> Response[ErrorModel | ListEnvironmentsResponse]: - """List environments - - List all environments in your account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListEnvironmentsResponse] - """ - - kwargs = _get_kwargs( - page=page, - page_size=page_size, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, -) -> ErrorModel | ListEnvironmentsResponse | None: - """List environments - - List all environments in your account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListEnvironmentsResponse - """ - - return sync_detailed( - client=client, - page=page, - page_size=page_size, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, -) -> Response[ErrorModel | ListEnvironmentsResponse]: - """List environments - - List all environments in your account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListEnvironmentsResponse] - """ - - kwargs = _get_kwargs( - page=page, - page_size=page_size, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, -) -> ErrorModel | ListEnvironmentsResponse | None: - """List environments - - List all environments in your account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListEnvironmentsResponse - """ - - return ( - await asyncio_detailed( - client=client, - page=page, - page_size=page_size, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/list_guests.py b/src/tower/tower_api_client/api/default/list_guests.py deleted file mode 100644 index 117a77b8..00000000 --- a/src/tower/tower_api_client/api/default/list_guests.py +++ /dev/null @@ -1,166 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.list_guests_response import ListGuestsResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - app: str | Unset = UNSET, -) -> dict[str, Any]: - params: dict[str, Any] = {} - - params["app"] = app - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/guests", - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | ListGuestsResponse: - if response.status_code == 200: - response_200 = ListGuestsResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | ListGuestsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - app: str | Unset = UNSET, -) -> Response[ErrorModel | ListGuestsResponse]: - """List guests - - Lists all guests for the current account, optionally filtered by app. - - Args: - app (str | Unset): Filter guests by app name. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListGuestsResponse] - """ - - kwargs = _get_kwargs( - app=app, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - app: str | Unset = UNSET, -) -> ErrorModel | ListGuestsResponse | None: - """List guests - - Lists all guests for the current account, optionally filtered by app. - - Args: - app (str | Unset): Filter guests by app name. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListGuestsResponse - """ - - return sync_detailed( - client=client, - app=app, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - app: str | Unset = UNSET, -) -> Response[ErrorModel | ListGuestsResponse]: - """List guests - - Lists all guests for the current account, optionally filtered by app. - - Args: - app (str | Unset): Filter guests by app name. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListGuestsResponse] - """ - - kwargs = _get_kwargs( - app=app, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - app: str | Unset = UNSET, -) -> ErrorModel | ListGuestsResponse | None: - """List guests - - Lists all guests for the current account, optionally filtered by app. - - Args: - app (str | Unset): Filter guests by app name. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListGuestsResponse - """ - - return ( - await asyncio_detailed( - client=client, - app=app, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/list_my_team_invitations.py b/src/tower/tower_api_client/api/default/list_my_team_invitations.py deleted file mode 100644 index 30b74b6b..00000000 --- a/src/tower/tower_api_client/api/default/list_my_team_invitations.py +++ /dev/null @@ -1,134 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.list_my_team_invitations_response import ListMyTeamInvitationsResponse -from ...types import Response - - -def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/team-invites", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | ListMyTeamInvitationsResponse: - if response.status_code == 200: - response_200 = ListMyTeamInvitationsResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | ListMyTeamInvitationsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, -) -> Response[ErrorModel | ListMyTeamInvitationsResponse]: - """List my team invitations - - List your pending invitations for teams - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListMyTeamInvitationsResponse] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, -) -> ErrorModel | ListMyTeamInvitationsResponse | None: - """List my team invitations - - List your pending invitations for teams - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListMyTeamInvitationsResponse - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, -) -> Response[ErrorModel | ListMyTeamInvitationsResponse]: - """List my team invitations - - List your pending invitations for teams - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListMyTeamInvitationsResponse] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, -) -> ErrorModel | ListMyTeamInvitationsResponse | None: - """List my team invitations - - List your pending invitations for teams - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListMyTeamInvitationsResponse - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/list_runners.py b/src/tower/tower_api_client/api/default/list_runners.py deleted file mode 100644 index a863ef62..00000000 --- a/src/tower/tower_api_client/api/default/list_runners.py +++ /dev/null @@ -1,181 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.list_runners_response import ListRunnersResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - page: int | Unset = 1, - page_size: int | Unset = 20, -) -> dict[str, Any]: - params: dict[str, Any] = {} - - params["page"] = page - - params["page_size"] = page_size - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/runners", - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | ListRunnersResponse: - if response.status_code == 200: - response_200 = ListRunnersResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | ListRunnersResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, -) -> Response[ErrorModel | ListRunnersResponse]: - """List runners - - Get all self-hosted runners for the current account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListRunnersResponse] - """ - - kwargs = _get_kwargs( - page=page, - page_size=page_size, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, -) -> ErrorModel | ListRunnersResponse | None: - """List runners - - Get all self-hosted runners for the current account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListRunnersResponse - """ - - return sync_detailed( - client=client, - page=page, - page_size=page_size, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, -) -> Response[ErrorModel | ListRunnersResponse]: - """List runners - - Get all self-hosted runners for the current account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListRunnersResponse] - """ - - kwargs = _get_kwargs( - page=page, - page_size=page_size, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, -) -> ErrorModel | ListRunnersResponse | None: - """List runners - - Get all self-hosted runners for the current account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListRunnersResponse - """ - - return ( - await asyncio_detailed( - client=client, - page=page, - page_size=page_size, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/list_runs.py b/src/tower/tower_api_client/api/default/list_runs.py deleted file mode 100644 index 045426f6..00000000 --- a/src/tower/tower_api_client/api/default/list_runs.py +++ /dev/null @@ -1,292 +0,0 @@ -import datetime -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.list_runs_response import ListRunsResponse -from ...models.list_runs_status_item import ListRunsStatusItem -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - name: str, - *, - page: int | Unset = 1, - page_size: int | Unset = 20, - status: list[ListRunsStatusItem] | Unset = UNSET, - start_at: datetime.datetime | Unset = UNSET, - end_at: datetime.datetime | Unset = UNSET, - environment: str | Unset = UNSET, -) -> dict[str, Any]: - params: dict[str, Any] = {} - - params["page"] = page - - params["page_size"] = page_size - - json_status: list[str] | Unset = UNSET - if not isinstance(status, Unset): - json_status = [] - for status_item_data in status: - status_item = status_item_data.value - json_status.append(status_item) - - params["status"] = json_status - - json_start_at: str | Unset = UNSET - if not isinstance(start_at, Unset): - json_start_at = start_at.isoformat() - params["start_at"] = json_start_at - - json_end_at: str | Unset = UNSET - if not isinstance(end_at, Unset): - json_end_at = end_at.isoformat() - params["end_at"] = json_end_at - - params["environment"] = environment - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/apps/{name}/runs".format( - name=quote(str(name), safe=""), - ), - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | ListRunsResponse: - if response.status_code == 200: - response_200 = ListRunsResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | ListRunsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, - status: list[ListRunsStatusItem] | Unset = UNSET, - start_at: datetime.datetime | Unset = UNSET, - end_at: datetime.datetime | Unset = UNSET, - environment: str | Unset = UNSET, -) -> Response[ErrorModel | ListRunsResponse]: - """List runs - - Generates a list of all the runs for a given app. The list is paginated based on the query string - parameters passed in. - - Args: - name (str): The name of the app to fetch runs for. - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - status (list[ListRunsStatusItem] | Unset): Filter runs by status(es). Define multiple with - a comma-separated list. Supplying none will return all statuses. - start_at (datetime.datetime | Unset): Filter runs scheduled after or at this datetime - (inclusive) - end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime - (inclusive) - environment (str | Unset): Filter runs by environment. If not provided, all environments - will be included. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListRunsResponse] - """ - - kwargs = _get_kwargs( - name=name, - page=page, - page_size=page_size, - status=status, - start_at=start_at, - end_at=end_at, - environment=environment, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, - status: list[ListRunsStatusItem] | Unset = UNSET, - start_at: datetime.datetime | Unset = UNSET, - end_at: datetime.datetime | Unset = UNSET, - environment: str | Unset = UNSET, -) -> ErrorModel | ListRunsResponse | None: - """List runs - - Generates a list of all the runs for a given app. The list is paginated based on the query string - parameters passed in. - - Args: - name (str): The name of the app to fetch runs for. - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - status (list[ListRunsStatusItem] | Unset): Filter runs by status(es). Define multiple with - a comma-separated list. Supplying none will return all statuses. - start_at (datetime.datetime | Unset): Filter runs scheduled after or at this datetime - (inclusive) - end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime - (inclusive) - environment (str | Unset): Filter runs by environment. If not provided, all environments - will be included. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListRunsResponse - """ - - return sync_detailed( - name=name, - client=client, - page=page, - page_size=page_size, - status=status, - start_at=start_at, - end_at=end_at, - environment=environment, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, - status: list[ListRunsStatusItem] | Unset = UNSET, - start_at: datetime.datetime | Unset = UNSET, - end_at: datetime.datetime | Unset = UNSET, - environment: str | Unset = UNSET, -) -> Response[ErrorModel | ListRunsResponse]: - """List runs - - Generates a list of all the runs for a given app. The list is paginated based on the query string - parameters passed in. - - Args: - name (str): The name of the app to fetch runs for. - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - status (list[ListRunsStatusItem] | Unset): Filter runs by status(es). Define multiple with - a comma-separated list. Supplying none will return all statuses. - start_at (datetime.datetime | Unset): Filter runs scheduled after or at this datetime - (inclusive) - end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime - (inclusive) - environment (str | Unset): Filter runs by environment. If not provided, all environments - will be included. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListRunsResponse] - """ - - kwargs = _get_kwargs( - name=name, - page=page, - page_size=page_size, - status=status, - start_at=start_at, - end_at=end_at, - environment=environment, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, - status: list[ListRunsStatusItem] | Unset = UNSET, - start_at: datetime.datetime | Unset = UNSET, - end_at: datetime.datetime | Unset = UNSET, - environment: str | Unset = UNSET, -) -> ErrorModel | ListRunsResponse | None: - """List runs - - Generates a list of all the runs for a given app. The list is paginated based on the query string - parameters passed in. - - Args: - name (str): The name of the app to fetch runs for. - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - status (list[ListRunsStatusItem] | Unset): Filter runs by status(es). Define multiple with - a comma-separated list. Supplying none will return all statuses. - start_at (datetime.datetime | Unset): Filter runs scheduled after or at this datetime - (inclusive) - end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime - (inclusive) - environment (str | Unset): Filter runs by environment. If not provided, all environments - will be included. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListRunsResponse - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - page=page, - page_size=page_size, - status=status, - start_at=start_at, - end_at=end_at, - environment=environment, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/list_schedules.py b/src/tower/tower_api_client/api/default/list_schedules.py deleted file mode 100644 index 582621bf..00000000 --- a/src/tower/tower_api_client/api/default/list_schedules.py +++ /dev/null @@ -1,200 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.list_schedules_response import ListSchedulesResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - page: int | Unset = 1, - page_size: int | Unset = 20, - environment: str | Unset = UNSET, -) -> dict[str, Any]: - params: dict[str, Any] = {} - - params["page"] = page - - params["page_size"] = page_size - - params["environment"] = environment - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/schedules", - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | ListSchedulesResponse: - if response.status_code == 200: - response_200 = ListSchedulesResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | ListSchedulesResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, - environment: str | Unset = UNSET, -) -> Response[ErrorModel | ListSchedulesResponse]: - """List schedules - - List all schedules for an app. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - environment (str | Unset): Filter schedules by environment. If not provided, all - environments will be included. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListSchedulesResponse] - """ - - kwargs = _get_kwargs( - page=page, - page_size=page_size, - environment=environment, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, - environment: str | Unset = UNSET, -) -> ErrorModel | ListSchedulesResponse | None: - """List schedules - - List all schedules for an app. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - environment (str | Unset): Filter schedules by environment. If not provided, all - environments will be included. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListSchedulesResponse - """ - - return sync_detailed( - client=client, - page=page, - page_size=page_size, - environment=environment, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, - environment: str | Unset = UNSET, -) -> Response[ErrorModel | ListSchedulesResponse]: - """List schedules - - List all schedules for an app. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - environment (str | Unset): Filter schedules by environment. If not provided, all - environments will be included. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListSchedulesResponse] - """ - - kwargs = _get_kwargs( - page=page, - page_size=page_size, - environment=environment, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, - environment: str | Unset = UNSET, -) -> ErrorModel | ListSchedulesResponse | None: - """List schedules - - List all schedules for an app. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - environment (str | Unset): Filter schedules by environment. If not provided, all - environments will be included. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListSchedulesResponse - """ - - return ( - await asyncio_detailed( - client=client, - page=page, - page_size=page_size, - environment=environment, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/list_secret_environments.py b/src/tower/tower_api_client/api/default/list_secret_environments.py deleted file mode 100644 index 83a17848..00000000 --- a/src/tower/tower_api_client/api/default/list_secret_environments.py +++ /dev/null @@ -1,134 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.list_secret_environments_response import ListSecretEnvironmentsResponse -from ...types import Response - - -def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/secrets/environments", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | ListSecretEnvironmentsResponse: - if response.status_code == 200: - response_200 = ListSecretEnvironmentsResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | ListSecretEnvironmentsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, -) -> Response[ErrorModel | ListSecretEnvironmentsResponse]: - """List secret environments - - Lists all the environments associated with secrets. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListSecretEnvironmentsResponse] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, -) -> ErrorModel | ListSecretEnvironmentsResponse | None: - """List secret environments - - Lists all the environments associated with secrets. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListSecretEnvironmentsResponse - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, -) -> Response[ErrorModel | ListSecretEnvironmentsResponse]: - """List secret environments - - Lists all the environments associated with secrets. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListSecretEnvironmentsResponse] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, -) -> ErrorModel | ListSecretEnvironmentsResponse | None: - """List secret environments - - Lists all the environments associated with secrets. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListSecretEnvironmentsResponse - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/list_secrets.py b/src/tower/tower_api_client/api/default/list_secrets.py deleted file mode 100644 index 35d5237e..00000000 --- a/src/tower/tower_api_client/api/default/list_secrets.py +++ /dev/null @@ -1,215 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.list_secrets_response import ListSecretsResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - page: int | Unset = 1, - page_size: int | Unset = 20, - environment: str | Unset = UNSET, - all_: bool | Unset = UNSET, -) -> dict[str, Any]: - params: dict[str, Any] = {} - - params["page"] = page - - params["page_size"] = page_size - - params["environment"] = environment - - params["all"] = all_ - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/secrets", - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | ListSecretsResponse: - if response.status_code == 200: - response_200 = ListSecretsResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | ListSecretsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, - environment: str | Unset = UNSET, - all_: bool | Unset = UNSET, -) -> Response[ErrorModel | ListSecretsResponse]: - """List secrets - - Lists all the secrets associated with your current account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - environment (str | Unset): The environment to filter by. - all_ (bool | Unset): Whether to fetch all secrets or only the ones that are not marked as - deleted. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListSecretsResponse] - """ - - kwargs = _get_kwargs( - page=page, - page_size=page_size, - environment=environment, - all_=all_, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, - environment: str | Unset = UNSET, - all_: bool | Unset = UNSET, -) -> ErrorModel | ListSecretsResponse | None: - """List secrets - - Lists all the secrets associated with your current account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - environment (str | Unset): The environment to filter by. - all_ (bool | Unset): Whether to fetch all secrets or only the ones that are not marked as - deleted. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListSecretsResponse - """ - - return sync_detailed( - client=client, - page=page, - page_size=page_size, - environment=environment, - all_=all_, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, - environment: str | Unset = UNSET, - all_: bool | Unset = UNSET, -) -> Response[ErrorModel | ListSecretsResponse]: - """List secrets - - Lists all the secrets associated with your current account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - environment (str | Unset): The environment to filter by. - all_ (bool | Unset): Whether to fetch all secrets or only the ones that are not marked as - deleted. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListSecretsResponse] - """ - - kwargs = _get_kwargs( - page=page, - page_size=page_size, - environment=environment, - all_=all_, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, - environment: str | Unset = UNSET, - all_: bool | Unset = UNSET, -) -> ErrorModel | ListSecretsResponse | None: - """List secrets - - Lists all the secrets associated with your current account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - environment (str | Unset): The environment to filter by. - all_ (bool | Unset): Whether to fetch all secrets or only the ones that are not marked as - deleted. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListSecretsResponse - """ - - return ( - await asyncio_detailed( - client=client, - page=page, - page_size=page_size, - environment=environment, - all_=all_, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/list_team_invitations.py b/src/tower/tower_api_client/api/default/list_team_invitations.py deleted file mode 100644 index ee6cd54d..00000000 --- a/src/tower/tower_api_client/api/default/list_team_invitations.py +++ /dev/null @@ -1,161 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.list_team_invitations_response import ListTeamInvitationsResponse -from ...types import Response - - -def _get_kwargs( - name: str, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/teams/{name}/invites".format( - name=quote(str(name), safe=""), - ), - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | ListTeamInvitationsResponse: - if response.status_code == 200: - response_200 = ListTeamInvitationsResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | ListTeamInvitationsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, -) -> Response[ErrorModel | ListTeamInvitationsResponse]: - """List team invitations - - List the pending invitations for a team - - Args: - name (str): The name of the team to list members for - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListTeamInvitationsResponse] - """ - - kwargs = _get_kwargs( - name=name, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, -) -> ErrorModel | ListTeamInvitationsResponse | None: - """List team invitations - - List the pending invitations for a team - - Args: - name (str): The name of the team to list members for - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListTeamInvitationsResponse - """ - - return sync_detailed( - name=name, - client=client, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, -) -> Response[ErrorModel | ListTeamInvitationsResponse]: - """List team invitations - - List the pending invitations for a team - - Args: - name (str): The name of the team to list members for - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListTeamInvitationsResponse] - """ - - kwargs = _get_kwargs( - name=name, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, -) -> ErrorModel | ListTeamInvitationsResponse | None: - """List team invitations - - List the pending invitations for a team - - Args: - name (str): The name of the team to list members for - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListTeamInvitationsResponse - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/list_team_members.py b/src/tower/tower_api_client/api/default/list_team_members.py deleted file mode 100644 index 3b3d8715..00000000 --- a/src/tower/tower_api_client/api/default/list_team_members.py +++ /dev/null @@ -1,161 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.list_team_members_response import ListTeamMembersResponse -from ...types import Response - - -def _get_kwargs( - name: str, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/teams/{name}/members".format( - name=quote(str(name), safe=""), - ), - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | ListTeamMembersResponse: - if response.status_code == 200: - response_200 = ListTeamMembersResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | ListTeamMembersResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, -) -> Response[ErrorModel | ListTeamMembersResponse]: - """List team members - - List the members of a team - - Args: - name (str): The name of the team to list members for - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListTeamMembersResponse] - """ - - kwargs = _get_kwargs( - name=name, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, -) -> ErrorModel | ListTeamMembersResponse | None: - """List team members - - List the members of a team - - Args: - name (str): The name of the team to list members for - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListTeamMembersResponse - """ - - return sync_detailed( - name=name, - client=client, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, -) -> Response[ErrorModel | ListTeamMembersResponse]: - """List team members - - List the members of a team - - Args: - name (str): The name of the team to list members for - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListTeamMembersResponse] - """ - - kwargs = _get_kwargs( - name=name, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, -) -> ErrorModel | ListTeamMembersResponse | None: - """List team members - - List the members of a team - - Args: - name (str): The name of the team to list members for - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListTeamMembersResponse - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/list_teams.py b/src/tower/tower_api_client/api/default/list_teams.py deleted file mode 100644 index c298077b..00000000 --- a/src/tower/tower_api_client/api/default/list_teams.py +++ /dev/null @@ -1,181 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.list_teams_response import ListTeamsResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - page: int | Unset = 1, - page_size: int | Unset = 20, -) -> dict[str, Any]: - params: dict[str, Any] = {} - - params["page"] = page - - params["page_size"] = page_size - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/teams", - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | ListTeamsResponse: - if response.status_code == 200: - response_200 = ListTeamsResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | ListTeamsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, -) -> Response[ErrorModel | ListTeamsResponse]: - """List teams - - List all the teams that you are a member of. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListTeamsResponse] - """ - - kwargs = _get_kwargs( - page=page, - page_size=page_size, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, -) -> ErrorModel | ListTeamsResponse | None: - """List teams - - List all the teams that you are a member of. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListTeamsResponse - """ - - return sync_detailed( - client=client, - page=page, - page_size=page_size, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, -) -> Response[ErrorModel | ListTeamsResponse]: - """List teams - - List all the teams that you are a member of. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListTeamsResponse] - """ - - kwargs = _get_kwargs( - page=page, - page_size=page_size, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, -) -> ErrorModel | ListTeamsResponse | None: - """List teams - - List all the teams that you are a member of. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListTeamsResponse - """ - - return ( - await asyncio_detailed( - client=client, - page=page, - page_size=page_size, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/list_webhooks.py b/src/tower/tower_api_client/api/default/list_webhooks.py deleted file mode 100644 index 25f201c3..00000000 --- a/src/tower/tower_api_client/api/default/list_webhooks.py +++ /dev/null @@ -1,173 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.list_webhooks_response import ListWebhooksResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - page: int | Unset = 1, - page_size: int | Unset = 20, -) -> dict[str, Any]: - params: dict[str, Any] = {} - - params["page"] = page - - params["page_size"] = page_size - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/webhooks", - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | ListWebhooksResponse: - if response.status_code == 200: - response_200 = ListWebhooksResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | ListWebhooksResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, -) -> Response[ErrorModel | ListWebhooksResponse]: - """List webhooks - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListWebhooksResponse] - """ - - kwargs = _get_kwargs( - page=page, - page_size=page_size, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, -) -> ErrorModel | ListWebhooksResponse | None: - """List webhooks - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListWebhooksResponse - """ - - return sync_detailed( - client=client, - page=page, - page_size=page_size, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, -) -> Response[ErrorModel | ListWebhooksResponse]: - """List webhooks - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ListWebhooksResponse] - """ - - kwargs = _get_kwargs( - page=page, - page_size=page_size, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, -) -> ErrorModel | ListWebhooksResponse | None: - """List webhooks - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ListWebhooksResponse - """ - - return ( - await asyncio_detailed( - client=client, - page=page, - page_size=page_size, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/refresh_session.py b/src/tower/tower_api_client/api/default/refresh_session.py deleted file mode 100644 index fc8825a3..00000000 --- a/src/tower/tower_api_client/api/default/refresh_session.py +++ /dev/null @@ -1,175 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.refresh_session_params import RefreshSessionParams -from ...models.refresh_session_response import RefreshSessionResponse -from ...types import Response - - -def _get_kwargs( - *, - body: RefreshSessionParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/session/refresh", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | RefreshSessionResponse: - if response.status_code == 200: - response_200 = RefreshSessionResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | RefreshSessionResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: RefreshSessionParams, -) -> Response[ErrorModel | RefreshSessionResponse]: - """Refresh session - - If your access tokens expire, this API endpoint takes a Refresh Token and returns a new set of - Access Tokens for your session. Note that we don't rotate the Refresh Token itself, and it's not - returned by this API endpoint. - - Args: - body (RefreshSessionParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | RefreshSessionResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: RefreshSessionParams, -) -> ErrorModel | RefreshSessionResponse | None: - """Refresh session - - If your access tokens expire, this API endpoint takes a Refresh Token and returns a new set of - Access Tokens for your session. Note that we don't rotate the Refresh Token itself, and it's not - returned by this API endpoint. - - Args: - body (RefreshSessionParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | RefreshSessionResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: RefreshSessionParams, -) -> Response[ErrorModel | RefreshSessionResponse]: - """Refresh session - - If your access tokens expire, this API endpoint takes a Refresh Token and returns a new set of - Access Tokens for your session. Note that we don't rotate the Refresh Token itself, and it's not - returned by this API endpoint. - - Args: - body (RefreshSessionParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | RefreshSessionResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: RefreshSessionParams, -) -> ErrorModel | RefreshSessionResponse | None: - """Refresh session - - If your access tokens expire, this API endpoint takes a Refresh Token and returns a new set of - Access Tokens for your session. Note that we don't rotate the Refresh Token itself, and it's not - returned by this API endpoint. - - Args: - body (RefreshSessionParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | RefreshSessionResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/regenerate_guest_login_url.py b/src/tower/tower_api_client/api/default/regenerate_guest_login_url.py deleted file mode 100644 index 0937e249..00000000 --- a/src/tower/tower_api_client/api/default/regenerate_guest_login_url.py +++ /dev/null @@ -1,189 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.regenerate_guest_login_url_params import RegenerateGuestLoginURLParams -from ...models.regenerate_guest_login_url_response import ( - RegenerateGuestLoginURLResponse, -) -from ...types import Response - - -def _get_kwargs( - guest_id: str, - *, - body: RegenerateGuestLoginURLParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/guests/{guest_id}/login-url".format( - guest_id=quote(str(guest_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | RegenerateGuestLoginURLResponse: - if response.status_code == 200: - response_200 = RegenerateGuestLoginURLResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | RegenerateGuestLoginURLResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - guest_id: str, - *, - client: AuthenticatedClient, - body: RegenerateGuestLoginURLParams, -) -> Response[ErrorModel | RegenerateGuestLoginURLResponse]: - """Regenerate guest login URL - - Creates a new login URL for an existing guest. Use this if the previous URL expired or was - compromised. - - Args: - guest_id (str): The ID of the guest to regenerate the login URL for. - body (RegenerateGuestLoginURLParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | RegenerateGuestLoginURLResponse] - """ - - kwargs = _get_kwargs( - guest_id=guest_id, - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - guest_id: str, - *, - client: AuthenticatedClient, - body: RegenerateGuestLoginURLParams, -) -> ErrorModel | RegenerateGuestLoginURLResponse | None: - """Regenerate guest login URL - - Creates a new login URL for an existing guest. Use this if the previous URL expired or was - compromised. - - Args: - guest_id (str): The ID of the guest to regenerate the login URL for. - body (RegenerateGuestLoginURLParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | RegenerateGuestLoginURLResponse - """ - - return sync_detailed( - guest_id=guest_id, - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - guest_id: str, - *, - client: AuthenticatedClient, - body: RegenerateGuestLoginURLParams, -) -> Response[ErrorModel | RegenerateGuestLoginURLResponse]: - """Regenerate guest login URL - - Creates a new login URL for an existing guest. Use this if the previous URL expired or was - compromised. - - Args: - guest_id (str): The ID of the guest to regenerate the login URL for. - body (RegenerateGuestLoginURLParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | RegenerateGuestLoginURLResponse] - """ - - kwargs = _get_kwargs( - guest_id=guest_id, - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - guest_id: str, - *, - client: AuthenticatedClient, - body: RegenerateGuestLoginURLParams, -) -> ErrorModel | RegenerateGuestLoginURLResponse | None: - """Regenerate guest login URL - - Creates a new login URL for an existing guest. Use this if the previous URL expired or was - compromised. - - Args: - guest_id (str): The ID of the guest to regenerate the login URL for. - body (RegenerateGuestLoginURLParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | RegenerateGuestLoginURLResponse - """ - - return ( - await asyncio_detailed( - guest_id=guest_id, - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/remove_team_member.py b/src/tower/tower_api_client/api/default/remove_team_member.py deleted file mode 100644 index 1a80ada5..00000000 --- a/src/tower/tower_api_client/api/default/remove_team_member.py +++ /dev/null @@ -1,175 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.remove_team_member_params import RemoveTeamMemberParams -from ...models.remove_team_member_response import RemoveTeamMemberResponse -from ...types import Response - - -def _get_kwargs( - name: str, - *, - body: RemoveTeamMemberParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/teams/{name}/members".format( - name=quote(str(name), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | RemoveTeamMemberResponse: - if response.status_code == 200: - response_200 = RemoveTeamMemberResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | RemoveTeamMemberResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, - body: RemoveTeamMemberParams, -) -> Response[ErrorModel | RemoveTeamMemberResponse]: - """Remove team member - - Args: - name (str): The name of the team to remove someone from - body (RemoveTeamMemberParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | RemoveTeamMemberResponse] - """ - - kwargs = _get_kwargs( - name=name, - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, - body: RemoveTeamMemberParams, -) -> ErrorModel | RemoveTeamMemberResponse | None: - """Remove team member - - Args: - name (str): The name of the team to remove someone from - body (RemoveTeamMemberParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | RemoveTeamMemberResponse - """ - - return sync_detailed( - name=name, - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, - body: RemoveTeamMemberParams, -) -> Response[ErrorModel | RemoveTeamMemberResponse]: - """Remove team member - - Args: - name (str): The name of the team to remove someone from - body (RemoveTeamMemberParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | RemoveTeamMemberResponse] - """ - - kwargs = _get_kwargs( - name=name, - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, - body: RemoveTeamMemberParams, -) -> ErrorModel | RemoveTeamMemberResponse | None: - """Remove team member - - Args: - name (str): The name of the team to remove someone from - body (RemoveTeamMemberParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | RemoveTeamMemberResponse - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/resend_email_verification.py b/src/tower/tower_api_client/api/default/resend_email_verification.py deleted file mode 100644 index 3740d15e..00000000 --- a/src/tower/tower_api_client/api/default/resend_email_verification.py +++ /dev/null @@ -1,136 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...types import Response - - -def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/user/resend-verification", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | ErrorModel: - if response.status_code == 204: - response_204 = cast(Any, None) - return response_204 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | ErrorModel]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, -) -> Response[Any | ErrorModel]: - """Resent email verification - - If a user doesn't have a verified email address, this API endpoint will send a new confirmation - email to them - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Any | ErrorModel] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, -) -> Any | ErrorModel | None: - """Resent email verification - - If a user doesn't have a verified email address, this API endpoint will send a new confirmation - email to them - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Any | ErrorModel - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, -) -> Response[Any | ErrorModel]: - """Resent email verification - - If a user doesn't have a verified email address, this API endpoint will send a new confirmation - email to them - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Any | ErrorModel] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, -) -> Any | ErrorModel | None: - """Resent email verification - - If a user doesn't have a verified email address, this API endpoint will send a new confirmation - email to them - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Any | ErrorModel - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/resend_team_invitation.py b/src/tower/tower_api_client/api/default/resend_team_invitation.py deleted file mode 100644 index b519ebf1..00000000 --- a/src/tower/tower_api_client/api/default/resend_team_invitation.py +++ /dev/null @@ -1,183 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.resend_team_invitation_params import ResendTeamInvitationParams -from ...models.resend_team_invitation_response import ResendTeamInvitationResponse -from ...types import Response - - -def _get_kwargs( - name: str, - *, - body: ResendTeamInvitationParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/teams/{name}/invites/resend".format( - name=quote(str(name), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | ResendTeamInvitationResponse: - if response.status_code == 200: - response_200 = ResendTeamInvitationResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | ResendTeamInvitationResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, - body: ResendTeamInvitationParams, -) -> Response[ErrorModel | ResendTeamInvitationResponse]: - """Resend team invitation - - Resend a team invitation to a user if they need a reminder or if they lost it - - Args: - name (str): The name of the team to invite someone to - body (ResendTeamInvitationParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ResendTeamInvitationResponse] - """ - - kwargs = _get_kwargs( - name=name, - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, - body: ResendTeamInvitationParams, -) -> ErrorModel | ResendTeamInvitationResponse | None: - """Resend team invitation - - Resend a team invitation to a user if they need a reminder or if they lost it - - Args: - name (str): The name of the team to invite someone to - body (ResendTeamInvitationParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ResendTeamInvitationResponse - """ - - return sync_detailed( - name=name, - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, - body: ResendTeamInvitationParams, -) -> Response[ErrorModel | ResendTeamInvitationResponse]: - """Resend team invitation - - Resend a team invitation to a user if they need a reminder or if they lost it - - Args: - name (str): The name of the team to invite someone to - body (ResendTeamInvitationParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | ResendTeamInvitationResponse] - """ - - kwargs = _get_kwargs( - name=name, - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, - body: ResendTeamInvitationParams, -) -> ErrorModel | ResendTeamInvitationResponse | None: - """Resend team invitation - - Resend a team invitation to a user if they need a reminder or if they lost it - - Args: - name (str): The name of the team to invite someone to - body (ResendTeamInvitationParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | ResendTeamInvitationResponse - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/run_app.py b/src/tower/tower_api_client/api/default/run_app.py deleted file mode 100644 index 8ef5e82f..00000000 --- a/src/tower/tower_api_client/api/default/run_app.py +++ /dev/null @@ -1,190 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.run_app_params import RunAppParams -from ...models.run_app_response import RunAppResponse -from ...types import Response - - -def _get_kwargs( - name: str, - *, - body: RunAppParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/apps/{name}/runs".format( - name=quote(str(name), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | RunAppResponse | None: - if response.status_code == 201: - response_201 = RunAppResponse.from_dict(response.json()) - - return response_201 - - if response.status_code == 401: - response_401 = ErrorModel.from_dict(response.json()) - - return response_401 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | RunAppResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, - body: RunAppParams, -) -> Response[ErrorModel | RunAppResponse]: - """Run app - - Runs an app with the supplied parameters. - - Args: - name (str): The name of the app to fetch runs for. - body (RunAppParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | RunAppResponse] - """ - - kwargs = _get_kwargs( - name=name, - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, - body: RunAppParams, -) -> ErrorModel | RunAppResponse | None: - """Run app - - Runs an app with the supplied parameters. - - Args: - name (str): The name of the app to fetch runs for. - body (RunAppParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | RunAppResponse - """ - - return sync_detailed( - name=name, - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, - body: RunAppParams, -) -> Response[ErrorModel | RunAppResponse]: - """Run app - - Runs an app with the supplied parameters. - - Args: - name (str): The name of the app to fetch runs for. - body (RunAppParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | RunAppResponse] - """ - - kwargs = _get_kwargs( - name=name, - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, - body: RunAppParams, -) -> ErrorModel | RunAppResponse | None: - """Run app - - Runs an app with the supplied parameters. - - Args: - name (str): The name of the app to fetch runs for. - body (RunAppParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | RunAppResponse - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/search_runs.py b/src/tower/tower_api_client/api/default/search_runs.py deleted file mode 100644 index 9af4f0b6..00000000 --- a/src/tower/tower_api_client/api/default/search_runs.py +++ /dev/null @@ -1,272 +0,0 @@ -import datetime -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.search_runs_response import SearchRunsResponse -from ...models.search_runs_status_item import SearchRunsStatusItem -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - page: int | Unset = 1, - page_size: int | Unset = 20, - status: list[SearchRunsStatusItem] | Unset = UNSET, - start_at: datetime.datetime | Unset = UNSET, - end_at: datetime.datetime | Unset = UNSET, - environment: str | Unset = UNSET, -) -> dict[str, Any]: - params: dict[str, Any] = {} - - params["page"] = page - - params["page_size"] = page_size - - json_status: list[str] | Unset = UNSET - if not isinstance(status, Unset): - json_status = [] - for status_item_data in status: - status_item = status_item_data.value - json_status.append(status_item) - - params["status"] = json_status - - json_start_at: str | Unset = UNSET - if not isinstance(start_at, Unset): - json_start_at = start_at.isoformat() - params["start_at"] = json_start_at - - json_end_at: str | Unset = UNSET - if not isinstance(end_at, Unset): - json_end_at = end_at.isoformat() - params["end_at"] = json_end_at - - params["environment"] = environment - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/runs", - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | SearchRunsResponse: - if response.status_code == 200: - response_200 = SearchRunsResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | SearchRunsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, - status: list[SearchRunsStatusItem] | Unset = UNSET, - start_at: datetime.datetime | Unset = UNSET, - end_at: datetime.datetime | Unset = UNSET, - environment: str | Unset = UNSET, -) -> Response[ErrorModel | SearchRunsResponse]: - """Search runs - - Search, filter, and list runs across all of the apps in your account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - status (list[SearchRunsStatusItem] | Unset): Filter runs by status(es). Define multiple - with a comma-separated list. Supplying none will return all statuses. - start_at (datetime.datetime | Unset): Filter runs scheduled after this datetime - (inclusive). Provide timestamps in ISO-8601 format. - end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime - (inclusive). Provide timestamps in ISO-8601 format. - environment (str | Unset): Filter runs by environment. If not provided, all environments - will be included. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | SearchRunsResponse] - """ - - kwargs = _get_kwargs( - page=page, - page_size=page_size, - status=status, - start_at=start_at, - end_at=end_at, - environment=environment, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, - status: list[SearchRunsStatusItem] | Unset = UNSET, - start_at: datetime.datetime | Unset = UNSET, - end_at: datetime.datetime | Unset = UNSET, - environment: str | Unset = UNSET, -) -> ErrorModel | SearchRunsResponse | None: - """Search runs - - Search, filter, and list runs across all of the apps in your account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - status (list[SearchRunsStatusItem] | Unset): Filter runs by status(es). Define multiple - with a comma-separated list. Supplying none will return all statuses. - start_at (datetime.datetime | Unset): Filter runs scheduled after this datetime - (inclusive). Provide timestamps in ISO-8601 format. - end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime - (inclusive). Provide timestamps in ISO-8601 format. - environment (str | Unset): Filter runs by environment. If not provided, all environments - will be included. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | SearchRunsResponse - """ - - return sync_detailed( - client=client, - page=page, - page_size=page_size, - status=status, - start_at=start_at, - end_at=end_at, - environment=environment, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, - status: list[SearchRunsStatusItem] | Unset = UNSET, - start_at: datetime.datetime | Unset = UNSET, - end_at: datetime.datetime | Unset = UNSET, - environment: str | Unset = UNSET, -) -> Response[ErrorModel | SearchRunsResponse]: - """Search runs - - Search, filter, and list runs across all of the apps in your account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - status (list[SearchRunsStatusItem] | Unset): Filter runs by status(es). Define multiple - with a comma-separated list. Supplying none will return all statuses. - start_at (datetime.datetime | Unset): Filter runs scheduled after this datetime - (inclusive). Provide timestamps in ISO-8601 format. - end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime - (inclusive). Provide timestamps in ISO-8601 format. - environment (str | Unset): Filter runs by environment. If not provided, all environments - will be included. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | SearchRunsResponse] - """ - - kwargs = _get_kwargs( - page=page, - page_size=page_size, - status=status, - start_at=start_at, - end_at=end_at, - environment=environment, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - page_size: int | Unset = 20, - status: list[SearchRunsStatusItem] | Unset = UNSET, - start_at: datetime.datetime | Unset = UNSET, - end_at: datetime.datetime | Unset = UNSET, - environment: str | Unset = UNSET, -) -> ErrorModel | SearchRunsResponse | None: - """Search runs - - Search, filter, and list runs across all of the apps in your account. - - Args: - page (int | Unset): The page number to fetch. Default: 1. - page_size (int | Unset): The number of records to fetch on each page. Default: 20. - status (list[SearchRunsStatusItem] | Unset): Filter runs by status(es). Define multiple - with a comma-separated list. Supplying none will return all statuses. - start_at (datetime.datetime | Unset): Filter runs scheduled after this datetime - (inclusive). Provide timestamps in ISO-8601 format. - end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime - (inclusive). Provide timestamps in ISO-8601 format. - environment (str | Unset): Filter runs by environment. If not provided, all environments - will be included. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | SearchRunsResponse - """ - - return ( - await asyncio_detailed( - client=client, - page=page, - page_size=page_size, - status=status, - start_at=start_at, - end_at=end_at, - environment=environment, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/stream_alerts.py b/src/tower/tower_api_client/api/default/stream_alerts.py deleted file mode 100644 index 8339c35b..00000000 --- a/src/tower/tower_api_client/api/default/stream_alerts.py +++ /dev/null @@ -1,160 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.stream_alerts_event_alert import StreamAlertsEventAlert -from ...models.stream_alerts_event_error import StreamAlertsEventError -from ...types import Response - - -def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/alerts/stream", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | list[StreamAlertsEventAlert | StreamAlertsEventError]: - if response.status_code == 200: - response_200 = [] - _response_200 = response.text - for response_200_item_data in _response_200: - - def _parse_response_200_item( - data: object, - ) -> StreamAlertsEventAlert | StreamAlertsEventError: - try: - if not isinstance(data, dict): - raise TypeError() - response_200_item_event_alert = StreamAlertsEventAlert.from_dict( - data - ) - - return response_200_item_event_alert - except (TypeError, ValueError, AttributeError, KeyError): - pass - if not isinstance(data, dict): - raise TypeError() - response_200_item_event_error = StreamAlertsEventError.from_dict(data) - - return response_200_item_event_error - - response_200_item = _parse_response_200_item(response_200_item_data) - - response_200.append(response_200_item) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | list[StreamAlertsEventAlert | StreamAlertsEventError]]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, -) -> Response[ErrorModel | list[StreamAlertsEventAlert | StreamAlertsEventError]]: - """Stream alert notifications - - Streams alert notifications in real-time - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | list[StreamAlertsEventAlert | StreamAlertsEventError]] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, -) -> ErrorModel | list[StreamAlertsEventAlert | StreamAlertsEventError] | None: - """Stream alert notifications - - Streams alert notifications in real-time - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | list[StreamAlertsEventAlert | StreamAlertsEventError] - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, -) -> Response[ErrorModel | list[StreamAlertsEventAlert | StreamAlertsEventError]]: - """Stream alert notifications - - Streams alert notifications in real-time - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | list[StreamAlertsEventAlert | StreamAlertsEventError]] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, -) -> ErrorModel | list[StreamAlertsEventAlert | StreamAlertsEventError] | None: - """Stream alert notifications - - Streams alert notifications in real-time - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | list[StreamAlertsEventAlert | StreamAlertsEventError] - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/stream_run_logs.py b/src/tower/tower_api_client/api/default/stream_run_logs.py deleted file mode 100644 index d203deba..00000000 --- a/src/tower/tower_api_client/api/default/stream_run_logs.py +++ /dev/null @@ -1,201 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.stream_run_logs_event_log import StreamRunLogsEventLog -from ...models.stream_run_logs_event_warning import StreamRunLogsEventWarning -from ...types import Response - - -def _get_kwargs( - name: str, - seq: int, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/apps/{name}/runs/{seq}/logs/stream".format( - name=quote(str(name), safe=""), - seq=quote(str(seq), safe=""), - ), - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | list[StreamRunLogsEventLog | StreamRunLogsEventWarning]: - if response.status_code == 200: - response_200 = [] - _response_200 = response.text - for response_200_item_data in _response_200: - - def _parse_response_200_item( - data: object, - ) -> StreamRunLogsEventLog | StreamRunLogsEventWarning: - try: - if not isinstance(data, dict): - raise TypeError() - response_200_item_event_log = StreamRunLogsEventLog.from_dict(data) - - return response_200_item_event_log - except (TypeError, ValueError, AttributeError, KeyError): - pass - if not isinstance(data, dict): - raise TypeError() - response_200_item_event_warning = StreamRunLogsEventWarning.from_dict( - data - ) - - return response_200_item_event_warning - - response_200_item = _parse_response_200_item(response_200_item_data) - - response_200.append(response_200_item) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | list[StreamRunLogsEventLog | StreamRunLogsEventWarning]]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - seq: int, - *, - client: AuthenticatedClient, -) -> Response[ErrorModel | list[StreamRunLogsEventLog | StreamRunLogsEventWarning]]: - """Stream run logs - - Streams the logs associated with a particular run of an app in real-time. - - Args: - name (str): The name of the app to get logs for. - seq (int): The sequence number of the run to get logs for. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | list[StreamRunLogsEventLog | StreamRunLogsEventWarning]] - """ - - kwargs = _get_kwargs( - name=name, - seq=seq, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - seq: int, - *, - client: AuthenticatedClient, -) -> ErrorModel | list[StreamRunLogsEventLog | StreamRunLogsEventWarning] | None: - """Stream run logs - - Streams the logs associated with a particular run of an app in real-time. - - Args: - name (str): The name of the app to get logs for. - seq (int): The sequence number of the run to get logs for. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | list[StreamRunLogsEventLog | StreamRunLogsEventWarning] - """ - - return sync_detailed( - name=name, - seq=seq, - client=client, - ).parsed - - -async def asyncio_detailed( - name: str, - seq: int, - *, - client: AuthenticatedClient, -) -> Response[ErrorModel | list[StreamRunLogsEventLog | StreamRunLogsEventWarning]]: - """Stream run logs - - Streams the logs associated with a particular run of an app in real-time. - - Args: - name (str): The name of the app to get logs for. - seq (int): The sequence number of the run to get logs for. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | list[StreamRunLogsEventLog | StreamRunLogsEventWarning]] - """ - - kwargs = _get_kwargs( - name=name, - seq=seq, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - seq: int, - *, - client: AuthenticatedClient, -) -> ErrorModel | list[StreamRunLogsEventLog | StreamRunLogsEventWarning] | None: - """Stream run logs - - Streams the logs associated with a particular run of an app in real-time. - - Args: - name (str): The name of the app to get logs for. - seq (int): The sequence number of the run to get logs for. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | list[StreamRunLogsEventLog | StreamRunLogsEventWarning] - """ - - return ( - await asyncio_detailed( - name=name, - seq=seq, - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/stream_shouldertaps.py b/src/tower/tower_api_client/api/default/stream_shouldertaps.py deleted file mode 100644 index 639307e2..00000000 --- a/src/tower/tower_api_client/api/default/stream_shouldertaps.py +++ /dev/null @@ -1,184 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.stream_shouldertaps_event_shouldertap import ( - StreamShouldertapsEventShouldertap, -) -from ...models.stream_shouldertaps_event_warning import StreamShouldertapsEventWarning -from ...types import Response - - -def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/shouldertaps/stream", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ( - ErrorModel - | list[StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning] -): - if response.status_code == 200: - response_200 = [] - _response_200 = response.text - for response_200_item_data in _response_200: - - def _parse_response_200_item( - data: object, - ) -> StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning: - try: - if not isinstance(data, dict): - raise TypeError() - response_200_item_event_shouldertap = ( - StreamShouldertapsEventShouldertap.from_dict(data) - ) - - return response_200_item_event_shouldertap - except (TypeError, ValueError, AttributeError, KeyError): - pass - if not isinstance(data, dict): - raise TypeError() - response_200_item_event_warning = ( - StreamShouldertapsEventWarning.from_dict(data) - ) - - return response_200_item_event_warning - - response_200_item = _parse_response_200_item(response_200_item_data) - - response_200.append(response_200_item) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ - ErrorModel - | list[StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning] -]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, -) -> Response[ - ErrorModel - | list[StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning] -]: - """Stream shouldertaps - - Stream events over SSE that notify you of potential data staleness - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | list[StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning]] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, -) -> ( - ErrorModel - | list[StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning] - | None -): - """Stream shouldertaps - - Stream events over SSE that notify you of potential data staleness - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | list[StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning] - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, -) -> Response[ - ErrorModel - | list[StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning] -]: - """Stream shouldertaps - - Stream events over SSE that notify you of potential data staleness - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | list[StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning]] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, -) -> ( - ErrorModel - | list[StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning] - | None -): - """Stream shouldertaps - - Stream events over SSE that notify you of potential data staleness - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | list[StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning] - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/update_account.py b/src/tower/tower_api_client/api/default/update_account.py deleted file mode 100644 index d5425c46..00000000 --- a/src/tower/tower_api_client/api/default/update_account.py +++ /dev/null @@ -1,183 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.update_account_params import UpdateAccountParams -from ...models.update_account_response import UpdateAccountResponse -from ...types import Response - - -def _get_kwargs( - name: str, - *, - body: UpdateAccountParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "put", - "url": "/accounts/{name}".format( - name=quote(str(name), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | UpdateAccountResponse: - if response.status_code == 200: - response_200 = UpdateAccountResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | UpdateAccountResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, - body: UpdateAccountParams, -) -> Response[ErrorModel | UpdateAccountResponse]: - """Update account - - Update the properties of an account - - Args: - name (str): The name of the account to update - body (UpdateAccountParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | UpdateAccountResponse] - """ - - kwargs = _get_kwargs( - name=name, - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, - body: UpdateAccountParams, -) -> ErrorModel | UpdateAccountResponse | None: - """Update account - - Update the properties of an account - - Args: - name (str): The name of the account to update - body (UpdateAccountParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | UpdateAccountResponse - """ - - return sync_detailed( - name=name, - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, - body: UpdateAccountParams, -) -> Response[ErrorModel | UpdateAccountResponse]: - """Update account - - Update the properties of an account - - Args: - name (str): The name of the account to update - body (UpdateAccountParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | UpdateAccountResponse] - """ - - kwargs = _get_kwargs( - name=name, - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, - body: UpdateAccountParams, -) -> ErrorModel | UpdateAccountResponse | None: - """Update account - - Update the properties of an account - - Args: - name (str): The name of the account to update - body (UpdateAccountParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | UpdateAccountResponse - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/update_app.py b/src/tower/tower_api_client/api/default/update_app.py deleted file mode 100644 index 6e68bd0c..00000000 --- a/src/tower/tower_api_client/api/default/update_app.py +++ /dev/null @@ -1,183 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.update_app_params import UpdateAppParams -from ...models.update_app_response import UpdateAppResponse -from ...types import Response - - -def _get_kwargs( - name: str, - *, - body: UpdateAppParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "put", - "url": "/apps/{name}".format( - name=quote(str(name), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | UpdateAppResponse: - if response.status_code == 200: - response_200 = UpdateAppResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | UpdateAppResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, - body: UpdateAppParams, -) -> Response[ErrorModel | UpdateAppResponse]: - """Update app - - Update an app in the currently authenticated account. - - Args: - name (str): The name of the App to update. - body (UpdateAppParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | UpdateAppResponse] - """ - - kwargs = _get_kwargs( - name=name, - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, - body: UpdateAppParams, -) -> ErrorModel | UpdateAppResponse | None: - """Update app - - Update an app in the currently authenticated account. - - Args: - name (str): The name of the App to update. - body (UpdateAppParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | UpdateAppResponse - """ - - return sync_detailed( - name=name, - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, - body: UpdateAppParams, -) -> Response[ErrorModel | UpdateAppResponse]: - """Update app - - Update an app in the currently authenticated account. - - Args: - name (str): The name of the App to update. - body (UpdateAppParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | UpdateAppResponse] - """ - - kwargs = _get_kwargs( - name=name, - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, - body: UpdateAppParams, -) -> ErrorModel | UpdateAppResponse | None: - """Update app - - Update an app in the currently authenticated account. - - Args: - name (str): The name of the App to update. - body (UpdateAppParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | UpdateAppResponse - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/update_catalog.py b/src/tower/tower_api_client/api/default/update_catalog.py deleted file mode 100644 index 446a800c..00000000 --- a/src/tower/tower_api_client/api/default/update_catalog.py +++ /dev/null @@ -1,183 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.update_catalog_params import UpdateCatalogParams -from ...models.update_catalog_response import UpdateCatalogResponse -from ...types import Response - - -def _get_kwargs( - name: str, - *, - body: UpdateCatalogParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "put", - "url": "/catalogs/{name}".format( - name=quote(str(name), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | UpdateCatalogResponse: - if response.status_code == 200: - response_200 = UpdateCatalogResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | UpdateCatalogResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, - body: UpdateCatalogParams, -) -> Response[ErrorModel | UpdateCatalogResponse]: - """Update catalog - - Update a new catalog object in the currently authenticated account. - - Args: - name (str): The name of the catalog to update. - body (UpdateCatalogParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | UpdateCatalogResponse] - """ - - kwargs = _get_kwargs( - name=name, - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, - body: UpdateCatalogParams, -) -> ErrorModel | UpdateCatalogResponse | None: - """Update catalog - - Update a new catalog object in the currently authenticated account. - - Args: - name (str): The name of the catalog to update. - body (UpdateCatalogParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | UpdateCatalogResponse - """ - - return sync_detailed( - name=name, - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, - body: UpdateCatalogParams, -) -> Response[ErrorModel | UpdateCatalogResponse]: - """Update catalog - - Update a new catalog object in the currently authenticated account. - - Args: - name (str): The name of the catalog to update. - body (UpdateCatalogParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | UpdateCatalogResponse] - """ - - kwargs = _get_kwargs( - name=name, - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, - body: UpdateCatalogParams, -) -> ErrorModel | UpdateCatalogResponse | None: - """Update catalog - - Update a new catalog object in the currently authenticated account. - - Args: - name (str): The name of the catalog to update. - body (UpdateCatalogParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | UpdateCatalogResponse - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/update_email_preferences.py b/src/tower/tower_api_client/api/default/update_email_preferences.py deleted file mode 100644 index ede38b4b..00000000 --- a/src/tower/tower_api_client/api/default/update_email_preferences.py +++ /dev/null @@ -1,170 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.update_email_preferences_body import UpdateEmailPreferencesBody -from ...types import Response - - -def _get_kwargs( - *, - body: UpdateEmailPreferencesBody, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "put", - "url": "/user/email-preferences", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | UpdateEmailPreferencesBody: - if response.status_code == 200: - response_200 = UpdateEmailPreferencesBody.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | UpdateEmailPreferencesBody]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: UpdateEmailPreferencesBody, -) -> Response[ErrorModel | UpdateEmailPreferencesBody]: - """Update email preferences - - Updates the set of email preferences the current user has. If a partial set of preferences is - submitted, it will be updated accordingly. - - Args: - body (UpdateEmailPreferencesBody): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | UpdateEmailPreferencesBody] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: UpdateEmailPreferencesBody, -) -> ErrorModel | UpdateEmailPreferencesBody | None: - """Update email preferences - - Updates the set of email preferences the current user has. If a partial set of preferences is - submitted, it will be updated accordingly. - - Args: - body (UpdateEmailPreferencesBody): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | UpdateEmailPreferencesBody - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: UpdateEmailPreferencesBody, -) -> Response[ErrorModel | UpdateEmailPreferencesBody]: - """Update email preferences - - Updates the set of email preferences the current user has. If a partial set of preferences is - submitted, it will be updated accordingly. - - Args: - body (UpdateEmailPreferencesBody): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | UpdateEmailPreferencesBody] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: UpdateEmailPreferencesBody, -) -> ErrorModel | UpdateEmailPreferencesBody | None: - """Update email preferences - - Updates the set of email preferences the current user has. If a partial set of preferences is - submitted, it will be updated accordingly. - - Args: - body (UpdateEmailPreferencesBody): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | UpdateEmailPreferencesBody - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/update_environment.py b/src/tower/tower_api_client/api/default/update_environment.py deleted file mode 100644 index c0a2f94a..00000000 --- a/src/tower/tower_api_client/api/default/update_environment.py +++ /dev/null @@ -1,183 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.update_environment_params import UpdateEnvironmentParams -from ...models.update_environment_response import UpdateEnvironmentResponse -from ...types import Response - - -def _get_kwargs( - name: str, - *, - body: UpdateEnvironmentParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "put", - "url": "/environments/{name}".format( - name=quote(str(name), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | UpdateEnvironmentResponse: - if response.status_code == 200: - response_200 = UpdateEnvironmentResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | UpdateEnvironmentResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, - body: UpdateEnvironmentParams, -) -> Response[ErrorModel | UpdateEnvironmentResponse]: - """Update environment - - Rename your environment - - Args: - name (str): The current name of the environment to update. - body (UpdateEnvironmentParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | UpdateEnvironmentResponse] - """ - - kwargs = _get_kwargs( - name=name, - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, - body: UpdateEnvironmentParams, -) -> ErrorModel | UpdateEnvironmentResponse | None: - """Update environment - - Rename your environment - - Args: - name (str): The current name of the environment to update. - body (UpdateEnvironmentParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | UpdateEnvironmentResponse - """ - - return sync_detailed( - name=name, - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, - body: UpdateEnvironmentParams, -) -> Response[ErrorModel | UpdateEnvironmentResponse]: - """Update environment - - Rename your environment - - Args: - name (str): The current name of the environment to update. - body (UpdateEnvironmentParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | UpdateEnvironmentResponse] - """ - - kwargs = _get_kwargs( - name=name, - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, - body: UpdateEnvironmentParams, -) -> ErrorModel | UpdateEnvironmentResponse | None: - """Update environment - - Rename your environment - - Args: - name (str): The current name of the environment to update. - body (UpdateEnvironmentParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | UpdateEnvironmentResponse - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/update_my_team_invitation.py b/src/tower/tower_api_client/api/default/update_my_team_invitation.py deleted file mode 100644 index 823c9058..00000000 --- a/src/tower/tower_api_client/api/default/update_my_team_invitation.py +++ /dev/null @@ -1,184 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.update_my_team_invitation_params import UpdateMyTeamInvitationParams -from ...models.update_my_team_invitation_response import UpdateMyTeamInvitationResponse -from ...types import Response - - -def _get_kwargs( - *, - body: UpdateMyTeamInvitationParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "put", - "url": "/team-invites", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | UpdateMyTeamInvitationResponse | None: - if response.status_code == 200: - response_200 = UpdateMyTeamInvitationResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 404: - response_404 = ErrorModel.from_dict(response.json()) - - return response_404 - - if response.status_code == 422: - response_422 = ErrorModel.from_dict(response.json()) - - return response_422 - - if response.status_code == 500: - response_500 = ErrorModel.from_dict(response.json()) - - return response_500 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | UpdateMyTeamInvitationResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: UpdateMyTeamInvitationParams, -) -> Response[ErrorModel | UpdateMyTeamInvitationResponse]: - """Update my team invitation - - Update a team invitation that you have pending - - Args: - body (UpdateMyTeamInvitationParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | UpdateMyTeamInvitationResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: UpdateMyTeamInvitationParams, -) -> ErrorModel | UpdateMyTeamInvitationResponse | None: - """Update my team invitation - - Update a team invitation that you have pending - - Args: - body (UpdateMyTeamInvitationParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | UpdateMyTeamInvitationResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: UpdateMyTeamInvitationParams, -) -> Response[ErrorModel | UpdateMyTeamInvitationResponse]: - """Update my team invitation - - Update a team invitation that you have pending - - Args: - body (UpdateMyTeamInvitationParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | UpdateMyTeamInvitationResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: UpdateMyTeamInvitationParams, -) -> ErrorModel | UpdateMyTeamInvitationResponse | None: - """Update my team invitation - - Update a team invitation that you have pending - - Args: - body (UpdateMyTeamInvitationParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | UpdateMyTeamInvitationResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/update_organization.py b/src/tower/tower_api_client/api/default/update_organization.py deleted file mode 100644 index 614eee9b..00000000 --- a/src/tower/tower_api_client/api/default/update_organization.py +++ /dev/null @@ -1,210 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.update_organization_params import UpdateOrganizationParams -from ...models.update_organization_response import UpdateOrganizationResponse -from ...types import Response - - -def _get_kwargs( - name: str, - *, - body: UpdateOrganizationParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "put", - "url": "/organizations/{name}".format( - name=quote(str(name), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | UpdateOrganizationResponse | None: - if response.status_code == 200: - response_200 = UpdateOrganizationResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 403: - response_403 = ErrorModel.from_dict(response.json()) - - return response_403 - - if response.status_code == 404: - response_404 = ErrorModel.from_dict(response.json()) - - return response_404 - - if response.status_code == 409: - response_409 = ErrorModel.from_dict(response.json()) - - return response_409 - - if response.status_code == 422: - response_422 = ErrorModel.from_dict(response.json()) - - return response_422 - - if response.status_code == 500: - response_500 = ErrorModel.from_dict(response.json()) - - return response_500 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | UpdateOrganizationResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, - body: UpdateOrganizationParams, -) -> Response[ErrorModel | UpdateOrganizationResponse]: - """Update organization - - Update an organization's name. Only the current owner can perform this operation. - - Args: - name (str): The current name of the organization to update - body (UpdateOrganizationParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | UpdateOrganizationResponse] - """ - - kwargs = _get_kwargs( - name=name, - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, - body: UpdateOrganizationParams, -) -> ErrorModel | UpdateOrganizationResponse | None: - """Update organization - - Update an organization's name. Only the current owner can perform this operation. - - Args: - name (str): The current name of the organization to update - body (UpdateOrganizationParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | UpdateOrganizationResponse - """ - - return sync_detailed( - name=name, - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, - body: UpdateOrganizationParams, -) -> Response[ErrorModel | UpdateOrganizationResponse]: - """Update organization - - Update an organization's name. Only the current owner can perform this operation. - - Args: - name (str): The current name of the organization to update - body (UpdateOrganizationParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | UpdateOrganizationResponse] - """ - - kwargs = _get_kwargs( - name=name, - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, - body: UpdateOrganizationParams, -) -> ErrorModel | UpdateOrganizationResponse | None: - """Update organization - - Update an organization's name. Only the current owner can perform this operation. - - Args: - name (str): The current name of the organization to update - body (UpdateOrganizationParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | UpdateOrganizationResponse - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/update_password_reset.py b/src/tower/tower_api_client/api/default/update_password_reset.py deleted file mode 100644 index 33097d74..00000000 --- a/src/tower/tower_api_client/api/default/update_password_reset.py +++ /dev/null @@ -1,183 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.update_password_reset_params import UpdatePasswordResetParams -from ...models.update_password_reset_response import UpdatePasswordResetResponse -from ...types import Response - - -def _get_kwargs( - code: str, - *, - body: UpdatePasswordResetParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/accounts/password-reset/{code}".format( - code=quote(str(code), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | UpdatePasswordResetResponse: - if response.status_code == 200: - response_200 = UpdatePasswordResetResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | UpdatePasswordResetResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - code: str, - *, - client: AuthenticatedClient | Client, - body: UpdatePasswordResetParams, -) -> Response[ErrorModel | UpdatePasswordResetResponse]: - """Update password reset - - Updates the password reset code with the new password - - Args: - code (str): The password reset code that was sent to you - body (UpdatePasswordResetParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | UpdatePasswordResetResponse] - """ - - kwargs = _get_kwargs( - code=code, - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - code: str, - *, - client: AuthenticatedClient | Client, - body: UpdatePasswordResetParams, -) -> ErrorModel | UpdatePasswordResetResponse | None: - """Update password reset - - Updates the password reset code with the new password - - Args: - code (str): The password reset code that was sent to you - body (UpdatePasswordResetParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | UpdatePasswordResetResponse - """ - - return sync_detailed( - code=code, - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - code: str, - *, - client: AuthenticatedClient | Client, - body: UpdatePasswordResetParams, -) -> Response[ErrorModel | UpdatePasswordResetResponse]: - """Update password reset - - Updates the password reset code with the new password - - Args: - code (str): The password reset code that was sent to you - body (UpdatePasswordResetParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | UpdatePasswordResetResponse] - """ - - kwargs = _get_kwargs( - code=code, - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - code: str, - *, - client: AuthenticatedClient | Client, - body: UpdatePasswordResetParams, -) -> ErrorModel | UpdatePasswordResetResponse | None: - """Update password reset - - Updates the password reset code with the new password - - Args: - code (str): The password reset code that was sent to you - body (UpdatePasswordResetParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | UpdatePasswordResetResponse - """ - - return ( - await asyncio_detailed( - code=code, - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/update_plan.py b/src/tower/tower_api_client/api/default/update_plan.py deleted file mode 100644 index bddc9deb..00000000 --- a/src/tower/tower_api_client/api/default/update_plan.py +++ /dev/null @@ -1,159 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.update_plan_params import UpdatePlanParams -from ...models.update_plan_response import UpdatePlanResponse -from ...types import Response - - -def _get_kwargs( - *, - body: UpdatePlanParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "put", - "url": "/plan", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | UpdatePlanResponse: - if response.status_code == 201: - response_201 = UpdatePlanResponse.from_dict(response.json()) - - return response_201 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | UpdatePlanResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: UpdatePlanParams, -) -> Response[ErrorModel | UpdatePlanResponse]: - """Update plan - - Args: - body (UpdatePlanParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | UpdatePlanResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: UpdatePlanParams, -) -> ErrorModel | UpdatePlanResponse | None: - """Update plan - - Args: - body (UpdatePlanParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | UpdatePlanResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: UpdatePlanParams, -) -> Response[ErrorModel | UpdatePlanResponse]: - """Update plan - - Args: - body (UpdatePlanParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | UpdatePlanResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: UpdatePlanParams, -) -> ErrorModel | UpdatePlanResponse | None: - """Update plan - - Args: - body (UpdatePlanParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | UpdatePlanResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/update_schedule.py b/src/tower/tower_api_client/api/default/update_schedule.py deleted file mode 100644 index 33a68f47..00000000 --- a/src/tower/tower_api_client/api/default/update_schedule.py +++ /dev/null @@ -1,183 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.update_schedule_params import UpdateScheduleParams -from ...models.update_schedule_response import UpdateScheduleResponse -from ...types import Response - - -def _get_kwargs( - id_or_name: str, - *, - body: UpdateScheduleParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "put", - "url": "/schedules/{id_or_name}".format( - id_or_name=quote(str(id_or_name), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | UpdateScheduleResponse: - if response.status_code == 200: - response_200 = UpdateScheduleResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | UpdateScheduleResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - id_or_name: str, - *, - client: AuthenticatedClient, - body: UpdateScheduleParams, -) -> Response[ErrorModel | UpdateScheduleResponse]: - """Update schedule - - Update an existing schedule for an app. - - Args: - id_or_name (str): The ID or name of the schedule to update. - body (UpdateScheduleParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | UpdateScheduleResponse] - """ - - kwargs = _get_kwargs( - id_or_name=id_or_name, - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - id_or_name: str, - *, - client: AuthenticatedClient, - body: UpdateScheduleParams, -) -> ErrorModel | UpdateScheduleResponse | None: - """Update schedule - - Update an existing schedule for an app. - - Args: - id_or_name (str): The ID or name of the schedule to update. - body (UpdateScheduleParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | UpdateScheduleResponse - """ - - return sync_detailed( - id_or_name=id_or_name, - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - id_or_name: str, - *, - client: AuthenticatedClient, - body: UpdateScheduleParams, -) -> Response[ErrorModel | UpdateScheduleResponse]: - """Update schedule - - Update an existing schedule for an app. - - Args: - id_or_name (str): The ID or name of the schedule to update. - body (UpdateScheduleParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | UpdateScheduleResponse] - """ - - kwargs = _get_kwargs( - id_or_name=id_or_name, - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - id_or_name: str, - *, - client: AuthenticatedClient, - body: UpdateScheduleParams, -) -> ErrorModel | UpdateScheduleResponse | None: - """Update schedule - - Update an existing schedule for an app. - - Args: - id_or_name (str): The ID or name of the schedule to update. - body (UpdateScheduleParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | UpdateScheduleResponse - """ - - return ( - await asyncio_detailed( - id_or_name=id_or_name, - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/update_secret.py b/src/tower/tower_api_client/api/default/update_secret.py deleted file mode 100644 index af711f95..00000000 --- a/src/tower/tower_api_client/api/default/update_secret.py +++ /dev/null @@ -1,183 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.update_secret_params import UpdateSecretParams -from ...models.update_secret_response import UpdateSecretResponse -from ...types import Response - - -def _get_kwargs( - name: str, - *, - body: UpdateSecretParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "put", - "url": "/secrets/{name}".format( - name=quote(str(name), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | UpdateSecretResponse: - if response.status_code == 200: - response_200 = UpdateSecretResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | UpdateSecretResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, - body: UpdateSecretParams, -) -> Response[ErrorModel | UpdateSecretResponse]: - """Update secret - - Updates a secret that has previously been created in your account - - Args: - name (str): - body (UpdateSecretParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | UpdateSecretResponse] - """ - - kwargs = _get_kwargs( - name=name, - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, - body: UpdateSecretParams, -) -> ErrorModel | UpdateSecretResponse | None: - """Update secret - - Updates a secret that has previously been created in your account - - Args: - name (str): - body (UpdateSecretParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | UpdateSecretResponse - """ - - return sync_detailed( - name=name, - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, - body: UpdateSecretParams, -) -> Response[ErrorModel | UpdateSecretResponse]: - """Update secret - - Updates a secret that has previously been created in your account - - Args: - name (str): - body (UpdateSecretParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | UpdateSecretResponse] - """ - - kwargs = _get_kwargs( - name=name, - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, - body: UpdateSecretParams, -) -> ErrorModel | UpdateSecretResponse | None: - """Update secret - - Updates a secret that has previously been created in your account - - Args: - name (str): - body (UpdateSecretParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | UpdateSecretResponse - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/update_team.py b/src/tower/tower_api_client/api/default/update_team.py deleted file mode 100644 index 89a10a6e..00000000 --- a/src/tower/tower_api_client/api/default/update_team.py +++ /dev/null @@ -1,187 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.update_team_params import UpdateTeamParams -from ...models.update_team_response import UpdateTeamResponse -from ...types import Response - - -def _get_kwargs( - name: str, - *, - body: UpdateTeamParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "put", - "url": "/teams/{name}".format( - name=quote(str(name), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | UpdateTeamResponse: - if response.status_code == 200: - response_200 = UpdateTeamResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | UpdateTeamResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, - body: UpdateTeamParams, -) -> Response[ErrorModel | UpdateTeamResponse]: - """Update team - - Update a team with a new name or name. Note that updating the team with a new name will cause all - your URLs to change! - - Args: - name (str): The name of the team to update - body (UpdateTeamParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | UpdateTeamResponse] - """ - - kwargs = _get_kwargs( - name=name, - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, - body: UpdateTeamParams, -) -> ErrorModel | UpdateTeamResponse | None: - """Update team - - Update a team with a new name or name. Note that updating the team with a new name will cause all - your URLs to change! - - Args: - name (str): The name of the team to update - body (UpdateTeamParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | UpdateTeamResponse - """ - - return sync_detailed( - name=name, - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, - body: UpdateTeamParams, -) -> Response[ErrorModel | UpdateTeamResponse]: - """Update team - - Update a team with a new name or name. Note that updating the team with a new name will cause all - your URLs to change! - - Args: - name (str): The name of the team to update - body (UpdateTeamParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | UpdateTeamResponse] - """ - - kwargs = _get_kwargs( - name=name, - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, - body: UpdateTeamParams, -) -> ErrorModel | UpdateTeamResponse | None: - """Update team - - Update a team with a new name or name. Note that updating the team with a new name will cause all - your URLs to change! - - Args: - name (str): The name of the team to update - body (UpdateTeamParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | UpdateTeamResponse - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/update_team_member.py b/src/tower/tower_api_client/api/default/update_team_member.py deleted file mode 100644 index cc151a65..00000000 --- a/src/tower/tower_api_client/api/default/update_team_member.py +++ /dev/null @@ -1,175 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.update_team_member_params import UpdateTeamMemberParams -from ...models.update_team_member_response import UpdateTeamMemberResponse -from ...types import Response - - -def _get_kwargs( - name: str, - *, - body: UpdateTeamMemberParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "put", - "url": "/teams/{name}/members".format( - name=quote(str(name), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | UpdateTeamMemberResponse: - if response.status_code == 200: - response_200 = UpdateTeamMemberResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | UpdateTeamMemberResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, - body: UpdateTeamMemberParams, -) -> Response[ErrorModel | UpdateTeamMemberResponse]: - """Update team member - - Args: - name (str): The name of the team - body (UpdateTeamMemberParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | UpdateTeamMemberResponse] - """ - - kwargs = _get_kwargs( - name=name, - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, - body: UpdateTeamMemberParams, -) -> ErrorModel | UpdateTeamMemberResponse | None: - """Update team member - - Args: - name (str): The name of the team - body (UpdateTeamMemberParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | UpdateTeamMemberResponse - """ - - return sync_detailed( - name=name, - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, - body: UpdateTeamMemberParams, -) -> Response[ErrorModel | UpdateTeamMemberResponse]: - """Update team member - - Args: - name (str): The name of the team - body (UpdateTeamMemberParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | UpdateTeamMemberResponse] - """ - - kwargs = _get_kwargs( - name=name, - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, - body: UpdateTeamMemberParams, -) -> ErrorModel | UpdateTeamMemberResponse | None: - """Update team member - - Args: - name (str): The name of the team - body (UpdateTeamMemberParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | UpdateTeamMemberResponse - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/update_user.py b/src/tower/tower_api_client/api/default/update_user.py deleted file mode 100644 index 26298fe3..00000000 --- a/src/tower/tower_api_client/api/default/update_user.py +++ /dev/null @@ -1,167 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.update_user_params import UpdateUserParams -from ...models.update_user_response import UpdateUserResponse -from ...types import Response - - -def _get_kwargs( - *, - body: UpdateUserParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "put", - "url": "/user", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | UpdateUserResponse: - if response.status_code == 200: - response_200 = UpdateUserResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | UpdateUserResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: UpdateUserParams, -) -> Response[ErrorModel | UpdateUserResponse]: - """Update user profile - - Updates your current user profile. - - Args: - body (UpdateUserParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | UpdateUserResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: UpdateUserParams, -) -> ErrorModel | UpdateUserResponse | None: - """Update user profile - - Updates your current user profile. - - Args: - body (UpdateUserParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | UpdateUserResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: UpdateUserParams, -) -> Response[ErrorModel | UpdateUserResponse]: - """Update user profile - - Updates your current user profile. - - Args: - body (UpdateUserParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | UpdateUserResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: UpdateUserParams, -) -> ErrorModel | UpdateUserResponse | None: - """Update user profile - - Updates your current user profile. - - Args: - body (UpdateUserParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | UpdateUserResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/update_webhook.py b/src/tower/tower_api_client/api/default/update_webhook.py deleted file mode 100644 index 7ee5b4c5..00000000 --- a/src/tower/tower_api_client/api/default/update_webhook.py +++ /dev/null @@ -1,187 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.update_webhook_params import UpdateWebhookParams -from ...models.update_webhook_response import UpdateWebhookResponse -from ...types import Response - - -def _get_kwargs( - name: str, - *, - body: UpdateWebhookParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "put", - "url": "/webhooks/{name}".format( - name=quote(str(name), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | UpdateWebhookResponse: - if response.status_code == 200: - response_200 = UpdateWebhookResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | UpdateWebhookResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - name: str, - *, - client: AuthenticatedClient, - body: UpdateWebhookParams, -) -> Response[ErrorModel | UpdateWebhookResponse]: - """Update webhook - - Updates webhook. Note: it is not possible to update the URL. To do so, you should delete and - recreate the webhook instead. - - Args: - name (str): The name of the webhook. - body (UpdateWebhookParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | UpdateWebhookResponse] - """ - - kwargs = _get_kwargs( - name=name, - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - name: str, - *, - client: AuthenticatedClient, - body: UpdateWebhookParams, -) -> ErrorModel | UpdateWebhookResponse | None: - """Update webhook - - Updates webhook. Note: it is not possible to update the URL. To do so, you should delete and - recreate the webhook instead. - - Args: - name (str): The name of the webhook. - body (UpdateWebhookParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | UpdateWebhookResponse - """ - - return sync_detailed( - name=name, - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - name: str, - *, - client: AuthenticatedClient, - body: UpdateWebhookParams, -) -> Response[ErrorModel | UpdateWebhookResponse]: - """Update webhook - - Updates webhook. Note: it is not possible to update the URL. To do so, you should delete and - recreate the webhook instead. - - Args: - name (str): The name of the webhook. - body (UpdateWebhookParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | UpdateWebhookResponse] - """ - - kwargs = _get_kwargs( - name=name, - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - name: str, - *, - client: AuthenticatedClient, - body: UpdateWebhookParams, -) -> ErrorModel | UpdateWebhookResponse | None: - """Update webhook - - Updates webhook. Note: it is not possible to update the URL. To do so, you should delete and - recreate the webhook instead. - - Args: - name (str): The name of the webhook. - body (UpdateWebhookParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | UpdateWebhookResponse - """ - - return ( - await asyncio_detailed( - name=name, - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/default/verify_email.py b/src/tower/tower_api_client/api/default/verify_email.py deleted file mode 100644 index 7a797a8e..00000000 --- a/src/tower/tower_api_client/api/default/verify_email.py +++ /dev/null @@ -1,171 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.verify_email_params import VerifyEmailParams -from ...models.verify_email_response import VerifyEmailResponse -from ...types import Response - - -def _get_kwargs( - *, - body: VerifyEmailParams, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/user/verify", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | VerifyEmailResponse: - if response.status_code == 200: - response_200 = VerifyEmailResponse.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | VerifyEmailResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: VerifyEmailParams, -) -> Response[ErrorModel | VerifyEmailResponse]: - """Verify email - - If the user hasn't verified their email address, this API endpoint allows them to send a - confirmation token they received via email to indeed verify they can receive emails. - - Args: - body (VerifyEmailParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | VerifyEmailResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: VerifyEmailParams, -) -> ErrorModel | VerifyEmailResponse | None: - """Verify email - - If the user hasn't verified their email address, this API endpoint allows them to send a - confirmation token they received via email to indeed verify they can receive emails. - - Args: - body (VerifyEmailParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | VerifyEmailResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: VerifyEmailParams, -) -> Response[ErrorModel | VerifyEmailResponse]: - """Verify email - - If the user hasn't verified their email address, this API endpoint allows them to send a - confirmation token they received via email to indeed verify they can receive emails. - - Args: - body (VerifyEmailParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | VerifyEmailResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: VerifyEmailParams, -) -> ErrorModel | VerifyEmailResponse | None: - """Verify email - - If the user hasn't verified their email address, this API endpoint allows them to send a - confirmation token they received via email to indeed verify they can receive emails. - - Args: - body (VerifyEmailParams): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | VerifyEmailResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/tower/tower_api_client/api/feature_flags/__init__.py b/src/tower/tower_api_client/api/feature_flags/__init__.py deleted file mode 100644 index 2d7c0b23..00000000 --- a/src/tower/tower_api_client/api/feature_flags/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/src/tower/tower_api_client/api/feature_flags/get_feature_flag_value.py b/src/tower/tower_api_client/api/feature_flags/get_feature_flag_value.py deleted file mode 100644 index dd1cdc1f..00000000 --- a/src/tower/tower_api_client/api/feature_flags/get_feature_flag_value.py +++ /dev/null @@ -1,165 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...models.error_model import ErrorModel -from ...models.get_feature_flag_response_body import GetFeatureFlagResponseBody -from ...types import Response - - -def _get_kwargs( - key: str, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/feature-flags/{key}".format( - key=quote(str(key), safe=""), - ), - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorModel | GetFeatureFlagResponseBody: - if response.status_code == 200: - response_200 = GetFeatureFlagResponseBody.from_dict(response.json()) - - return response_200 - - response_default = ErrorModel.from_dict(response.json()) - - return response_default - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorModel | GetFeatureFlagResponseBody]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - key: str, - *, - client: AuthenticatedClient | Client, -) -> Response[ErrorModel | GetFeatureFlagResponseBody]: - """Get feature flag value - - Get the current value of a feature flag. Returns the flag value if enabled, or a default falsey - value if disabled. - - Args: - key (str): The feature flag key Example: schedules-enabled. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | GetFeatureFlagResponseBody] - """ - - kwargs = _get_kwargs( - key=key, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - key: str, - *, - client: AuthenticatedClient | Client, -) -> ErrorModel | GetFeatureFlagResponseBody | None: - """Get feature flag value - - Get the current value of a feature flag. Returns the flag value if enabled, or a default falsey - value if disabled. - - Args: - key (str): The feature flag key Example: schedules-enabled. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | GetFeatureFlagResponseBody - """ - - return sync_detailed( - key=key, - client=client, - ).parsed - - -async def asyncio_detailed( - key: str, - *, - client: AuthenticatedClient | Client, -) -> Response[ErrorModel | GetFeatureFlagResponseBody]: - """Get feature flag value - - Get the current value of a feature flag. Returns the flag value if enabled, or a default falsey - value if disabled. - - Args: - key (str): The feature flag key Example: schedules-enabled. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ErrorModel | GetFeatureFlagResponseBody] - """ - - kwargs = _get_kwargs( - key=key, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - key: str, - *, - client: AuthenticatedClient | Client, -) -> ErrorModel | GetFeatureFlagResponseBody | None: - """Get feature flag value - - Get the current value of a feature flag. Returns the flag value if enabled, or a default falsey - value if disabled. - - Args: - key (str): The feature flag key Example: schedules-enabled. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ErrorModel | GetFeatureFlagResponseBody - """ - - return ( - await asyncio_detailed( - key=key, - client=client, - ) - ).parsed diff --git a/src/tower/tower_api_client/client.py b/src/tower/tower_api_client/client.py deleted file mode 100644 index 0ab15895..00000000 --- a/src/tower/tower_api_client/client.py +++ /dev/null @@ -1,282 +0,0 @@ -import ssl -from typing import Any - -import httpx -from attrs import define, evolve, field - - -@define -class Client: - """A class for keeping track of data related to the API - - The following are accepted as keyword arguments and will be used to construct httpx Clients internally: - - ``base_url``: The base URL for the API, all requests are made to a relative path to this URL - - ``cookies``: A dictionary of cookies to be sent with every request - - ``headers``: A dictionary of headers to be sent with every request - - ``timeout``: The maximum amount of a time a request can take. API functions will raise - httpx.TimeoutException if this is exceeded. - - ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, - but can be set to False for testing purposes. - - ``follow_redirects``: Whether or not to follow redirects. Default value is False. - - ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. - - - Attributes: - raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a - status code that was not documented in the source OpenAPI document. Can also be provided as a keyword - argument to the constructor. - """ - - raise_on_unexpected_status: bool = field(default=False, kw_only=True) - _base_url: str = field(alias="base_url") - _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") - _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") - _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") - _verify_ssl: str | bool | ssl.SSLContext = field( - default=True, kw_only=True, alias="verify_ssl" - ) - _follow_redirects: bool = field( - default=False, kw_only=True, alias="follow_redirects" - ) - _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") - _client: httpx.Client | None = field(default=None, init=False) - _async_client: httpx.AsyncClient | None = field(default=None, init=False) - - def with_headers(self, headers: dict[str, str]) -> "Client": - """Get a new client matching this one with additional headers""" - if self._client is not None: - self._client.headers.update(headers) - if self._async_client is not None: - self._async_client.headers.update(headers) - return evolve(self, headers={**self._headers, **headers}) - - def with_cookies(self, cookies: dict[str, str]) -> "Client": - """Get a new client matching this one with additional cookies""" - if self._client is not None: - self._client.cookies.update(cookies) - if self._async_client is not None: - self._async_client.cookies.update(cookies) - return evolve(self, cookies={**self._cookies, **cookies}) - - def with_timeout(self, timeout: httpx.Timeout) -> "Client": - """Get a new client matching this one with a new timeout configuration""" - if self._client is not None: - self._client.timeout = timeout - if self._async_client is not None: - self._async_client.timeout = timeout - return evolve(self, timeout=timeout) - - def set_httpx_client(self, client: httpx.Client) -> "Client": - """Manually set the underlying httpx.Client - - **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. - """ - self._client = client - return self - - def get_httpx_client(self) -> httpx.Client: - """Get the underlying httpx.Client, constructing a new one if not previously set""" - if self._client is None: - self._client = httpx.Client( - base_url=self._base_url, - cookies=self._cookies, - headers=self._headers, - timeout=self._timeout, - verify=self._verify_ssl, - follow_redirects=self._follow_redirects, - **self._httpx_args, - ) - return self._client - - def __enter__(self) -> "Client": - """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" - self.get_httpx_client().__enter__() - return self - - def __exit__(self, *args: Any, **kwargs: Any) -> None: - """Exit a context manager for internal httpx.Client (see httpx docs)""" - self.get_httpx_client().__exit__(*args, **kwargs) - - def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Client": - """Manually set the underlying httpx.AsyncClient - - **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. - """ - self._async_client = async_client - return self - - def get_async_httpx_client(self) -> httpx.AsyncClient: - """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" - if self._async_client is None: - self._async_client = httpx.AsyncClient( - base_url=self._base_url, - cookies=self._cookies, - headers=self._headers, - timeout=self._timeout, - verify=self._verify_ssl, - follow_redirects=self._follow_redirects, - **self._httpx_args, - ) - return self._async_client - - async def __aenter__(self) -> "Client": - """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" - await self.get_async_httpx_client().__aenter__() - return self - - async def __aexit__(self, *args: Any, **kwargs: Any) -> None: - """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" - await self.get_async_httpx_client().__aexit__(*args, **kwargs) - - -@define -class AuthenticatedClient: - """A Client which has been authenticated for use on secured endpoints - - The following are accepted as keyword arguments and will be used to construct httpx Clients internally: - - ``base_url``: The base URL for the API, all requests are made to a relative path to this URL - - ``cookies``: A dictionary of cookies to be sent with every request - - ``headers``: A dictionary of headers to be sent with every request - - ``timeout``: The maximum amount of a time a request can take. API functions will raise - httpx.TimeoutException if this is exceeded. - - ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, - but can be set to False for testing purposes. - - ``follow_redirects``: Whether or not to follow redirects. Default value is False. - - ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. - - - Attributes: - raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a - status code that was not documented in the source OpenAPI document. Can also be provided as a keyword - argument to the constructor. - token: The token to use for authentication - prefix: The prefix to use for the Authorization header - auth_header_name: The name of the Authorization header - """ - - raise_on_unexpected_status: bool = field(default=False, kw_only=True) - _base_url: str = field(alias="base_url") - _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") - _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") - _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") - _verify_ssl: str | bool | ssl.SSLContext = field( - default=True, kw_only=True, alias="verify_ssl" - ) - _follow_redirects: bool = field( - default=False, kw_only=True, alias="follow_redirects" - ) - _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") - _client: httpx.Client | None = field(default=None, init=False) - _async_client: httpx.AsyncClient | None = field(default=None, init=False) - - token: str - prefix: str = "Bearer" - auth_header_name: str = "Authorization" - - def with_headers(self, headers: dict[str, str]) -> "AuthenticatedClient": - """Get a new client matching this one with additional headers""" - if self._client is not None: - self._client.headers.update(headers) - if self._async_client is not None: - self._async_client.headers.update(headers) - return evolve(self, headers={**self._headers, **headers}) - - def with_cookies(self, cookies: dict[str, str]) -> "AuthenticatedClient": - """Get a new client matching this one with additional cookies""" - if self._client is not None: - self._client.cookies.update(cookies) - if self._async_client is not None: - self._async_client.cookies.update(cookies) - return evolve(self, cookies={**self._cookies, **cookies}) - - def with_timeout(self, timeout: httpx.Timeout) -> "AuthenticatedClient": - """Get a new client matching this one with a new timeout configuration""" - if self._client is not None: - self._client.timeout = timeout - if self._async_client is not None: - self._async_client.timeout = timeout - return evolve(self, timeout=timeout) - - def set_httpx_client(self, client: httpx.Client) -> "AuthenticatedClient": - """Manually set the underlying httpx.Client - - **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. - """ - self._client = client - return self - - def get_httpx_client(self) -> httpx.Client: - """Get the underlying httpx.Client, constructing a new one if not previously set""" - if self._client is None: - self._headers[self.auth_header_name] = ( - f"{self.prefix} {self.token}" if self.prefix else self.token - ) - self._client = httpx.Client( - base_url=self._base_url, - cookies=self._cookies, - headers=self._headers, - timeout=self._timeout, - verify=self._verify_ssl, - follow_redirects=self._follow_redirects, - **self._httpx_args, - ) - return self._client - - def __enter__(self) -> "AuthenticatedClient": - """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" - self.get_httpx_client().__enter__() - return self - - def __exit__(self, *args: Any, **kwargs: Any) -> None: - """Exit a context manager for internal httpx.Client (see httpx docs)""" - self.get_httpx_client().__exit__(*args, **kwargs) - - def set_async_httpx_client( - self, async_client: httpx.AsyncClient - ) -> "AuthenticatedClient": - """Manually set the underlying httpx.AsyncClient - - **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. - """ - self._async_client = async_client - return self - - def get_async_httpx_client(self) -> httpx.AsyncClient: - """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" - if self._async_client is None: - self._headers[self.auth_header_name] = ( - f"{self.prefix} {self.token}" if self.prefix else self.token - ) - self._async_client = httpx.AsyncClient( - base_url=self._base_url, - cookies=self._cookies, - headers=self._headers, - timeout=self._timeout, - verify=self._verify_ssl, - follow_redirects=self._follow_redirects, - **self._httpx_args, - ) - return self._async_client - - async def __aenter__(self) -> "AuthenticatedClient": - """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" - await self.get_async_httpx_client().__aenter__() - return self - - async def __aexit__(self, *args: Any, **kwargs: Any) -> None: - """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" - await self.get_async_httpx_client().__aexit__(*args, **kwargs) diff --git a/src/tower/tower_api_client/errors.py b/src/tower/tower_api_client/errors.py deleted file mode 100644 index 5f92e76a..00000000 --- a/src/tower/tower_api_client/errors.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Contains shared errors types that can be raised from API functions""" - - -class UnexpectedStatus(Exception): - """Raised by api functions when the response status an undocumented status and Client.raise_on_unexpected_status is True""" - - def __init__(self, status_code: int, content: bytes): - self.status_code = status_code - self.content = content - - super().__init__( - f"Unexpected status code: {status_code}\n\nResponse content:\n{content.decode(errors='ignore')}" - ) - - -__all__ = ["UnexpectedStatus"] diff --git a/src/tower/tower_api_client/models/__init__.py b/src/tower/tower_api_client/models/__init__.py deleted file mode 100644 index ae9cfab0..00000000 --- a/src/tower/tower_api_client/models/__init__.py +++ /dev/null @@ -1,483 +0,0 @@ -"""Contains all the data models used in inputs/outputs""" - -from .account import Account -from .acknowledge_alert_response import AcknowledgeAlertResponse -from .acknowledge_all_alerts_response import AcknowledgeAllAlertsResponse -from .alert import Alert -from .api_key import APIKey -from .app import App -from .app_health_status import AppHealthStatus -from .app_statistics import AppStatistics -from .app_status import AppStatus -from .app_summary import AppSummary -from .app_version import AppVersion -from .authentication_context import AuthenticationContext -from .batch_schedule_params import BatchScheduleParams -from .batch_schedule_response import BatchScheduleResponse -from .cancel_run_response import CancelRunResponse -from .catalog import Catalog -from .catalog_property import CatalogProperty -from .claim_device_login_ticket_params import ClaimDeviceLoginTicketParams -from .claim_device_login_ticket_response import ClaimDeviceLoginTicketResponse -from .create_account_params import CreateAccountParams -from .create_account_params_flags_struct import CreateAccountParamsFlagsStruct -from .create_account_response import CreateAccountResponse -from .create_api_key_params import CreateAPIKeyParams -from .create_api_key_response import CreateAPIKeyResponse -from .create_app_params import CreateAppParams -from .create_app_response import CreateAppResponse -from .create_authenticator_params import CreateAuthenticatorParams -from .create_authenticator_response import CreateAuthenticatorResponse -from .create_catalog_params import CreateCatalogParams -from .create_catalog_params_type import CreateCatalogParamsType -from .create_catalog_response import CreateCatalogResponse -from .create_device_login_ticket_response import CreateDeviceLoginTicketResponse -from .create_environment_params import CreateEnvironmentParams -from .create_environment_response import CreateEnvironmentResponse -from .create_guest_params import CreateGuestParams -from .create_guest_response import CreateGuestResponse -from .create_password_reset_params import CreatePasswordResetParams -from .create_password_reset_response import CreatePasswordResetResponse -from .create_sandbox_secrets_params import CreateSandboxSecretsParams -from .create_sandbox_secrets_response import CreateSandboxSecretsResponse -from .create_schedule_params import CreateScheduleParams -from .create_schedule_params_overlap_policy import CreateScheduleParamsOverlapPolicy -from .create_schedule_params_status import CreateScheduleParamsStatus -from .create_schedule_response import CreateScheduleResponse -from .create_secret_params import CreateSecretParams -from .create_secret_response import CreateSecretResponse -from .create_session_params import CreateSessionParams -from .create_session_response import CreateSessionResponse -from .create_team_params import CreateTeamParams -from .create_team_response import CreateTeamResponse -from .create_webhook_params import CreateWebhookParams -from .create_webhook_response import CreateWebhookResponse -from .delete_api_key_params import DeleteAPIKeyParams -from .delete_api_key_response import DeleteAPIKeyResponse -from .delete_app_response import DeleteAppResponse -from .delete_authenticator_params import DeleteAuthenticatorParams -from .delete_authenticator_response import DeleteAuthenticatorResponse -from .delete_catalog_response import DeleteCatalogResponse -from .delete_guest_output_body import DeleteGuestOutputBody -from .delete_schedule_params import DeleteScheduleParams -from .delete_schedule_response import DeleteScheduleResponse -from .delete_secret_response import DeleteSecretResponse -from .delete_session_params import DeleteSessionParams -from .delete_session_response import DeleteSessionResponse -from .delete_team_invitation_params import DeleteTeamInvitationParams -from .delete_team_invitation_response import DeleteTeamInvitationResponse -from .delete_team_params import DeleteTeamParams -from .delete_team_response import DeleteTeamResponse -from .delete_webhook_response import DeleteWebhookResponse -from .deploy_app_json_body import DeployAppJsonBody -from .deploy_app_response import DeployAppResponse -from .describe_account_body import DescribeAccountBody -from .describe_app_response import DescribeAppResponse -from .describe_app_version_response import DescribeAppVersionResponse -from .describe_authentication_context_body import DescribeAuthenticationContextBody -from .describe_catalog_response import DescribeCatalogResponse -from .describe_device_login_session_response import DescribeDeviceLoginSessionResponse -from .describe_email_preferences_body import DescribeEmailPreferencesBody -from .describe_plan_response import DescribePlanResponse -from .describe_run_graph_response import DescribeRunGraphResponse -from .describe_run_links import DescribeRunLinks -from .describe_run_logs_response import DescribeRunLogsResponse -from .describe_run_response import DescribeRunResponse -from .describe_secrets_key_response import DescribeSecretsKeyResponse -from .describe_session_response import DescribeSessionResponse -from .describe_team_response import DescribeTeamResponse -from .describe_webhook_response import DescribeWebhookResponse -from .email_subscriptions import EmailSubscriptions -from .encrypted_catalog_property import EncryptedCatalogProperty -from .environment import Environment -from .error_detail import ErrorDetail -from .error_model import ErrorModel -from .export_catalogs_params import ExportCatalogsParams -from .export_catalogs_response import ExportCatalogsResponse -from .export_secrets_params import ExportSecretsParams -from .export_secrets_response import ExportSecretsResponse -from .exported_catalog import ExportedCatalog -from .exported_catalog_property import ExportedCatalogProperty -from .exported_secret import ExportedSecret -from .feature import Feature -from .featurebase_identity import FeaturebaseIdentity -from .generate_app_statistics_response import GenerateAppStatisticsResponse -from .generate_authenticator_response import GenerateAuthenticatorResponse -from .generate_run_statistics_response import GenerateRunStatisticsResponse -from .generate_run_statistics_status_item import GenerateRunStatisticsStatusItem -from .generate_runner_credentials_response import GenerateRunnerCredentialsResponse -from .get_feature_flag_response_body import GetFeatureFlagResponseBody -from .get_feature_flag_response_body_value_type import ( - GetFeatureFlagResponseBodyValueType, -) -from .guest import Guest -from .invite_team_member_params import InviteTeamMemberParams -from .invite_team_member_params_role import InviteTeamMemberParamsRole -from .invite_team_member_response import InviteTeamMemberResponse -from .leave_team_response import LeaveTeamResponse -from .list_alerts_response import ListAlertsResponse -from .list_api_keys_response import ListAPIKeysResponse -from .list_app_environments_response import ListAppEnvironmentsResponse -from .list_app_versions_response import ListAppVersionsResponse -from .list_apps_filter import ListAppsFilter -from .list_apps_response import ListAppsResponse -from .list_apps_sort import ListAppsSort -from .list_authenticators_response import ListAuthenticatorsResponse -from .list_catalogs_response import ListCatalogsResponse -from .list_environments_response import ListEnvironmentsResponse -from .list_guests_response import ListGuestsResponse -from .list_my_team_invitations_response import ListMyTeamInvitationsResponse -from .list_runners_response import ListRunnersResponse -from .list_runs_response import ListRunsResponse -from .list_runs_status_item import ListRunsStatusItem -from .list_schedules_response import ListSchedulesResponse -from .list_secret_environments_response import ListSecretEnvironmentsResponse -from .list_secrets_response import ListSecretsResponse -from .list_team_invitations_response import ListTeamInvitationsResponse -from .list_team_members_response import ListTeamMembersResponse -from .list_teams_response import ListTeamsResponse -from .list_webhooks_response import ListWebhooksResponse -from .organization import Organization -from .organization_usage import OrganizationUsage -from .pagination import Pagination -from .parameter import Parameter -from .plan import Plan -from .refresh_session_params import RefreshSessionParams -from .refresh_session_response import RefreshSessionResponse -from .regenerate_guest_login_url_params import RegenerateGuestLoginURLParams -from .regenerate_guest_login_url_response import RegenerateGuestLoginURLResponse -from .remove_team_member_params import RemoveTeamMemberParams -from .remove_team_member_response import RemoveTeamMemberResponse -from .resend_team_invitation_params import ResendTeamInvitationParams -from .resend_team_invitation_response import ResendTeamInvitationResponse -from .run import Run -from .run_app_initiator_data import RunAppInitiatorData -from .run_app_initiator_data_type import RunAppInitiatorDataType -from .run_app_params import RunAppParams -from .run_app_params_parameters import RunAppParamsParameters -from .run_app_response import RunAppResponse -from .run_attempt import RunAttempt -from .run_failure_alert import RunFailureAlert -from .run_graph_node import RunGraphNode -from .run_graph_run_id import RunGraphRunID -from .run_initiator import RunInitiator -from .run_log_line import RunLogLine -from .run_log_line_channel import RunLogLineChannel -from .run_parameter import RunParameter -from .run_results import RunResults -from .run_retry_policy import RunRetryPolicy -from .run_run_initiator_details import RunRunInitiatorDetails -from .run_statistics import RunStatistics -from .run_status import RunStatus -from .run_status_group import RunStatusGroup -from .run_timeseries_point import RunTimeseriesPoint -from .runner import Runner -from .runner_credentials import RunnerCredentials -from .schedule import Schedule -from .schedule_app_status import ScheduleAppStatus -from .schedule_overlap_policy import ScheduleOverlapPolicy -from .schedule_run_initiator_details import ScheduleRunInitiatorDetails -from .schedule_status import ScheduleStatus -from .search_runs_response import SearchRunsResponse -from .search_runs_status_item import SearchRunsStatusItem -from .secret import Secret -from .session import Session -from .shoulder_tap import ShoulderTap -from .sse_warning import SSEWarning -from .statistics_settings import StatisticsSettings -from .statistics_settings_interval import StatisticsSettingsInterval -from .stream_alerts_event_alert import StreamAlertsEventAlert -from .stream_alerts_event_error import StreamAlertsEventError -from .stream_run_logs_event_log import StreamRunLogsEventLog -from .stream_run_logs_event_warning import StreamRunLogsEventWarning -from .stream_shouldertaps_event_shouldertap import StreamShouldertapsEventShouldertap -from .stream_shouldertaps_event_warning import StreamShouldertapsEventWarning -from .team import Team -from .team_invitation import TeamInvitation -from .team_membership import TeamMembership -from .team_membership_role import TeamMembershipRole -from .test_webhook_response import TestWebhookResponse -from .token import Token -from .unverified_authenticator import UnverifiedAuthenticator -from .update_account_params import UpdateAccountParams -from .update_account_params_execution_region import UpdateAccountParamsExecutionRegion -from .update_account_response import UpdateAccountResponse -from .update_app_params import UpdateAppParams -from .update_app_response import UpdateAppResponse -from .update_catalog_params import UpdateCatalogParams -from .update_catalog_response import UpdateCatalogResponse -from .update_email_preferences_body import UpdateEmailPreferencesBody -from .update_environment_params import UpdateEnvironmentParams -from .update_environment_response import UpdateEnvironmentResponse -from .update_my_team_invitation_params import UpdateMyTeamInvitationParams -from .update_my_team_invitation_response import UpdateMyTeamInvitationResponse -from .update_organization_params import UpdateOrganizationParams -from .update_organization_response import UpdateOrganizationResponse -from .update_password_reset_params import UpdatePasswordResetParams -from .update_password_reset_response import UpdatePasswordResetResponse -from .update_plan_params import UpdatePlanParams -from .update_plan_response import UpdatePlanResponse -from .update_schedule_params import UpdateScheduleParams -from .update_schedule_params_overlap_policy import UpdateScheduleParamsOverlapPolicy -from .update_schedule_params_status import UpdateScheduleParamsStatus -from .update_schedule_response import UpdateScheduleResponse -from .update_secret_params import UpdateSecretParams -from .update_secret_response import UpdateSecretResponse -from .update_team_member_params import UpdateTeamMemberParams -from .update_team_member_params_role import UpdateTeamMemberParamsRole -from .update_team_member_response import UpdateTeamMemberResponse -from .update_team_params import UpdateTeamParams -from .update_team_params_execution_region import UpdateTeamParamsExecutionRegion -from .update_team_response import UpdateTeamResponse -from .update_user_params import UpdateUserParams -from .update_user_response import UpdateUserResponse -from .update_webhook_params import UpdateWebhookParams -from .update_webhook_response import UpdateWebhookResponse -from .usage_limit import UsageLimit -from .user import User -from .verified_authenticator import VerifiedAuthenticator -from .verify_email_params import VerifyEmailParams -from .verify_email_response import VerifyEmailResponse -from .webhook import Webhook -from .webhook_state import WebhookState - -__all__ = ( - "Account", - "AcknowledgeAlertResponse", - "AcknowledgeAllAlertsResponse", - "Alert", - "APIKey", - "App", - "AppHealthStatus", - "AppStatistics", - "AppStatus", - "AppSummary", - "AppVersion", - "AuthenticationContext", - "BatchScheduleParams", - "BatchScheduleResponse", - "CancelRunResponse", - "Catalog", - "CatalogProperty", - "ClaimDeviceLoginTicketParams", - "ClaimDeviceLoginTicketResponse", - "CreateAccountParams", - "CreateAccountParamsFlagsStruct", - "CreateAccountResponse", - "CreateAPIKeyParams", - "CreateAPIKeyResponse", - "CreateAppParams", - "CreateAppResponse", - "CreateAuthenticatorParams", - "CreateAuthenticatorResponse", - "CreateCatalogParams", - "CreateCatalogParamsType", - "CreateCatalogResponse", - "CreateDeviceLoginTicketResponse", - "CreateEnvironmentParams", - "CreateEnvironmentResponse", - "CreateGuestParams", - "CreateGuestResponse", - "CreatePasswordResetParams", - "CreatePasswordResetResponse", - "CreateSandboxSecretsParams", - "CreateSandboxSecretsResponse", - "CreateScheduleParams", - "CreateScheduleParamsOverlapPolicy", - "CreateScheduleParamsStatus", - "CreateScheduleResponse", - "CreateSecretParams", - "CreateSecretResponse", - "CreateSessionParams", - "CreateSessionResponse", - "CreateTeamParams", - "CreateTeamResponse", - "CreateWebhookParams", - "CreateWebhookResponse", - "DeleteAPIKeyParams", - "DeleteAPIKeyResponse", - "DeleteAppResponse", - "DeleteAuthenticatorParams", - "DeleteAuthenticatorResponse", - "DeleteCatalogResponse", - "DeleteGuestOutputBody", - "DeleteScheduleParams", - "DeleteScheduleResponse", - "DeleteSecretResponse", - "DeleteSessionParams", - "DeleteSessionResponse", - "DeleteTeamInvitationParams", - "DeleteTeamInvitationResponse", - "DeleteTeamParams", - "DeleteTeamResponse", - "DeleteWebhookResponse", - "DeployAppJsonBody", - "DeployAppResponse", - "DescribeAccountBody", - "DescribeAppResponse", - "DescribeAppVersionResponse", - "DescribeAuthenticationContextBody", - "DescribeCatalogResponse", - "DescribeDeviceLoginSessionResponse", - "DescribeEmailPreferencesBody", - "DescribePlanResponse", - "DescribeRunGraphResponse", - "DescribeRunLinks", - "DescribeRunLogsResponse", - "DescribeRunResponse", - "DescribeSecretsKeyResponse", - "DescribeSessionResponse", - "DescribeTeamResponse", - "DescribeWebhookResponse", - "EmailSubscriptions", - "EncryptedCatalogProperty", - "Environment", - "ErrorDetail", - "ErrorModel", - "ExportCatalogsParams", - "ExportCatalogsResponse", - "ExportedCatalog", - "ExportedCatalogProperty", - "ExportedSecret", - "ExportSecretsParams", - "ExportSecretsResponse", - "Feature", - "FeaturebaseIdentity", - "GenerateAppStatisticsResponse", - "GenerateAuthenticatorResponse", - "GenerateRunnerCredentialsResponse", - "GenerateRunStatisticsResponse", - "GenerateRunStatisticsStatusItem", - "GetFeatureFlagResponseBody", - "GetFeatureFlagResponseBodyValueType", - "Guest", - "InviteTeamMemberParams", - "InviteTeamMemberParamsRole", - "InviteTeamMemberResponse", - "LeaveTeamResponse", - "ListAlertsResponse", - "ListAPIKeysResponse", - "ListAppEnvironmentsResponse", - "ListAppsFilter", - "ListAppsResponse", - "ListAppsSort", - "ListAppVersionsResponse", - "ListAuthenticatorsResponse", - "ListCatalogsResponse", - "ListEnvironmentsResponse", - "ListGuestsResponse", - "ListMyTeamInvitationsResponse", - "ListRunnersResponse", - "ListRunsResponse", - "ListRunsStatusItem", - "ListSchedulesResponse", - "ListSecretEnvironmentsResponse", - "ListSecretsResponse", - "ListTeamInvitationsResponse", - "ListTeamMembersResponse", - "ListTeamsResponse", - "ListWebhooksResponse", - "Organization", - "OrganizationUsage", - "Pagination", - "Parameter", - "Plan", - "RefreshSessionParams", - "RefreshSessionResponse", - "RegenerateGuestLoginURLParams", - "RegenerateGuestLoginURLResponse", - "RemoveTeamMemberParams", - "RemoveTeamMemberResponse", - "ResendTeamInvitationParams", - "ResendTeamInvitationResponse", - "Run", - "RunAppInitiatorData", - "RunAppInitiatorDataType", - "RunAppParams", - "RunAppParamsParameters", - "RunAppResponse", - "RunAttempt", - "RunFailureAlert", - "RunGraphNode", - "RunGraphRunID", - "RunInitiator", - "RunLogLine", - "RunLogLineChannel", - "Runner", - "RunnerCredentials", - "RunParameter", - "RunResults", - "RunRetryPolicy", - "RunRunInitiatorDetails", - "RunStatistics", - "RunStatus", - "RunStatusGroup", - "RunTimeseriesPoint", - "Schedule", - "ScheduleAppStatus", - "ScheduleOverlapPolicy", - "ScheduleRunInitiatorDetails", - "ScheduleStatus", - "SearchRunsResponse", - "SearchRunsStatusItem", - "Secret", - "Session", - "ShoulderTap", - "SSEWarning", - "StatisticsSettings", - "StatisticsSettingsInterval", - "StreamAlertsEventAlert", - "StreamAlertsEventError", - "StreamRunLogsEventLog", - "StreamRunLogsEventWarning", - "StreamShouldertapsEventShouldertap", - "StreamShouldertapsEventWarning", - "Team", - "TeamInvitation", - "TeamMembership", - "TeamMembershipRole", - "TestWebhookResponse", - "Token", - "UnverifiedAuthenticator", - "UpdateAccountParams", - "UpdateAccountParamsExecutionRegion", - "UpdateAccountResponse", - "UpdateAppParams", - "UpdateAppResponse", - "UpdateCatalogParams", - "UpdateCatalogResponse", - "UpdateEmailPreferencesBody", - "UpdateEnvironmentParams", - "UpdateEnvironmentResponse", - "UpdateMyTeamInvitationParams", - "UpdateMyTeamInvitationResponse", - "UpdateOrganizationParams", - "UpdateOrganizationResponse", - "UpdatePasswordResetParams", - "UpdatePasswordResetResponse", - "UpdatePlanParams", - "UpdatePlanResponse", - "UpdateScheduleParams", - "UpdateScheduleParamsOverlapPolicy", - "UpdateScheduleParamsStatus", - "UpdateScheduleResponse", - "UpdateSecretParams", - "UpdateSecretResponse", - "UpdateTeamMemberParams", - "UpdateTeamMemberParamsRole", - "UpdateTeamMemberResponse", - "UpdateTeamParams", - "UpdateTeamParamsExecutionRegion", - "UpdateTeamResponse", - "UpdateUserParams", - "UpdateUserResponse", - "UpdateWebhookParams", - "UpdateWebhookResponse", - "UsageLimit", - "User", - "VerifiedAuthenticator", - "VerifyEmailParams", - "VerifyEmailResponse", - "Webhook", - "WebhookState", -) diff --git a/src/tower/tower_api_client/models/account.py b/src/tower/tower_api_client/models/account.py deleted file mode 100644 index 19efc05b..00000000 --- a/src/tower/tower_api_client/models/account.py +++ /dev/null @@ -1,69 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="Account") - - -@_attrs_define -class Account: - """ - Attributes: - execution_region (str): - is_self_hosted_only (bool): - name (str): - slug (str | Unset): This property is deprecated. Use name instead. - """ - - execution_region: str - is_self_hosted_only: bool - name: str - slug: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - execution_region = self.execution_region - - is_self_hosted_only = self.is_self_hosted_only - - name = self.name - - slug = self.slug - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "execution_region": execution_region, - "is_self_hosted_only": is_self_hosted_only, - "name": name, - } - ) - if slug is not UNSET: - field_dict["slug"] = slug - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - execution_region = d.pop("execution_region") - - is_self_hosted_only = d.pop("is_self_hosted_only") - - name = d.pop("name") - - slug = d.pop("slug", UNSET) - - account = cls( - execution_region=execution_region, - is_self_hosted_only=is_self_hosted_only, - name=name, - slug=slug, - ) - - return account diff --git a/src/tower/tower_api_client/models/acknowledge_alert_response.py b/src/tower/tower_api_client/models/acknowledge_alert_response.py deleted file mode 100644 index ccd19b83..00000000 --- a/src/tower/tower_api_client/models/acknowledge_alert_response.py +++ /dev/null @@ -1,54 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="AcknowledgeAlertResponse") - - -@_attrs_define -class AcknowledgeAlertResponse: - """ - Attributes: - status (str): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/AcknowledgeAlertResponse.json. - """ - - status: str - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - status = self.status - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "status": status, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - status = d.pop("status") - - schema = d.pop("$schema", UNSET) - - acknowledge_alert_response = cls( - status=status, - schema=schema, - ) - - return acknowledge_alert_response diff --git a/src/tower/tower_api_client/models/acknowledge_all_alerts_response.py b/src/tower/tower_api_client/models/acknowledge_all_alerts_response.py deleted file mode 100644 index 8f336083..00000000 --- a/src/tower/tower_api_client/models/acknowledge_all_alerts_response.py +++ /dev/null @@ -1,62 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="AcknowledgeAllAlertsResponse") - - -@_attrs_define -class AcknowledgeAllAlertsResponse: - """ - Attributes: - count (int): Number of alerts that were acknowledged - status (str): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/AcknowledgeAllAlertsResponse.json. - """ - - count: int - status: str - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - count = self.count - - status = self.status - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "count": count, - "status": status, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - count = d.pop("count") - - status = d.pop("status") - - schema = d.pop("$schema", UNSET) - - acknowledge_all_alerts_response = cls( - count=count, - status=status, - schema=schema, - ) - - return acknowledge_all_alerts_response diff --git a/src/tower/tower_api_client/models/alert.py b/src/tower/tower_api_client/models/alert.py deleted file mode 100644 index 342204ce..00000000 --- a/src/tower/tower_api_client/models/alert.py +++ /dev/null @@ -1,90 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from dateutil.parser import isoparse - -if TYPE_CHECKING: - from ..models.run_failure_alert import RunFailureAlert - - -T = TypeVar("T", bound="Alert") - - -@_attrs_define -class Alert: - """ - Attributes: - acked (bool): - alert_type (str): - created_at (datetime.datetime): - detail (RunFailureAlert): - seq (int): - status (str): - """ - - acked: bool - alert_type: str - created_at: datetime.datetime - detail: RunFailureAlert - seq: int - status: str - - def to_dict(self) -> dict[str, Any]: - acked = self.acked - - alert_type = self.alert_type - - created_at = self.created_at.isoformat() - - detail = self.detail.to_dict() - - seq = self.seq - - status = self.status - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "acked": acked, - "alert_type": alert_type, - "created_at": created_at, - "detail": detail, - "seq": seq, - "status": status, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.run_failure_alert import RunFailureAlert - - d = dict(src_dict) - acked = d.pop("acked") - - alert_type = d.pop("alert_type") - - created_at = isoparse(d.pop("created_at")) - - detail = RunFailureAlert.from_dict(d.pop("detail")) - - seq = d.pop("seq") - - status = d.pop("status") - - alert = cls( - acked=acked, - alert_type=alert_type, - created_at=created_at, - detail=detail, - seq=seq, - status=status, - ) - - return alert diff --git a/src/tower/tower_api_client/models/api_key.py b/src/tower/tower_api_client/models/api_key.py deleted file mode 100644 index cffbde33..00000000 --- a/src/tower/tower_api_client/models/api_key.py +++ /dev/null @@ -1,112 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from dateutil.parser import isoparse - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="APIKey") - - -@_attrs_define -class APIKey: - """ - Attributes: - created_at (datetime.datetime): - identifier (str): - last_used_at (datetime.datetime | None): - name (str): - expires_at (datetime.datetime | Unset): - scopes (str | Unset): - """ - - created_at: datetime.datetime - identifier: str - last_used_at: datetime.datetime | None - name: str - expires_at: datetime.datetime | Unset = UNSET - scopes: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - created_at = self.created_at.isoformat() - - identifier = self.identifier - - last_used_at: None | str - if isinstance(self.last_used_at, datetime.datetime): - last_used_at = self.last_used_at.isoformat() - else: - last_used_at = self.last_used_at - - name = self.name - - expires_at: str | Unset = UNSET - if not isinstance(self.expires_at, Unset): - expires_at = self.expires_at.isoformat() - - scopes = self.scopes - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "created_at": created_at, - "identifier": identifier, - "last_used_at": last_used_at, - "name": name, - } - ) - if expires_at is not UNSET: - field_dict["expires_at"] = expires_at - if scopes is not UNSET: - field_dict["scopes"] = scopes - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - created_at = isoparse(d.pop("created_at")) - - identifier = d.pop("identifier") - - def _parse_last_used_at(data: object) -> datetime.datetime | None: - if data is None: - return data - try: - if not isinstance(data, str): - raise TypeError() - last_used_at_type_0 = isoparse(data) - - return last_used_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(datetime.datetime | None, data) - - last_used_at = _parse_last_used_at(d.pop("last_used_at")) - - name = d.pop("name") - - _expires_at = d.pop("expires_at", UNSET) - expires_at: datetime.datetime | Unset - if isinstance(_expires_at, Unset): - expires_at = UNSET - else: - expires_at = isoparse(_expires_at) - - scopes = d.pop("scopes", UNSET) - - api_key = cls( - created_at=created_at, - identifier=identifier, - last_used_at=last_used_at, - name=name, - expires_at=expires_at, - scopes=scopes, - ) - - return api_key diff --git a/src/tower/tower_api_client/models/app.py b/src/tower/tower_api_client/models/app.py deleted file mode 100644 index 73d7656b..00000000 --- a/src/tower/tower_api_client/models/app.py +++ /dev/null @@ -1,251 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast - -from attrs import define as _attrs_define -from dateutil.parser import isoparse - -from ..models.app_health_status import AppHealthStatus -from ..models.app_status import AppStatus -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.run import Run - from ..models.run_results import RunResults - from ..models.run_retry_policy import RunRetryPolicy - - -T = TypeVar("T", bound="App") - - -@_attrs_define -class App: - """ - Attributes: - created_at (datetime.datetime): The date and time this app was created. - health_status (AppHealthStatus): This property is deprecated. It will always be 'healthy'. - is_externally_accessible (bool): - name (str): The name of the app. - next_run_at (datetime.datetime | None): The next time this app will run as part of it's schedule, null if none. - owner (str): The account slug that owns this app. - pending_timeout (int): The maximum time in seconds that a run can stay in the pending state before being marked - as cancelled. Default: 600. - running_timeout (int): The number of seconds that a run can stay running before it gets cancelled. Value of 0 - (default) means no timeout. Default: 0. - schedule (None | str): The schedule associated with this app, null if none. - short_description (str): A short description of the app. Can be empty. - version (None | str): The current version of this app, null if none. - last_run (Run | Unset): - retry_policy (RunRetryPolicy | Unset): - run_results (RunResults | Unset): - slug (str | Unset): This property is deprecated. Use name instead. - status (AppStatus | Unset): The status of the app. - subdomain (str | Unset): The subdomain that this app is accessible via. Must be externally accessible first. - """ - - created_at: datetime.datetime - health_status: AppHealthStatus - is_externally_accessible: bool - name: str - next_run_at: datetime.datetime | None - owner: str - schedule: None | str - short_description: str - version: None | str - pending_timeout: int = 600 - running_timeout: int = 0 - last_run: Run | Unset = UNSET - retry_policy: RunRetryPolicy | Unset = UNSET - run_results: RunResults | Unset = UNSET - slug: str | Unset = UNSET - status: AppStatus | Unset = UNSET - subdomain: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - created_at = self.created_at.isoformat() - - health_status = self.health_status.value - - is_externally_accessible = self.is_externally_accessible - - name = self.name - - next_run_at: None | str - if isinstance(self.next_run_at, datetime.datetime): - next_run_at = self.next_run_at.isoformat() - else: - next_run_at = self.next_run_at - - owner = self.owner - - pending_timeout = self.pending_timeout - - running_timeout = self.running_timeout - - schedule: None | str - schedule = self.schedule - - short_description = self.short_description - - version: None | str - version = self.version - - last_run: dict[str, Any] | Unset = UNSET - if not isinstance(self.last_run, Unset): - last_run = self.last_run.to_dict() - - retry_policy: dict[str, Any] | Unset = UNSET - if not isinstance(self.retry_policy, Unset): - retry_policy = self.retry_policy.to_dict() - - run_results: dict[str, Any] | Unset = UNSET - if not isinstance(self.run_results, Unset): - run_results = self.run_results.to_dict() - - slug = self.slug - - status: str | Unset = UNSET - if not isinstance(self.status, Unset): - status = self.status.value - - subdomain = self.subdomain - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "created_at": created_at, - "health_status": health_status, - "is_externally_accessible": is_externally_accessible, - "name": name, - "next_run_at": next_run_at, - "owner": owner, - "pending_timeout": pending_timeout, - "running_timeout": running_timeout, - "schedule": schedule, - "short_description": short_description, - "version": version, - } - ) - if last_run is not UNSET: - field_dict["last_run"] = last_run - if retry_policy is not UNSET: - field_dict["retry_policy"] = retry_policy - if run_results is not UNSET: - field_dict["run_results"] = run_results - if slug is not UNSET: - field_dict["slug"] = slug - if status is not UNSET: - field_dict["status"] = status - if subdomain is not UNSET: - field_dict["subdomain"] = subdomain - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.run import Run - from ..models.run_results import RunResults - from ..models.run_retry_policy import RunRetryPolicy - - d = dict(src_dict) - created_at = isoparse(d.pop("created_at")) - - health_status = AppHealthStatus(d.pop("health_status")) - - is_externally_accessible = d.pop("is_externally_accessible") - - name = d.pop("name") - - def _parse_next_run_at(data: object) -> datetime.datetime | None: - if data is None: - return data - try: - if not isinstance(data, str): - raise TypeError() - next_run_at_type_0 = isoparse(data) - - return next_run_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(datetime.datetime | None, data) - - next_run_at = _parse_next_run_at(d.pop("next_run_at")) - - owner = d.pop("owner") - - pending_timeout = d.pop("pending_timeout") - - running_timeout = d.pop("running_timeout") - - def _parse_schedule(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - schedule = _parse_schedule(d.pop("schedule")) - - short_description = d.pop("short_description") - - def _parse_version(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - version = _parse_version(d.pop("version")) - - _last_run = d.pop("last_run", UNSET) - last_run: Run | Unset - if isinstance(_last_run, Unset): - last_run = UNSET - else: - last_run = Run.from_dict(_last_run) - - _retry_policy = d.pop("retry_policy", UNSET) - retry_policy: RunRetryPolicy | Unset - if isinstance(_retry_policy, Unset): - retry_policy = UNSET - else: - retry_policy = RunRetryPolicy.from_dict(_retry_policy) - - _run_results = d.pop("run_results", UNSET) - run_results: RunResults | Unset - if isinstance(_run_results, Unset): - run_results = UNSET - else: - run_results = RunResults.from_dict(_run_results) - - slug = d.pop("slug", UNSET) - - _status = d.pop("status", UNSET) - status: AppStatus | Unset - if isinstance(_status, Unset): - status = UNSET - else: - status = AppStatus(_status) - - subdomain = d.pop("subdomain", UNSET) - - app = cls( - created_at=created_at, - health_status=health_status, - is_externally_accessible=is_externally_accessible, - name=name, - next_run_at=next_run_at, - owner=owner, - pending_timeout=pending_timeout, - running_timeout=running_timeout, - schedule=schedule, - short_description=short_description, - version=version, - last_run=last_run, - retry_policy=retry_policy, - run_results=run_results, - slug=slug, - status=status, - subdomain=subdomain, - ) - - return app diff --git a/src/tower/tower_api_client/models/app_health_status.py b/src/tower/tower_api_client/models/app_health_status.py deleted file mode 100644 index d60e33c5..00000000 --- a/src/tower/tower_api_client/models/app_health_status.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class AppHealthStatus(str, Enum): - HEALTHY = "healthy" - WARNING = "warning" - - def __str__(self) -> str: - return str(self.value) diff --git a/src/tower/tower_api_client/models/app_statistics.py b/src/tower/tower_api_client/models/app_statistics.py deleted file mode 100644 index e8616eb1..00000000 --- a/src/tower/tower_api_client/models/app_statistics.py +++ /dev/null @@ -1,66 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -T = TypeVar("T", bound="AppStatistics") - - -@_attrs_define -class AppStatistics: - """ - Attributes: - all_apps (int): - disabled_apps (int): - healthy_apps (int): - running_apps (int): - """ - - all_apps: int - disabled_apps: int - healthy_apps: int - running_apps: int - - def to_dict(self) -> dict[str, Any]: - all_apps = self.all_apps - - disabled_apps = self.disabled_apps - - healthy_apps = self.healthy_apps - - running_apps = self.running_apps - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "all_apps": all_apps, - "disabled_apps": disabled_apps, - "healthy_apps": healthy_apps, - "running_apps": running_apps, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - all_apps = d.pop("all_apps") - - disabled_apps = d.pop("disabled_apps") - - healthy_apps = d.pop("healthy_apps") - - running_apps = d.pop("running_apps") - - app_statistics = cls( - all_apps=all_apps, - disabled_apps=disabled_apps, - healthy_apps=healthy_apps, - running_apps=running_apps, - ) - - return app_statistics diff --git a/src/tower/tower_api_client/models/app_status.py b/src/tower/tower_api_client/models/app_status.py deleted file mode 100644 index 5d249261..00000000 --- a/src/tower/tower_api_client/models/app_status.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class AppStatus(str, Enum): - ACTIVE = "active" - DISABLED = "disabled" - - def __str__(self) -> str: - return str(self.value) diff --git a/src/tower/tower_api_client/models/app_summary.py b/src/tower/tower_api_client/models/app_summary.py deleted file mode 100644 index 61f41257..00000000 --- a/src/tower/tower_api_client/models/app_summary.py +++ /dev/null @@ -1,66 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -if TYPE_CHECKING: - from ..models.app import App - from ..models.run import Run - - -T = TypeVar("T", bound="AppSummary") - - -@_attrs_define -class AppSummary: - """ - Attributes: - app (App): - runs (list[Run]): - """ - - app: App - runs: list[Run] - - def to_dict(self) -> dict[str, Any]: - app = self.app.to_dict() - - runs = [] - for runs_item_data in self.runs: - runs_item = runs_item_data.to_dict() - runs.append(runs_item) - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "app": app, - "runs": runs, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.app import App - from ..models.run import Run - - d = dict(src_dict) - app = App.from_dict(d.pop("app")) - - runs = [] - _runs = d.pop("runs") - for runs_item_data in _runs: - runs_item = Run.from_dict(runs_item_data) - - runs.append(runs_item) - - app_summary = cls( - app=app, - runs=runs, - ) - - return app_summary diff --git a/src/tower/tower_api_client/models/app_version.py b/src/tower/tower_api_client/models/app_version.py deleted file mode 100644 index 376fd435..00000000 --- a/src/tower/tower_api_client/models/app_version.py +++ /dev/null @@ -1,82 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from dateutil.parser import isoparse - -if TYPE_CHECKING: - from ..models.parameter import Parameter - - -T = TypeVar("T", bound="AppVersion") - - -@_attrs_define -class AppVersion: - """ - Attributes: - created_at (datetime.datetime): - parameters (list[Parameter]): - towerfile (str): The Towerfile that this version was created from. - version (str): - """ - - created_at: datetime.datetime - parameters: list[Parameter] - towerfile: str - version: str - - def to_dict(self) -> dict[str, Any]: - created_at = self.created_at.isoformat() - - parameters = [] - for parameters_item_data in self.parameters: - parameters_item = parameters_item_data.to_dict() - parameters.append(parameters_item) - - towerfile = self.towerfile - - version = self.version - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "created_at": created_at, - "parameters": parameters, - "towerfile": towerfile, - "version": version, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.parameter import Parameter - - d = dict(src_dict) - created_at = isoparse(d.pop("created_at")) - - parameters = [] - _parameters = d.pop("parameters") - for parameters_item_data in _parameters: - parameters_item = Parameter.from_dict(parameters_item_data) - - parameters.append(parameters_item) - - towerfile = d.pop("towerfile") - - version = d.pop("version") - - app_version = cls( - created_at=created_at, - parameters=parameters, - towerfile=towerfile, - version=version, - ) - - return app_version diff --git a/src/tower/tower_api_client/models/authentication_context.py b/src/tower/tower_api_client/models/authentication_context.py deleted file mode 100644 index 6f4f39a7..00000000 --- a/src/tower/tower_api_client/models/authentication_context.py +++ /dev/null @@ -1,42 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -T = TypeVar("T", bound="AuthenticationContext") - - -@_attrs_define -class AuthenticationContext: - """ - Attributes: - work_os_access_token (str): The WorkOS access token for SSO authentication. - """ - - work_os_access_token: str - - def to_dict(self) -> dict[str, Any]: - work_os_access_token = self.work_os_access_token - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "work_os_access_token": work_os_access_token, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - work_os_access_token = d.pop("work_os_access_token") - - authentication_context = cls( - work_os_access_token=work_os_access_token, - ) - - return authentication_context diff --git a/src/tower/tower_api_client/models/batch_schedule_params.py b/src/tower/tower_api_client/models/batch_schedule_params.py deleted file mode 100644 index 73103741..00000000 --- a/src/tower/tower_api_client/models/batch_schedule_params.py +++ /dev/null @@ -1,54 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="BatchScheduleParams") - - -@_attrs_define -class BatchScheduleParams: - """ - Attributes: - ids (list[str]): The IDs of the schedules to modify - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/BatchScheduleParams.json. - """ - - ids: list[str] - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - ids = self.ids - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "ids": ids, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - ids = cast(list[str], d.pop("ids")) - - schema = d.pop("$schema", UNSET) - - batch_schedule_params = cls( - ids=ids, - schema=schema, - ) - - return batch_schedule_params diff --git a/src/tower/tower_api_client/models/batch_schedule_response.py b/src/tower/tower_api_client/models/batch_schedule_response.py deleted file mode 100644 index a4f05673..00000000 --- a/src/tower/tower_api_client/models/batch_schedule_response.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.schedule import Schedule - - -T = TypeVar("T", bound="BatchScheduleResponse") - - -@_attrs_define -class BatchScheduleResponse: - """ - Attributes: - schedules (list[Schedule]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/BatchScheduleResponse.json. - """ - - schedules: list[Schedule] - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - schedules = [] - for schedules_item_data in self.schedules: - schedules_item = schedules_item_data.to_dict() - schedules.append(schedules_item) - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "schedules": schedules, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.schedule import Schedule - - d = dict(src_dict) - schedules = [] - _schedules = d.pop("schedules") - for schedules_item_data in _schedules: - schedules_item = Schedule.from_dict(schedules_item_data) - - schedules.append(schedules_item) - - schema = d.pop("$schema", UNSET) - - batch_schedule_response = cls( - schedules=schedules, - schema=schema, - ) - - return batch_schedule_response diff --git a/src/tower/tower_api_client/models/cancel_run_response.py b/src/tower/tower_api_client/models/cancel_run_response.py deleted file mode 100644 index a6a509e3..00000000 --- a/src/tower/tower_api_client/models/cancel_run_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.run import Run - - -T = TypeVar("T", bound="CancelRunResponse") - - -@_attrs_define -class CancelRunResponse: - """ - Attributes: - run (Run): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/CancelRunResponse.json. - """ - - run: Run - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - run = self.run.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "run": run, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.run import Run - - d = dict(src_dict) - run = Run.from_dict(d.pop("run")) - - schema = d.pop("$schema", UNSET) - - cancel_run_response = cls( - run=run, - schema=schema, - ) - - return cancel_run_response diff --git a/src/tower/tower_api_client/models/catalog.py b/src/tower/tower_api_client/models/catalog.py deleted file mode 100644 index ab6e6e2d..00000000 --- a/src/tower/tower_api_client/models/catalog.py +++ /dev/null @@ -1,101 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from dateutil.parser import isoparse - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.catalog_property import CatalogProperty - - -T = TypeVar("T", bound="Catalog") - - -@_attrs_define -class Catalog: - """ - Attributes: - created_at (datetime.datetime): - environment (str): - name (str): - properties (list[CatalogProperty]): - type_ (str): - slug (str | Unset): This property is deprecated. Use name instead. - """ - - created_at: datetime.datetime - environment: str - name: str - properties: list[CatalogProperty] - type_: str - slug: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - created_at = self.created_at.isoformat() - - environment = self.environment - - name = self.name - - properties = [] - for properties_item_data in self.properties: - properties_item = properties_item_data.to_dict() - properties.append(properties_item) - - type_ = self.type_ - - slug = self.slug - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "CreatedAt": created_at, - "environment": environment, - "name": name, - "properties": properties, - "type": type_, - } - ) - if slug is not UNSET: - field_dict["slug"] = slug - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.catalog_property import CatalogProperty - - d = dict(src_dict) - created_at = isoparse(d.pop("CreatedAt")) - - environment = d.pop("environment") - - name = d.pop("name") - - properties = [] - _properties = d.pop("properties") - for properties_item_data in _properties: - properties_item = CatalogProperty.from_dict(properties_item_data) - - properties.append(properties_item) - - type_ = d.pop("type") - - slug = d.pop("slug", UNSET) - - catalog = cls( - created_at=created_at, - environment=environment, - name=name, - properties=properties, - type_=type_, - slug=slug, - ) - - return catalog diff --git a/src/tower/tower_api_client/models/catalog_property.py b/src/tower/tower_api_client/models/catalog_property.py deleted file mode 100644 index e6d33414..00000000 --- a/src/tower/tower_api_client/models/catalog_property.py +++ /dev/null @@ -1,61 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="CatalogProperty") - - -@_attrs_define -class CatalogProperty: - """ - Attributes: - name (str): - preview (str): - environment_variable (str | Unset): The environment variable name this property is injected as at runtime. - """ - - name: str - preview: str - environment_variable: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - name = self.name - - preview = self.preview - - environment_variable = self.environment_variable - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "name": name, - "preview": preview, - } - ) - if environment_variable is not UNSET: - field_dict["environment_variable"] = environment_variable - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - name = d.pop("name") - - preview = d.pop("preview") - - environment_variable = d.pop("environment_variable", UNSET) - - catalog_property = cls( - name=name, - preview=preview, - environment_variable=environment_variable, - ) - - return catalog_property diff --git a/src/tower/tower_api_client/models/claim_device_login_ticket_params.py b/src/tower/tower_api_client/models/claim_device_login_ticket_params.py deleted file mode 100644 index 13fa138d..00000000 --- a/src/tower/tower_api_client/models/claim_device_login_ticket_params.py +++ /dev/null @@ -1,62 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="ClaimDeviceLoginTicketParams") - - -@_attrs_define -class ClaimDeviceLoginTicketParams: - """ - Attributes: - refresh_token (str): The refresh token for the session to delegate to the device. - user_code (str): The user code to claim. - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/ClaimDeviceLoginTicketParams.json. - """ - - refresh_token: str - user_code: str - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - refresh_token = self.refresh_token - - user_code = self.user_code - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "refresh_token": refresh_token, - "user_code": user_code, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - refresh_token = d.pop("refresh_token") - - user_code = d.pop("user_code") - - schema = d.pop("$schema", UNSET) - - claim_device_login_ticket_params = cls( - refresh_token=refresh_token, - user_code=user_code, - schema=schema, - ) - - return claim_device_login_ticket_params diff --git a/src/tower/tower_api_client/models/claim_device_login_ticket_response.py b/src/tower/tower_api_client/models/claim_device_login_ticket_response.py deleted file mode 100644 index 88d9c7be..00000000 --- a/src/tower/tower_api_client/models/claim_device_login_ticket_response.py +++ /dev/null @@ -1,54 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="ClaimDeviceLoginTicketResponse") - - -@_attrs_define -class ClaimDeviceLoginTicketResponse: - """ - Attributes: - claimed (bool): Whether the code was successfully claimed. - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/ClaimDeviceLoginTicketResponse.json. - """ - - claimed: bool - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - claimed = self.claimed - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "claimed": claimed, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - claimed = d.pop("claimed") - - schema = d.pop("$schema", UNSET) - - claim_device_login_ticket_response = cls( - claimed=claimed, - schema=schema, - ) - - return claim_device_login_ticket_response diff --git a/src/tower/tower_api_client/models/create_account_params.py b/src/tower/tower_api_client/models/create_account_params.py deleted file mode 100644 index ef7caf01..00000000 --- a/src/tower/tower_api_client/models/create_account_params.py +++ /dev/null @@ -1,62 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="CreateAccountParams") - - -@_attrs_define -class CreateAccountParams: - """ - Attributes: - email (str): - password (str): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/CreateAccountParams.json. - """ - - email: str - password: str - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - email = self.email - - password = self.password - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "email": email, - "password": password, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - email = d.pop("email") - - password = d.pop("password") - - schema = d.pop("$schema", UNSET) - - create_account_params = cls( - email=email, - password=password, - schema=schema, - ) - - return create_account_params diff --git a/src/tower/tower_api_client/models/create_account_params_flags_struct.py b/src/tower/tower_api_client/models/create_account_params_flags_struct.py deleted file mode 100644 index 577aef84..00000000 --- a/src/tower/tower_api_client/models/create_account_params_flags_struct.py +++ /dev/null @@ -1,42 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -T = TypeVar("T", bound="CreateAccountParamsFlagsStruct") - - -@_attrs_define -class CreateAccountParamsFlagsStruct: - """ - Attributes: - is_test_account (bool): - """ - - is_test_account: bool - - def to_dict(self) -> dict[str, Any]: - is_test_account = self.is_test_account - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "is_test_account": is_test_account, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - is_test_account = d.pop("is_test_account") - - create_account_params_flags_struct = cls( - is_test_account=is_test_account, - ) - - return create_account_params_flags_struct diff --git a/src/tower/tower_api_client/models/create_account_response.py b/src/tower/tower_api_client/models/create_account_response.py deleted file mode 100644 index 646d5328..00000000 --- a/src/tower/tower_api_client/models/create_account_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.session import Session - - -T = TypeVar("T", bound="CreateAccountResponse") - - -@_attrs_define -class CreateAccountResponse: - """ - Attributes: - session (Session): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/CreateAccountResponse.json. - """ - - session: Session - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - session = self.session.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "session": session, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.session import Session - - d = dict(src_dict) - session = Session.from_dict(d.pop("session")) - - schema = d.pop("$schema", UNSET) - - create_account_response = cls( - session=session, - schema=schema, - ) - - return create_account_response diff --git a/src/tower/tower_api_client/models/create_api_key_params.py b/src/tower/tower_api_client/models/create_api_key_params.py deleted file mode 100644 index 746a5e96..00000000 --- a/src/tower/tower_api_client/models/create_api_key_params.py +++ /dev/null @@ -1,128 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from dateutil.parser import isoparse - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="CreateAPIKeyParams") - - -@_attrs_define -class CreateAPIKeyParams: - """ - Attributes: - name (str): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/CreateAPIKeyParams.json. - expires_at (datetime.datetime | None | Unset): When this API key expires. - scopes (None | str | Unset): Space separated scopes that this API key is valid for. - team (None | str | Unset): The team this API key is associated with. This field is optional. You must be a - member of the team that you're creating the API key for, and if you're using an API key to create a new API key, - the API key you use to authenticate this request must be a personal API key. - """ - - name: str - schema: str | Unset = UNSET - expires_at: datetime.datetime | None | Unset = UNSET - scopes: None | str | Unset = UNSET - team: None | str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - name = self.name - - schema = self.schema - - expires_at: None | str | Unset - if isinstance(self.expires_at, Unset): - expires_at = UNSET - elif isinstance(self.expires_at, datetime.datetime): - expires_at = self.expires_at.isoformat() - else: - expires_at = self.expires_at - - scopes: None | str | Unset - if isinstance(self.scopes, Unset): - scopes = UNSET - else: - scopes = self.scopes - - team: None | str | Unset - if isinstance(self.team, Unset): - team = UNSET - else: - team = self.team - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "name": name, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - if expires_at is not UNSET: - field_dict["expires_at"] = expires_at - if scopes is not UNSET: - field_dict["scopes"] = scopes - if team is not UNSET: - field_dict["team"] = team - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - name = d.pop("name") - - schema = d.pop("$schema", UNSET) - - def _parse_expires_at(data: object) -> datetime.datetime | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - expires_at_type_0 = isoparse(data) - - return expires_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(datetime.datetime | None | Unset, data) - - expires_at = _parse_expires_at(d.pop("expires_at", UNSET)) - - def _parse_scopes(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - scopes = _parse_scopes(d.pop("scopes", UNSET)) - - def _parse_team(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - team = _parse_team(d.pop("team", UNSET)) - - create_api_key_params = cls( - name=name, - schema=schema, - expires_at=expires_at, - scopes=scopes, - team=team, - ) - - return create_api_key_params diff --git a/src/tower/tower_api_client/models/create_api_key_response.py b/src/tower/tower_api_client/models/create_api_key_response.py deleted file mode 100644 index da7ebf59..00000000 --- a/src/tower/tower_api_client/models/create_api_key_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.api_key import APIKey - - -T = TypeVar("T", bound="CreateAPIKeyResponse") - - -@_attrs_define -class CreateAPIKeyResponse: - """ - Attributes: - api_key (APIKey): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/CreateAPIKeyResponse.json. - """ - - api_key: APIKey - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - api_key = self.api_key.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "api_key": api_key, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.api_key import APIKey - - d = dict(src_dict) - api_key = APIKey.from_dict(d.pop("api_key")) - - schema = d.pop("$schema", UNSET) - - create_api_key_response = cls( - api_key=api_key, - schema=schema, - ) - - return create_api_key_response diff --git a/src/tower/tower_api_client/models/create_app_params.py b/src/tower/tower_api_client/models/create_app_params.py deleted file mode 100644 index fdf0e085..00000000 --- a/src/tower/tower_api_client/models/create_app_params.py +++ /dev/null @@ -1,103 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="CreateAppParams") - - -@_attrs_define -class CreateAppParams: - """ - Attributes: - name (str): The name of the app. - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/CreateAppParams.json. - is_externally_accessible (bool | Unset): Indicates that web traffic should be routed to this app and that its - runs should get a hostname assigned to it. Default: False. - short_description (str | Unset): A description of the app. - slug (str | Unset): The slug of the app. Legacy CLI will send it but we don't need it. - subdomain (None | str | Unset): The subdomain this app is accessible under. Requires is_externally_accessible to - be true. - """ - - name: str - schema: str | Unset = UNSET - is_externally_accessible: bool | Unset = False - short_description: str | Unset = UNSET - slug: str | Unset = UNSET - subdomain: None | str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - name = self.name - - schema = self.schema - - is_externally_accessible = self.is_externally_accessible - - short_description = self.short_description - - slug = self.slug - - subdomain: None | str | Unset - if isinstance(self.subdomain, Unset): - subdomain = UNSET - else: - subdomain = self.subdomain - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "name": name, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - if is_externally_accessible is not UNSET: - field_dict["is_externally_accessible"] = is_externally_accessible - if short_description is not UNSET: - field_dict["short_description"] = short_description - if slug is not UNSET: - field_dict["slug"] = slug - if subdomain is not UNSET: - field_dict["subdomain"] = subdomain - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - name = d.pop("name") - - schema = d.pop("$schema", UNSET) - - is_externally_accessible = d.pop("is_externally_accessible", UNSET) - - short_description = d.pop("short_description", UNSET) - - slug = d.pop("slug", UNSET) - - def _parse_subdomain(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - subdomain = _parse_subdomain(d.pop("subdomain", UNSET)) - - create_app_params = cls( - name=name, - schema=schema, - is_externally_accessible=is_externally_accessible, - short_description=short_description, - slug=slug, - subdomain=subdomain, - ) - - return create_app_params diff --git a/src/tower/tower_api_client/models/create_app_response.py b/src/tower/tower_api_client/models/create_app_response.py deleted file mode 100644 index 2c727a2e..00000000 --- a/src/tower/tower_api_client/models/create_app_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.app import App - - -T = TypeVar("T", bound="CreateAppResponse") - - -@_attrs_define -class CreateAppResponse: - """ - Attributes: - app (App): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/CreateAppResponse.json. - """ - - app: App - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - app = self.app.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "app": app, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.app import App - - d = dict(src_dict) - app = App.from_dict(d.pop("app")) - - schema = d.pop("$schema", UNSET) - - create_app_response = cls( - app=app, - schema=schema, - ) - - return create_app_response diff --git a/src/tower/tower_api_client/models/create_authenticator_params.py b/src/tower/tower_api_client/models/create_authenticator_params.py deleted file mode 100644 index c425e583..00000000 --- a/src/tower/tower_api_client/models/create_authenticator_params.py +++ /dev/null @@ -1,62 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="CreateAuthenticatorParams") - - -@_attrs_define -class CreateAuthenticatorParams: - """ - Attributes: - authenticator_url (str): The authenticator URL with an otpauth scheme that identifies this authenticator - verification_code (str): A code taken from the authenticator as verification that it's correctly configured. - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/CreateAuthenticatorParams.json. - """ - - authenticator_url: str - verification_code: str - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - authenticator_url = self.authenticator_url - - verification_code = self.verification_code - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "authenticator_url": authenticator_url, - "verification_code": verification_code, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - authenticator_url = d.pop("authenticator_url") - - verification_code = d.pop("verification_code") - - schema = d.pop("$schema", UNSET) - - create_authenticator_params = cls( - authenticator_url=authenticator_url, - verification_code=verification_code, - schema=schema, - ) - - return create_authenticator_params diff --git a/src/tower/tower_api_client/models/create_authenticator_response.py b/src/tower/tower_api_client/models/create_authenticator_response.py deleted file mode 100644 index f783573d..00000000 --- a/src/tower/tower_api_client/models/create_authenticator_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.verified_authenticator import VerifiedAuthenticator - - -T = TypeVar("T", bound="CreateAuthenticatorResponse") - - -@_attrs_define -class CreateAuthenticatorResponse: - """ - Attributes: - authenticator (VerifiedAuthenticator): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/CreateAuthenticatorResponse.json. - """ - - authenticator: VerifiedAuthenticator - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - authenticator = self.authenticator.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "authenticator": authenticator, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.verified_authenticator import VerifiedAuthenticator - - d = dict(src_dict) - authenticator = VerifiedAuthenticator.from_dict(d.pop("authenticator")) - - schema = d.pop("$schema", UNSET) - - create_authenticator_response = cls( - authenticator=authenticator, - schema=schema, - ) - - return create_authenticator_response diff --git a/src/tower/tower_api_client/models/create_catalog_params.py b/src/tower/tower_api_client/models/create_catalog_params.py deleted file mode 100644 index f7e7b890..00000000 --- a/src/tower/tower_api_client/models/create_catalog_params.py +++ /dev/null @@ -1,93 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..models.create_catalog_params_type import CreateCatalogParamsType -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.encrypted_catalog_property import EncryptedCatalogProperty - - -T = TypeVar("T", bound="CreateCatalogParams") - - -@_attrs_define -class CreateCatalogParams: - """ - Attributes: - environment (str): - name (str): - properties (list[EncryptedCatalogProperty]): - type_ (CreateCatalogParamsType): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/CreateCatalogParams.json. - """ - - environment: str - name: str - properties: list[EncryptedCatalogProperty] - type_: CreateCatalogParamsType - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - environment = self.environment - - name = self.name - - properties = [] - for properties_item_data in self.properties: - properties_item = properties_item_data.to_dict() - properties.append(properties_item) - - type_ = self.type_.value - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "environment": environment, - "name": name, - "properties": properties, - "type": type_, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.encrypted_catalog_property import EncryptedCatalogProperty - - d = dict(src_dict) - environment = d.pop("environment") - - name = d.pop("name") - - properties = [] - _properties = d.pop("properties") - for properties_item_data in _properties: - properties_item = EncryptedCatalogProperty.from_dict(properties_item_data) - - properties.append(properties_item) - - type_ = CreateCatalogParamsType(d.pop("type")) - - schema = d.pop("$schema", UNSET) - - create_catalog_params = cls( - environment=environment, - name=name, - properties=properties, - type_=type_, - schema=schema, - ) - - return create_catalog_params diff --git a/src/tower/tower_api_client/models/create_catalog_params_type.py b/src/tower/tower_api_client/models/create_catalog_params_type.py deleted file mode 100644 index 4c186f02..00000000 --- a/src/tower/tower_api_client/models/create_catalog_params_type.py +++ /dev/null @@ -1,12 +0,0 @@ -from enum import Enum - - -class CreateCatalogParamsType(str, Enum): - APACHE_POLARIS = "apache-polaris" - CLOUDFLARE_R2_CATALOG = "cloudflare-r2-catalog" - LAKEKEEPER = "lakekeeper" - SNOWFLAKE_OPEN_CATALOG = "snowflake-open-catalog" - TOWER_CATALOG = "tower-catalog" - - def __str__(self) -> str: - return str(self.value) diff --git a/src/tower/tower_api_client/models/create_catalog_response.py b/src/tower/tower_api_client/models/create_catalog_response.py deleted file mode 100644 index 6559c70f..00000000 --- a/src/tower/tower_api_client/models/create_catalog_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.catalog import Catalog - - -T = TypeVar("T", bound="CreateCatalogResponse") - - -@_attrs_define -class CreateCatalogResponse: - """ - Attributes: - catalog (Catalog): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/CreateCatalogResponse.json. - """ - - catalog: Catalog - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - catalog = self.catalog.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "catalog": catalog, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.catalog import Catalog - - d = dict(src_dict) - catalog = Catalog.from_dict(d.pop("catalog")) - - schema = d.pop("$schema", UNSET) - - create_catalog_response = cls( - catalog=catalog, - schema=schema, - ) - - return create_catalog_response diff --git a/src/tower/tower_api_client/models/create_device_login_ticket_response.py b/src/tower/tower_api_client/models/create_device_login_ticket_response.py deleted file mode 100644 index eb5c1ada..00000000 --- a/src/tower/tower_api_client/models/create_device_login_ticket_response.py +++ /dev/null @@ -1,104 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from dateutil.parser import isoparse - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="CreateDeviceLoginTicketResponse") - - -@_attrs_define -class CreateDeviceLoginTicketResponse: - """ - Attributes: - device_code (str): The unique code identifying this device login request. - expires_in (int): Number of seconds until this request expires. - generated_at (datetime.datetime): When this device login request was created. - interval (int): Number of seconds to wait between polling attempts. - login_url (str): The URL where the user should go to enter the user code. - user_code (str): The code that the user needs to enter to authenticate. - verification_url (str): The URL that the device should poll to check authentication status. - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/CreateDeviceLoginTicketResponse.json. - """ - - device_code: str - expires_in: int - generated_at: datetime.datetime - interval: int - login_url: str - user_code: str - verification_url: str - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - device_code = self.device_code - - expires_in = self.expires_in - - generated_at = self.generated_at.isoformat() - - interval = self.interval - - login_url = self.login_url - - user_code = self.user_code - - verification_url = self.verification_url - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "device_code": device_code, - "expires_in": expires_in, - "generated_at": generated_at, - "interval": interval, - "login_url": login_url, - "user_code": user_code, - "verification_url": verification_url, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - device_code = d.pop("device_code") - - expires_in = d.pop("expires_in") - - generated_at = isoparse(d.pop("generated_at")) - - interval = d.pop("interval") - - login_url = d.pop("login_url") - - user_code = d.pop("user_code") - - verification_url = d.pop("verification_url") - - schema = d.pop("$schema", UNSET) - - create_device_login_ticket_response = cls( - device_code=device_code, - expires_in=expires_in, - generated_at=generated_at, - interval=interval, - login_url=login_url, - user_code=user_code, - verification_url=verification_url, - schema=schema, - ) - - return create_device_login_ticket_response diff --git a/src/tower/tower_api_client/models/create_environment_params.py b/src/tower/tower_api_client/models/create_environment_params.py deleted file mode 100644 index b111d756..00000000 --- a/src/tower/tower_api_client/models/create_environment_params.py +++ /dev/null @@ -1,54 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="CreateEnvironmentParams") - - -@_attrs_define -class CreateEnvironmentParams: - """ - Attributes: - name (str): The name of the environment - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/CreateEnvironmentParams.json. - """ - - name: str - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - name = self.name - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "name": name, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - name = d.pop("name") - - schema = d.pop("$schema", UNSET) - - create_environment_params = cls( - name=name, - schema=schema, - ) - - return create_environment_params diff --git a/src/tower/tower_api_client/models/create_environment_response.py b/src/tower/tower_api_client/models/create_environment_response.py deleted file mode 100644 index 3bd42020..00000000 --- a/src/tower/tower_api_client/models/create_environment_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.environment import Environment - - -T = TypeVar("T", bound="CreateEnvironmentResponse") - - -@_attrs_define -class CreateEnvironmentResponse: - """ - Attributes: - environment (Environment): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/CreateEnvironmentResponse.json. - """ - - environment: Environment - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - environment = self.environment.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "environment": environment, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.environment import Environment - - d = dict(src_dict) - environment = Environment.from_dict(d.pop("environment")) - - schema = d.pop("$schema", UNSET) - - create_environment_response = cls( - environment=environment, - schema=schema, - ) - - return create_environment_response diff --git a/src/tower/tower_api_client/models/create_guest_params.py b/src/tower/tower_api_client/models/create_guest_params.py deleted file mode 100644 index bd239c34..00000000 --- a/src/tower/tower_api_client/models/create_guest_params.py +++ /dev/null @@ -1,82 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="CreateGuestParams") - - -@_attrs_define -class CreateGuestParams: - """ - Attributes: - app (str): The name of the externally accessible app this guest can access. - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/CreateGuestParams.json. - expires_in (int | Unset): The number of seconds the guest session should last. Defaults to 72 hours. Default: - 259200. - name (str | Unset): Optional display name for the guest. - redirect_url (str | Unset): Where to redirect the guest after they log in. Defaults to the app's subdomain. - """ - - app: str - schema: str | Unset = UNSET - expires_in: int | Unset = 259200 - name: str | Unset = UNSET - redirect_url: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - app = self.app - - schema = self.schema - - expires_in = self.expires_in - - name = self.name - - redirect_url = self.redirect_url - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "app": app, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - if expires_in is not UNSET: - field_dict["expires_in"] = expires_in - if name is not UNSET: - field_dict["name"] = name - if redirect_url is not UNSET: - field_dict["redirect_url"] = redirect_url - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - app = d.pop("app") - - schema = d.pop("$schema", UNSET) - - expires_in = d.pop("expires_in", UNSET) - - name = d.pop("name", UNSET) - - redirect_url = d.pop("redirect_url", UNSET) - - create_guest_params = cls( - app=app, - schema=schema, - expires_in=expires_in, - name=name, - redirect_url=redirect_url, - ) - - return create_guest_params diff --git a/src/tower/tower_api_client/models/create_guest_response.py b/src/tower/tower_api_client/models/create_guest_response.py deleted file mode 100644 index 2b0f4c1b..00000000 --- a/src/tower/tower_api_client/models/create_guest_response.py +++ /dev/null @@ -1,78 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from dateutil.parser import isoparse - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.guest import Guest - - -T = TypeVar("T", bound="CreateGuestResponse") - - -@_attrs_define -class CreateGuestResponse: - """ - Attributes: - guest (Guest): - login_url (str): The URL to share with the guest for logging in. - login_url_expires_at (datetime.datetime): When the login URL expires. - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/CreateGuestResponse.json. - """ - - guest: Guest - login_url: str - login_url_expires_at: datetime.datetime - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - guest = self.guest.to_dict() - - login_url = self.login_url - - login_url_expires_at = self.login_url_expires_at.isoformat() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "guest": guest, - "login_url": login_url, - "login_url_expires_at": login_url_expires_at, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.guest import Guest - - d = dict(src_dict) - guest = Guest.from_dict(d.pop("guest")) - - login_url = d.pop("login_url") - - login_url_expires_at = isoparse(d.pop("login_url_expires_at")) - - schema = d.pop("$schema", UNSET) - - create_guest_response = cls( - guest=guest, - login_url=login_url, - login_url_expires_at=login_url_expires_at, - schema=schema, - ) - - return create_guest_response diff --git a/src/tower/tower_api_client/models/create_password_reset_params.py b/src/tower/tower_api_client/models/create_password_reset_params.py deleted file mode 100644 index 78c9bac3..00000000 --- a/src/tower/tower_api_client/models/create_password_reset_params.py +++ /dev/null @@ -1,54 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="CreatePasswordResetParams") - - -@_attrs_define -class CreatePasswordResetParams: - """ - Attributes: - email (str): The email address to send the password reset email to - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/CreatePasswordResetParams.json. - """ - - email: str - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - email = self.email - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "email": email, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - email = d.pop("email") - - schema = d.pop("$schema", UNSET) - - create_password_reset_params = cls( - email=email, - schema=schema, - ) - - return create_password_reset_params diff --git a/src/tower/tower_api_client/models/create_password_reset_response.py b/src/tower/tower_api_client/models/create_password_reset_response.py deleted file mode 100644 index 07371f08..00000000 --- a/src/tower/tower_api_client/models/create_password_reset_response.py +++ /dev/null @@ -1,54 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="CreatePasswordResetResponse") - - -@_attrs_define -class CreatePasswordResetResponse: - """ - Attributes: - ok (bool): A boolean indicating the request was successfully processed. - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/CreatePasswordResetResponse.json. - """ - - ok: bool - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - ok = self.ok - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "ok": ok, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - ok = d.pop("ok") - - schema = d.pop("$schema", UNSET) - - create_password_reset_response = cls( - ok=ok, - schema=schema, - ) - - return create_password_reset_response diff --git a/src/tower/tower_api_client/models/create_sandbox_secrets_params.py b/src/tower/tower_api_client/models/create_sandbox_secrets_params.py deleted file mode 100644 index 4b8fec17..00000000 --- a/src/tower/tower_api_client/models/create_sandbox_secrets_params.py +++ /dev/null @@ -1,62 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="CreateSandboxSecretsParams") - - -@_attrs_define -class CreateSandboxSecretsParams: - """ - Attributes: - environment (str): Environment to create secrets in - secret_keys (list[str]): List of secret keys to create with Tower defaults - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/CreateSandboxSecretsParams.json. - """ - - environment: str - secret_keys: list[str] - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - environment = self.environment - - secret_keys = self.secret_keys - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "environment": environment, - "secret_keys": secret_keys, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - environment = d.pop("environment") - - secret_keys = cast(list[str], d.pop("secret_keys")) - - schema = d.pop("$schema", UNSET) - - create_sandbox_secrets_params = cls( - environment=environment, - secret_keys=secret_keys, - schema=schema, - ) - - return create_sandbox_secrets_params diff --git a/src/tower/tower_api_client/models/create_sandbox_secrets_response.py b/src/tower/tower_api_client/models/create_sandbox_secrets_response.py deleted file mode 100644 index 246de164..00000000 --- a/src/tower/tower_api_client/models/create_sandbox_secrets_response.py +++ /dev/null @@ -1,54 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="CreateSandboxSecretsResponse") - - -@_attrs_define -class CreateSandboxSecretsResponse: - """ - Attributes: - created (list[str]): List of secret keys that were created - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/CreateSandboxSecretsResponse.json. - """ - - created: list[str] - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - created = self.created - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "created": created, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - created = cast(list[str], d.pop("created")) - - schema = d.pop("$schema", UNSET) - - create_sandbox_secrets_response = cls( - created=created, - schema=schema, - ) - - return create_sandbox_secrets_response diff --git a/src/tower/tower_api_client/models/create_schedule_params.py b/src/tower/tower_api_client/models/create_schedule_params.py deleted file mode 100644 index f722db1d..00000000 --- a/src/tower/tower_api_client/models/create_schedule_params.py +++ /dev/null @@ -1,200 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast - -from attrs import define as _attrs_define - -from ..models.create_schedule_params_overlap_policy import ( - CreateScheduleParamsOverlapPolicy, -) -from ..models.create_schedule_params_status import CreateScheduleParamsStatus -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.run_parameter import RunParameter - - -T = TypeVar("T", bound="CreateScheduleParams") - - -@_attrs_define -class CreateScheduleParams: - """ - Attributes: - app_name (str): The name of the app to create a schedule for - cron (str): The cron expression defining when the app should run - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/CreateScheduleParams.json. - app_version (None | str | Unset): The specific app version to run (if omitted, will use the app's default - version) - environment (str | Unset): The environment to run the app in Default: 'default'. - name (None | str | Unset): The name for this schedule. Must be unique per environment. If not set, one will be - generated for you. - overlap_policy (CreateScheduleParamsOverlapPolicy | Unset): The overlap policy for the schedule Default: - CreateScheduleParamsOverlapPolicy.ALLOW. - parameters (list[RunParameter] | Unset): Parameters to pass when running the app - status (CreateScheduleParamsStatus | Unset): The status of the schedule (defaults to active) - timezone (None | str | Unset): The IANA timezone identifier that the cron expression should be evaluated in - (e.g., 'America/New_York', 'Europe/London'). Defaults to 'UTC'. Default: 'UTC'. - """ - - app_name: str - cron: str - schema: str | Unset = UNSET - app_version: None | str | Unset = UNSET - environment: str | Unset = "default" - name: None | str | Unset = UNSET - overlap_policy: CreateScheduleParamsOverlapPolicy | Unset = ( - CreateScheduleParamsOverlapPolicy.ALLOW - ) - parameters: list[RunParameter] | Unset = UNSET - status: CreateScheduleParamsStatus | Unset = UNSET - timezone: None | str | Unset = "UTC" - - def to_dict(self) -> dict[str, Any]: - app_name = self.app_name - - cron = self.cron - - schema = self.schema - - app_version: None | str | Unset - if isinstance(self.app_version, Unset): - app_version = UNSET - else: - app_version = self.app_version - - environment = self.environment - - name: None | str | Unset - if isinstance(self.name, Unset): - name = UNSET - else: - name = self.name - - overlap_policy: str | Unset = UNSET - if not isinstance(self.overlap_policy, Unset): - overlap_policy = self.overlap_policy.value - - parameters: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.parameters, Unset): - parameters = [] - for parameters_item_data in self.parameters: - parameters_item = parameters_item_data.to_dict() - parameters.append(parameters_item) - - status: str | Unset = UNSET - if not isinstance(self.status, Unset): - status = self.status.value - - timezone: None | str | Unset - if isinstance(self.timezone, Unset): - timezone = UNSET - else: - timezone = self.timezone - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "app_name": app_name, - "cron": cron, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - if app_version is not UNSET: - field_dict["app_version"] = app_version - if environment is not UNSET: - field_dict["environment"] = environment - if name is not UNSET: - field_dict["name"] = name - if overlap_policy is not UNSET: - field_dict["overlap_policy"] = overlap_policy - if parameters is not UNSET: - field_dict["parameters"] = parameters - if status is not UNSET: - field_dict["status"] = status - if timezone is not UNSET: - field_dict["timezone"] = timezone - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.run_parameter import RunParameter - - d = dict(src_dict) - app_name = d.pop("app_name") - - cron = d.pop("cron") - - schema = d.pop("$schema", UNSET) - - def _parse_app_version(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - app_version = _parse_app_version(d.pop("app_version", UNSET)) - - environment = d.pop("environment", UNSET) - - def _parse_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - name = _parse_name(d.pop("name", UNSET)) - - _overlap_policy = d.pop("overlap_policy", UNSET) - overlap_policy: CreateScheduleParamsOverlapPolicy | Unset - if isinstance(_overlap_policy, Unset): - overlap_policy = UNSET - else: - overlap_policy = CreateScheduleParamsOverlapPolicy(_overlap_policy) - - _parameters = d.pop("parameters", UNSET) - parameters: list[RunParameter] | Unset = UNSET - if _parameters is not UNSET: - parameters = [] - for parameters_item_data in _parameters: - parameters_item = RunParameter.from_dict(parameters_item_data) - - parameters.append(parameters_item) - - _status = d.pop("status", UNSET) - status: CreateScheduleParamsStatus | Unset - if isinstance(_status, Unset): - status = UNSET - else: - status = CreateScheduleParamsStatus(_status) - - def _parse_timezone(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - timezone = _parse_timezone(d.pop("timezone", UNSET)) - - create_schedule_params = cls( - app_name=app_name, - cron=cron, - schema=schema, - app_version=app_version, - environment=environment, - name=name, - overlap_policy=overlap_policy, - parameters=parameters, - status=status, - timezone=timezone, - ) - - return create_schedule_params diff --git a/src/tower/tower_api_client/models/create_schedule_params_overlap_policy.py b/src/tower/tower_api_client/models/create_schedule_params_overlap_policy.py deleted file mode 100644 index 0c9a20db..00000000 --- a/src/tower/tower_api_client/models/create_schedule_params_overlap_policy.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class CreateScheduleParamsOverlapPolicy(str, Enum): - ALLOW = "allow" - SKIP = "skip" - - def __str__(self) -> str: - return str(self.value) diff --git a/src/tower/tower_api_client/models/create_schedule_params_status.py b/src/tower/tower_api_client/models/create_schedule_params_status.py deleted file mode 100644 index e86cf62a..00000000 --- a/src/tower/tower_api_client/models/create_schedule_params_status.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class CreateScheduleParamsStatus(str, Enum): - ACTIVE = "active" - DISABLED = "disabled" - - def __str__(self) -> str: - return str(self.value) diff --git a/src/tower/tower_api_client/models/create_schedule_response.py b/src/tower/tower_api_client/models/create_schedule_response.py deleted file mode 100644 index 106ccc5c..00000000 --- a/src/tower/tower_api_client/models/create_schedule_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.schedule import Schedule - - -T = TypeVar("T", bound="CreateScheduleResponse") - - -@_attrs_define -class CreateScheduleResponse: - """ - Attributes: - schedule (Schedule): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/CreateScheduleResponse.json. - """ - - schedule: Schedule - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - schedule = self.schedule.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "schedule": schedule, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.schedule import Schedule - - d = dict(src_dict) - schedule = Schedule.from_dict(d.pop("schedule")) - - schema = d.pop("$schema", UNSET) - - create_schedule_response = cls( - schedule=schedule, - schema=schema, - ) - - return create_schedule_response diff --git a/src/tower/tower_api_client/models/create_secret_params.py b/src/tower/tower_api_client/models/create_secret_params.py deleted file mode 100644 index f2d22b65..00000000 --- a/src/tower/tower_api_client/models/create_secret_params.py +++ /dev/null @@ -1,78 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="CreateSecretParams") - - -@_attrs_define -class CreateSecretParams: - """ - Attributes: - encrypted_value (str): - environment (str): - name (str): - preview (str): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/CreateSecretParams.json. - """ - - encrypted_value: str - environment: str - name: str - preview: str - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - encrypted_value = self.encrypted_value - - environment = self.environment - - name = self.name - - preview = self.preview - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "encrypted_value": encrypted_value, - "environment": environment, - "name": name, - "preview": preview, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - encrypted_value = d.pop("encrypted_value") - - environment = d.pop("environment") - - name = d.pop("name") - - preview = d.pop("preview") - - schema = d.pop("$schema", UNSET) - - create_secret_params = cls( - encrypted_value=encrypted_value, - environment=environment, - name=name, - preview=preview, - schema=schema, - ) - - return create_secret_params diff --git a/src/tower/tower_api_client/models/create_secret_response.py b/src/tower/tower_api_client/models/create_secret_response.py deleted file mode 100644 index 1a0d4f0b..00000000 --- a/src/tower/tower_api_client/models/create_secret_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.secret import Secret - - -T = TypeVar("T", bound="CreateSecretResponse") - - -@_attrs_define -class CreateSecretResponse: - """ - Attributes: - secret (Secret): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/CreateSecretResponse.json. - """ - - secret: Secret - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - secret = self.secret.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "secret": secret, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.secret import Secret - - d = dict(src_dict) - secret = Secret.from_dict(d.pop("secret")) - - schema = d.pop("$schema", UNSET) - - create_secret_response = cls( - secret=secret, - schema=schema, - ) - - return create_secret_response diff --git a/src/tower/tower_api_client/models/create_session_params.py b/src/tower/tower_api_client/models/create_session_params.py deleted file mode 100644 index 6cf5d381..00000000 --- a/src/tower/tower_api_client/models/create_session_params.py +++ /dev/null @@ -1,72 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="CreateSessionParams") - - -@_attrs_define -class CreateSessionParams: - """ - Attributes: - password (str): - username (str): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/CreateSessionParams.json. - code (str | Unset): One-time password verification code for two-factor authentication. If the user has two- - factor authentication enabled, this code is required to log in. - """ - - password: str - username: str - schema: str | Unset = UNSET - code: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - password = self.password - - username = self.username - - schema = self.schema - - code = self.code - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "password": password, - "username": username, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - if code is not UNSET: - field_dict["code"] = code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - password = d.pop("password") - - username = d.pop("username") - - schema = d.pop("$schema", UNSET) - - code = d.pop("code", UNSET) - - create_session_params = cls( - password=password, - username=username, - schema=schema, - code=code, - ) - - return create_session_params diff --git a/src/tower/tower_api_client/models/create_session_response.py b/src/tower/tower_api_client/models/create_session_response.py deleted file mode 100644 index 7f0490d1..00000000 --- a/src/tower/tower_api_client/models/create_session_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.session import Session - - -T = TypeVar("T", bound="CreateSessionResponse") - - -@_attrs_define -class CreateSessionResponse: - """ - Attributes: - session (Session): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/CreateSessionResponse.json. - """ - - session: Session - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - session = self.session.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "session": session, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.session import Session - - d = dict(src_dict) - session = Session.from_dict(d.pop("session")) - - schema = d.pop("$schema", UNSET) - - create_session_response = cls( - session=session, - schema=schema, - ) - - return create_session_response diff --git a/src/tower/tower_api_client/models/create_team_params.py b/src/tower/tower_api_client/models/create_team_params.py deleted file mode 100644 index 58e53f60..00000000 --- a/src/tower/tower_api_client/models/create_team_params.py +++ /dev/null @@ -1,54 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="CreateTeamParams") - - -@_attrs_define -class CreateTeamParams: - """ - Attributes: - name (str): The name of the team to create - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/CreateTeamParams.json. - """ - - name: str - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - name = self.name - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "name": name, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - name = d.pop("name") - - schema = d.pop("$schema", UNSET) - - create_team_params = cls( - name=name, - schema=schema, - ) - - return create_team_params diff --git a/src/tower/tower_api_client/models/create_team_response.py b/src/tower/tower_api_client/models/create_team_response.py deleted file mode 100644 index ffbdde2e..00000000 --- a/src/tower/tower_api_client/models/create_team_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.team import Team - - -T = TypeVar("T", bound="CreateTeamResponse") - - -@_attrs_define -class CreateTeamResponse: - """ - Attributes: - team (Team): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/CreateTeamResponse.json. - """ - - team: Team - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - team = self.team.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "team": team, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.team import Team - - d = dict(src_dict) - team = Team.from_dict(d.pop("team")) - - schema = d.pop("$schema", UNSET) - - create_team_response = cls( - team=team, - schema=schema, - ) - - return create_team_response diff --git a/src/tower/tower_api_client/models/create_webhook_params.py b/src/tower/tower_api_client/models/create_webhook_params.py deleted file mode 100644 index ea81c248..00000000 --- a/src/tower/tower_api_client/models/create_webhook_params.py +++ /dev/null @@ -1,62 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="CreateWebhookParams") - - -@_attrs_define -class CreateWebhookParams: - """ - Attributes: - name (str): The name of the webhook. - url (str): The webhook URL. - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/CreateWebhookParams.json. - """ - - name: str - url: str - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - name = self.name - - url = self.url - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "name": name, - "url": url, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - name = d.pop("name") - - url = d.pop("url") - - schema = d.pop("$schema", UNSET) - - create_webhook_params = cls( - name=name, - url=url, - schema=schema, - ) - - return create_webhook_params diff --git a/src/tower/tower_api_client/models/create_webhook_response.py b/src/tower/tower_api_client/models/create_webhook_response.py deleted file mode 100644 index 307dc4df..00000000 --- a/src/tower/tower_api_client/models/create_webhook_response.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.webhook import Webhook - - -T = TypeVar("T", bound="CreateWebhookResponse") - - -@_attrs_define -class CreateWebhookResponse: - """ - Attributes: - signing_key (str): - webhook (Webhook): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/CreateWebhookResponse.json. - """ - - signing_key: str - webhook: Webhook - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - signing_key = self.signing_key - - webhook = self.webhook.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "signing_key": signing_key, - "webhook": webhook, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.webhook import Webhook - - d = dict(src_dict) - signing_key = d.pop("signing_key") - - webhook = Webhook.from_dict(d.pop("webhook")) - - schema = d.pop("$schema", UNSET) - - create_webhook_response = cls( - signing_key=signing_key, - webhook=webhook, - schema=schema, - ) - - return create_webhook_response diff --git a/src/tower/tower_api_client/models/delete_api_key_params.py b/src/tower/tower_api_client/models/delete_api_key_params.py deleted file mode 100644 index ed8f4576..00000000 --- a/src/tower/tower_api_client/models/delete_api_key_params.py +++ /dev/null @@ -1,54 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="DeleteAPIKeyParams") - - -@_attrs_define -class DeleteAPIKeyParams: - """ - Attributes: - identifier (str): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DeleteAPIKeyParams.json. - """ - - identifier: str - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - identifier = self.identifier - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "identifier": identifier, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - identifier = d.pop("identifier") - - schema = d.pop("$schema", UNSET) - - delete_api_key_params = cls( - identifier=identifier, - schema=schema, - ) - - return delete_api_key_params diff --git a/src/tower/tower_api_client/models/delete_api_key_response.py b/src/tower/tower_api_client/models/delete_api_key_response.py deleted file mode 100644 index 6620c674..00000000 --- a/src/tower/tower_api_client/models/delete_api_key_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.api_key import APIKey - - -T = TypeVar("T", bound="DeleteAPIKeyResponse") - - -@_attrs_define -class DeleteAPIKeyResponse: - """ - Attributes: - api_key (APIKey): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DeleteAPIKeyResponse.json. - """ - - api_key: APIKey - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - api_key = self.api_key.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "api_key": api_key, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.api_key import APIKey - - d = dict(src_dict) - api_key = APIKey.from_dict(d.pop("api_key")) - - schema = d.pop("$schema", UNSET) - - delete_api_key_response = cls( - api_key=api_key, - schema=schema, - ) - - return delete_api_key_response diff --git a/src/tower/tower_api_client/models/delete_app_response.py b/src/tower/tower_api_client/models/delete_app_response.py deleted file mode 100644 index b85ab342..00000000 --- a/src/tower/tower_api_client/models/delete_app_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.app import App - - -T = TypeVar("T", bound="DeleteAppResponse") - - -@_attrs_define -class DeleteAppResponse: - """ - Attributes: - app (App): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DeleteAppResponse.json. - """ - - app: App - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - app = self.app.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "app": app, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.app import App - - d = dict(src_dict) - app = App.from_dict(d.pop("app")) - - schema = d.pop("$schema", UNSET) - - delete_app_response = cls( - app=app, - schema=schema, - ) - - return delete_app_response diff --git a/src/tower/tower_api_client/models/delete_authenticator_params.py b/src/tower/tower_api_client/models/delete_authenticator_params.py deleted file mode 100644 index 375f3c9b..00000000 --- a/src/tower/tower_api_client/models/delete_authenticator_params.py +++ /dev/null @@ -1,54 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="DeleteAuthenticatorParams") - - -@_attrs_define -class DeleteAuthenticatorParams: - """ - Attributes: - authenticator_id (str): The ID of the authenticator to delete - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DeleteAuthenticatorParams.json. - """ - - authenticator_id: str - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - authenticator_id = self.authenticator_id - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "authenticator_id": authenticator_id, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - authenticator_id = d.pop("authenticator_id") - - schema = d.pop("$schema", UNSET) - - delete_authenticator_params = cls( - authenticator_id=authenticator_id, - schema=schema, - ) - - return delete_authenticator_params diff --git a/src/tower/tower_api_client/models/delete_authenticator_response.py b/src/tower/tower_api_client/models/delete_authenticator_response.py deleted file mode 100644 index e4076887..00000000 --- a/src/tower/tower_api_client/models/delete_authenticator_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.verified_authenticator import VerifiedAuthenticator - - -T = TypeVar("T", bound="DeleteAuthenticatorResponse") - - -@_attrs_define -class DeleteAuthenticatorResponse: - """ - Attributes: - authenticator (VerifiedAuthenticator): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DeleteAuthenticatorResponse.json. - """ - - authenticator: VerifiedAuthenticator - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - authenticator = self.authenticator.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "authenticator": authenticator, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.verified_authenticator import VerifiedAuthenticator - - d = dict(src_dict) - authenticator = VerifiedAuthenticator.from_dict(d.pop("authenticator")) - - schema = d.pop("$schema", UNSET) - - delete_authenticator_response = cls( - authenticator=authenticator, - schema=schema, - ) - - return delete_authenticator_response diff --git a/src/tower/tower_api_client/models/delete_catalog_response.py b/src/tower/tower_api_client/models/delete_catalog_response.py deleted file mode 100644 index 296e6813..00000000 --- a/src/tower/tower_api_client/models/delete_catalog_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.catalog import Catalog - - -T = TypeVar("T", bound="DeleteCatalogResponse") - - -@_attrs_define -class DeleteCatalogResponse: - """ - Attributes: - catalog (Catalog): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DeleteCatalogResponse.json. - """ - - catalog: Catalog - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - catalog = self.catalog.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "catalog": catalog, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.catalog import Catalog - - d = dict(src_dict) - catalog = Catalog.from_dict(d.pop("catalog")) - - schema = d.pop("$schema", UNSET) - - delete_catalog_response = cls( - catalog=catalog, - schema=schema, - ) - - return delete_catalog_response diff --git a/src/tower/tower_api_client/models/delete_guest_output_body.py b/src/tower/tower_api_client/models/delete_guest_output_body.py deleted file mode 100644 index 92e6d613..00000000 --- a/src/tower/tower_api_client/models/delete_guest_output_body.py +++ /dev/null @@ -1,43 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="DeleteGuestOutputBody") - - -@_attrs_define -class DeleteGuestOutputBody: - """ - Attributes: - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DeleteGuestOutputBody.json. - """ - - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - schema = d.pop("$schema", UNSET) - - delete_guest_output_body = cls( - schema=schema, - ) - - return delete_guest_output_body diff --git a/src/tower/tower_api_client/models/delete_schedule_params.py b/src/tower/tower_api_client/models/delete_schedule_params.py deleted file mode 100644 index 81b6f2be..00000000 --- a/src/tower/tower_api_client/models/delete_schedule_params.py +++ /dev/null @@ -1,54 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="DeleteScheduleParams") - - -@_attrs_define -class DeleteScheduleParams: - """ - Attributes: - ids (list[str]): The IDs of the schedules to delete. - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DeleteScheduleParams.json. - """ - - ids: list[str] - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - ids = self.ids - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "ids": ids, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - ids = cast(list[str], d.pop("ids")) - - schema = d.pop("$schema", UNSET) - - delete_schedule_params = cls( - ids=ids, - schema=schema, - ) - - return delete_schedule_params diff --git a/src/tower/tower_api_client/models/delete_schedule_response.py b/src/tower/tower_api_client/models/delete_schedule_response.py deleted file mode 100644 index 9f18199e..00000000 --- a/src/tower/tower_api_client/models/delete_schedule_response.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.schedule import Schedule - - -T = TypeVar("T", bound="DeleteScheduleResponse") - - -@_attrs_define -class DeleteScheduleResponse: - """ - Attributes: - schedules (list[Schedule]): the schedules successfully deleted - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DeleteScheduleResponse.json. - """ - - schedules: list[Schedule] - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - schedules = [] - for schedules_item_data in self.schedules: - schedules_item = schedules_item_data.to_dict() - schedules.append(schedules_item) - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "schedules": schedules, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.schedule import Schedule - - d = dict(src_dict) - schedules = [] - _schedules = d.pop("schedules") - for schedules_item_data in _schedules: - schedules_item = Schedule.from_dict(schedules_item_data) - - schedules.append(schedules_item) - - schema = d.pop("$schema", UNSET) - - delete_schedule_response = cls( - schedules=schedules, - schema=schema, - ) - - return delete_schedule_response diff --git a/src/tower/tower_api_client/models/delete_secret_response.py b/src/tower/tower_api_client/models/delete_secret_response.py deleted file mode 100644 index 296708f1..00000000 --- a/src/tower/tower_api_client/models/delete_secret_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.secret import Secret - - -T = TypeVar("T", bound="DeleteSecretResponse") - - -@_attrs_define -class DeleteSecretResponse: - """ - Attributes: - secret (Secret): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DeleteSecretResponse.json. - """ - - secret: Secret - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - secret = self.secret.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "secret": secret, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.secret import Secret - - d = dict(src_dict) - secret = Secret.from_dict(d.pop("secret")) - - schema = d.pop("$schema", UNSET) - - delete_secret_response = cls( - secret=secret, - schema=schema, - ) - - return delete_secret_response diff --git a/src/tower/tower_api_client/models/delete_session_params.py b/src/tower/tower_api_client/models/delete_session_params.py deleted file mode 100644 index a2972c2f..00000000 --- a/src/tower/tower_api_client/models/delete_session_params.py +++ /dev/null @@ -1,52 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="DeleteSessionParams") - - -@_attrs_define -class DeleteSessionParams: - """ - Attributes: - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DeleteSessionParams.json. - session_id (str | Unset): The ID of the session to delete. If not provided, the current session will be deleted. - """ - - schema: str | Unset = UNSET - session_id: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - schema = self.schema - - session_id = self.session_id - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if schema is not UNSET: - field_dict["$schema"] = schema - if session_id is not UNSET: - field_dict["session_id"] = session_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - schema = d.pop("$schema", UNSET) - - session_id = d.pop("session_id", UNSET) - - delete_session_params = cls( - schema=schema, - session_id=session_id, - ) - - return delete_session_params diff --git a/src/tower/tower_api_client/models/delete_session_response.py b/src/tower/tower_api_client/models/delete_session_response.py deleted file mode 100644 index 144f146d..00000000 --- a/src/tower/tower_api_client/models/delete_session_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.session import Session - - -T = TypeVar("T", bound="DeleteSessionResponse") - - -@_attrs_define -class DeleteSessionResponse: - """ - Attributes: - session (Session): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DeleteSessionResponse.json. - """ - - session: Session - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - session = self.session.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "session": session, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.session import Session - - d = dict(src_dict) - session = Session.from_dict(d.pop("session")) - - schema = d.pop("$schema", UNSET) - - delete_session_response = cls( - session=session, - schema=schema, - ) - - return delete_session_response diff --git a/src/tower/tower_api_client/models/delete_team_invitation_params.py b/src/tower/tower_api_client/models/delete_team_invitation_params.py deleted file mode 100644 index 6f380838..00000000 --- a/src/tower/tower_api_client/models/delete_team_invitation_params.py +++ /dev/null @@ -1,54 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="DeleteTeamInvitationParams") - - -@_attrs_define -class DeleteTeamInvitationParams: - """ - Attributes: - email (str): The email address of the team member to remove - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DeleteTeamInvitationParams.json. - """ - - email: str - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - email = self.email - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "email": email, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - email = d.pop("email") - - schema = d.pop("$schema", UNSET) - - delete_team_invitation_params = cls( - email=email, - schema=schema, - ) - - return delete_team_invitation_params diff --git a/src/tower/tower_api_client/models/delete_team_invitation_response.py b/src/tower/tower_api_client/models/delete_team_invitation_response.py deleted file mode 100644 index 50594e98..00000000 --- a/src/tower/tower_api_client/models/delete_team_invitation_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.team_invitation import TeamInvitation - - -T = TypeVar("T", bound="DeleteTeamInvitationResponse") - - -@_attrs_define -class DeleteTeamInvitationResponse: - """ - Attributes: - invitation (TeamInvitation): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DeleteTeamInvitationResponse.json. - """ - - invitation: TeamInvitation - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - invitation = self.invitation.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "invitation": invitation, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.team_invitation import TeamInvitation - - d = dict(src_dict) - invitation = TeamInvitation.from_dict(d.pop("invitation")) - - schema = d.pop("$schema", UNSET) - - delete_team_invitation_response = cls( - invitation=invitation, - schema=schema, - ) - - return delete_team_invitation_response diff --git a/src/tower/tower_api_client/models/delete_team_params.py b/src/tower/tower_api_client/models/delete_team_params.py deleted file mode 100644 index 6621caf9..00000000 --- a/src/tower/tower_api_client/models/delete_team_params.py +++ /dev/null @@ -1,54 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="DeleteTeamParams") - - -@_attrs_define -class DeleteTeamParams: - """ - Attributes: - name (str): The name of the team to delete - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DeleteTeamParams.json. - """ - - name: str - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - name = self.name - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "name": name, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - name = d.pop("name") - - schema = d.pop("$schema", UNSET) - - delete_team_params = cls( - name=name, - schema=schema, - ) - - return delete_team_params diff --git a/src/tower/tower_api_client/models/delete_team_response.py b/src/tower/tower_api_client/models/delete_team_response.py deleted file mode 100644 index efb2335f..00000000 --- a/src/tower/tower_api_client/models/delete_team_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.team import Team - - -T = TypeVar("T", bound="DeleteTeamResponse") - - -@_attrs_define -class DeleteTeamResponse: - """ - Attributes: - team (Team): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DeleteTeamResponse.json. - """ - - team: Team - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - team = self.team.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "team": team, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.team import Team - - d = dict(src_dict) - team = Team.from_dict(d.pop("team")) - - schema = d.pop("$schema", UNSET) - - delete_team_response = cls( - team=team, - schema=schema, - ) - - return delete_team_response diff --git a/src/tower/tower_api_client/models/delete_webhook_response.py b/src/tower/tower_api_client/models/delete_webhook_response.py deleted file mode 100644 index f62d5f75..00000000 --- a/src/tower/tower_api_client/models/delete_webhook_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.webhook import Webhook - - -T = TypeVar("T", bound="DeleteWebhookResponse") - - -@_attrs_define -class DeleteWebhookResponse: - """ - Attributes: - webhook (Webhook): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DeleteWebhookResponse.json. - """ - - webhook: Webhook - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - webhook = self.webhook.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "webhook": webhook, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.webhook import Webhook - - d = dict(src_dict) - webhook = Webhook.from_dict(d.pop("webhook")) - - schema = d.pop("$schema", UNSET) - - delete_webhook_response = cls( - webhook=webhook, - schema=schema, - ) - - return delete_webhook_response diff --git a/src/tower/tower_api_client/models/deploy_app_json_body.py b/src/tower/tower_api_client/models/deploy_app_json_body.py deleted file mode 100644 index 6109dff8..00000000 --- a/src/tower/tower_api_client/models/deploy_app_json_body.py +++ /dev/null @@ -1,64 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="DeployAppJsonBody") - - -@_attrs_define -class DeployAppJsonBody: - """ - Example: - {'source_uri': 'https://github.com/tower/tower-examples/tree/main/01-hello-world'} - - Attributes: - source_uri (str): GitHub repository URL for deploying from source - """ - - source_uri: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - source_uri = self.source_uri - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "source_uri": source_uri, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - source_uri = d.pop("source_uri") - - deploy_app_json_body = cls( - source_uri=source_uri, - ) - - deploy_app_json_body.additional_properties = d - return deploy_app_json_body - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/tower/tower_api_client/models/deploy_app_response.py b/src/tower/tower_api_client/models/deploy_app_response.py deleted file mode 100644 index f79f32b2..00000000 --- a/src/tower/tower_api_client/models/deploy_app_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.app_version import AppVersion - - -T = TypeVar("T", bound="DeployAppResponse") - - -@_attrs_define -class DeployAppResponse: - """ - Attributes: - version (AppVersion): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DeployAppResponse.json. - """ - - version: AppVersion - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - version = self.version.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "version": version, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.app_version import AppVersion - - d = dict(src_dict) - version = AppVersion.from_dict(d.pop("version")) - - schema = d.pop("$schema", UNSET) - - deploy_app_response = cls( - version=version, - schema=schema, - ) - - return deploy_app_response diff --git a/src/tower/tower_api_client/models/describe_account_body.py b/src/tower/tower_api_client/models/describe_account_body.py deleted file mode 100644 index dd52a92e..00000000 --- a/src/tower/tower_api_client/models/describe_account_body.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.account import Account - - -T = TypeVar("T", bound="DescribeAccountBody") - - -@_attrs_define -class DescribeAccountBody: - """ - Attributes: - account (Account): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DescribeAccountBody.json. - """ - - account: Account - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - account = self.account.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "account": account, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.account import Account - - d = dict(src_dict) - account = Account.from_dict(d.pop("account")) - - schema = d.pop("$schema", UNSET) - - describe_account_body = cls( - account=account, - schema=schema, - ) - - return describe_account_body diff --git a/src/tower/tower_api_client/models/describe_app_response.py b/src/tower/tower_api_client/models/describe_app_response.py deleted file mode 100644 index 6609f92d..00000000 --- a/src/tower/tower_api_client/models/describe_app_response.py +++ /dev/null @@ -1,78 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.app import App - from ..models.run import Run - - -T = TypeVar("T", bound="DescribeAppResponse") - - -@_attrs_define -class DescribeAppResponse: - """ - Attributes: - app (App): - runs (list[Run]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DescribeAppResponse.json. - """ - - app: App - runs: list[Run] - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - app = self.app.to_dict() - - runs = [] - for runs_item_data in self.runs: - runs_item = runs_item_data.to_dict() - runs.append(runs_item) - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "app": app, - "runs": runs, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.app import App - from ..models.run import Run - - d = dict(src_dict) - app = App.from_dict(d.pop("app")) - - runs = [] - _runs = d.pop("runs") - for runs_item_data in _runs: - runs_item = Run.from_dict(runs_item_data) - - runs.append(runs_item) - - schema = d.pop("$schema", UNSET) - - describe_app_response = cls( - app=app, - runs=runs, - schema=schema, - ) - - return describe_app_response diff --git a/src/tower/tower_api_client/models/describe_app_version_response.py b/src/tower/tower_api_client/models/describe_app_version_response.py deleted file mode 100644 index a073e3e5..00000000 --- a/src/tower/tower_api_client/models/describe_app_version_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.app_version import AppVersion - - -T = TypeVar("T", bound="DescribeAppVersionResponse") - - -@_attrs_define -class DescribeAppVersionResponse: - """ - Attributes: - version (AppVersion): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DescribeAppVersionResponse.json. - """ - - version: AppVersion - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - version = self.version.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "version": version, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.app_version import AppVersion - - d = dict(src_dict) - version = AppVersion.from_dict(d.pop("version")) - - schema = d.pop("$schema", UNSET) - - describe_app_version_response = cls( - version=version, - schema=schema, - ) - - return describe_app_version_response diff --git a/src/tower/tower_api_client/models/describe_authentication_context_body.py b/src/tower/tower_api_client/models/describe_authentication_context_body.py deleted file mode 100644 index b0e5b414..00000000 --- a/src/tower/tower_api_client/models/describe_authentication_context_body.py +++ /dev/null @@ -1,62 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.authentication_context import AuthenticationContext - - -T = TypeVar("T", bound="DescribeAuthenticationContextBody") - - -@_attrs_define -class DescribeAuthenticationContextBody: - """ - Attributes: - authentication_context (AuthenticationContext): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DescribeAuthenticationContextBody.json. - """ - - authentication_context: AuthenticationContext - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - authentication_context = self.authentication_context.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "authentication_context": authentication_context, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.authentication_context import AuthenticationContext - - d = dict(src_dict) - authentication_context = AuthenticationContext.from_dict( - d.pop("authentication_context") - ) - - schema = d.pop("$schema", UNSET) - - describe_authentication_context_body = cls( - authentication_context=authentication_context, - schema=schema, - ) - - return describe_authentication_context_body diff --git a/src/tower/tower_api_client/models/describe_catalog_response.py b/src/tower/tower_api_client/models/describe_catalog_response.py deleted file mode 100644 index a4ff7be9..00000000 --- a/src/tower/tower_api_client/models/describe_catalog_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.catalog import Catalog - - -T = TypeVar("T", bound="DescribeCatalogResponse") - - -@_attrs_define -class DescribeCatalogResponse: - """ - Attributes: - catalog (Catalog): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DescribeCatalogResponse.json. - """ - - catalog: Catalog - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - catalog = self.catalog.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "catalog": catalog, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.catalog import Catalog - - d = dict(src_dict) - catalog = Catalog.from_dict(d.pop("catalog")) - - schema = d.pop("$schema", UNSET) - - describe_catalog_response = cls( - catalog=catalog, - schema=schema, - ) - - return describe_catalog_response diff --git a/src/tower/tower_api_client/models/describe_device_login_session_response.py b/src/tower/tower_api_client/models/describe_device_login_session_response.py deleted file mode 100644 index 807a7cd0..00000000 --- a/src/tower/tower_api_client/models/describe_device_login_session_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.session import Session - - -T = TypeVar("T", bound="DescribeDeviceLoginSessionResponse") - - -@_attrs_define -class DescribeDeviceLoginSessionResponse: - """ - Attributes: - session (Session): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DescribeDeviceLoginSessionResponse.json. - """ - - session: Session - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - session = self.session.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "session": session, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.session import Session - - d = dict(src_dict) - session = Session.from_dict(d.pop("session")) - - schema = d.pop("$schema", UNSET) - - describe_device_login_session_response = cls( - session=session, - schema=schema, - ) - - return describe_device_login_session_response diff --git a/src/tower/tower_api_client/models/describe_email_preferences_body.py b/src/tower/tower_api_client/models/describe_email_preferences_body.py deleted file mode 100644 index 9c554994..00000000 --- a/src/tower/tower_api_client/models/describe_email_preferences_body.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.email_subscriptions import EmailSubscriptions - - -T = TypeVar("T", bound="DescribeEmailPreferencesBody") - - -@_attrs_define -class DescribeEmailPreferencesBody: - """ - Attributes: - subscriptions (EmailSubscriptions): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DescribeEmailPreferencesBody.json. - """ - - subscriptions: EmailSubscriptions - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - subscriptions = self.subscriptions.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "subscriptions": subscriptions, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.email_subscriptions import EmailSubscriptions - - d = dict(src_dict) - subscriptions = EmailSubscriptions.from_dict(d.pop("subscriptions")) - - schema = d.pop("$schema", UNSET) - - describe_email_preferences_body = cls( - subscriptions=subscriptions, - schema=schema, - ) - - return describe_email_preferences_body diff --git a/src/tower/tower_api_client/models/describe_plan_response.py b/src/tower/tower_api_client/models/describe_plan_response.py deleted file mode 100644 index 3b6e8416..00000000 --- a/src/tower/tower_api_client/models/describe_plan_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.plan import Plan - - -T = TypeVar("T", bound="DescribePlanResponse") - - -@_attrs_define -class DescribePlanResponse: - """ - Attributes: - plan (Plan): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DescribePlanResponse.json. - """ - - plan: Plan - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - plan = self.plan.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "plan": plan, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.plan import Plan - - d = dict(src_dict) - plan = Plan.from_dict(d.pop("plan")) - - schema = d.pop("$schema", UNSET) - - describe_plan_response = cls( - plan=plan, - schema=schema, - ) - - return describe_plan_response diff --git a/src/tower/tower_api_client/models/describe_run_graph_response.py b/src/tower/tower_api_client/models/describe_run_graph_response.py deleted file mode 100644 index 2f3d3230..00000000 --- a/src/tower/tower_api_client/models/describe_run_graph_response.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.run_graph_node import RunGraphNode - - -T = TypeVar("T", bound="DescribeRunGraphResponse") - - -@_attrs_define -class DescribeRunGraphResponse: - """ - Attributes: - runs (list[RunGraphNode]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DescribeRunGraphResponse.json. - """ - - runs: list[RunGraphNode] - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - runs = [] - for runs_item_data in self.runs: - runs_item = runs_item_data.to_dict() - runs.append(runs_item) - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "runs": runs, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.run_graph_node import RunGraphNode - - d = dict(src_dict) - runs = [] - _runs = d.pop("runs") - for runs_item_data in _runs: - runs_item = RunGraphNode.from_dict(runs_item_data) - - runs.append(runs_item) - - schema = d.pop("$schema", UNSET) - - describe_run_graph_response = cls( - runs=runs, - schema=schema, - ) - - return describe_run_graph_response diff --git a/src/tower/tower_api_client/models/describe_run_links.py b/src/tower/tower_api_client/models/describe_run_links.py deleted file mode 100644 index 53fe1471..00000000 --- a/src/tower/tower_api_client/models/describe_run_links.py +++ /dev/null @@ -1,99 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define - -T = TypeVar("T", bound="DescribeRunLinks") - - -@_attrs_define -class DescribeRunLinks: - """ - Attributes: - next_ (None | str): The URL of the next run, if any. - next_number (int | None): The number of the next run, if any. - prev (None | str): The URL of the previous run, if any. - prev_number (int | None): The number of the previous run, if any. - self_ (str): The URL of this run. - """ - - next_: None | str - next_number: int | None - prev: None | str - prev_number: int | None - self_: str - - def to_dict(self) -> dict[str, Any]: - next_: None | str - next_ = self.next_ - - next_number: int | None - next_number = self.next_number - - prev: None | str - prev = self.prev - - prev_number: int | None - prev_number = self.prev_number - - self_ = self.self_ - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "next": next_, - "next_number": next_number, - "prev": prev, - "prev_number": prev_number, - "self": self_, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_next_(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - next_ = _parse_next_(d.pop("next")) - - def _parse_next_number(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - next_number = _parse_next_number(d.pop("next_number")) - - def _parse_prev(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - prev = _parse_prev(d.pop("prev")) - - def _parse_prev_number(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - prev_number = _parse_prev_number(d.pop("prev_number")) - - self_ = d.pop("self") - - describe_run_links = cls( - next_=next_, - next_number=next_number, - prev=prev, - prev_number=prev_number, - self_=self_, - ) - - return describe_run_links diff --git a/src/tower/tower_api_client/models/describe_run_logs_response.py b/src/tower/tower_api_client/models/describe_run_logs_response.py deleted file mode 100644 index 9140272f..00000000 --- a/src/tower/tower_api_client/models/describe_run_logs_response.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.run_log_line import RunLogLine - - -T = TypeVar("T", bound="DescribeRunLogsResponse") - - -@_attrs_define -class DescribeRunLogsResponse: - """ - Attributes: - log_lines (list[RunLogLine]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DescribeRunLogsResponse.json. - """ - - log_lines: list[RunLogLine] - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - log_lines = [] - for log_lines_item_data in self.log_lines: - log_lines_item = log_lines_item_data.to_dict() - log_lines.append(log_lines_item) - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "log_lines": log_lines, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.run_log_line import RunLogLine - - d = dict(src_dict) - log_lines = [] - _log_lines = d.pop("log_lines") - for log_lines_item_data in _log_lines: - log_lines_item = RunLogLine.from_dict(log_lines_item_data) - - log_lines.append(log_lines_item) - - schema = d.pop("$schema", UNSET) - - describe_run_logs_response = cls( - log_lines=log_lines, - schema=schema, - ) - - return describe_run_logs_response diff --git a/src/tower/tower_api_client/models/describe_run_response.py b/src/tower/tower_api_client/models/describe_run_response.py deleted file mode 100644 index eb1a0fa8..00000000 --- a/src/tower/tower_api_client/models/describe_run_response.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.describe_run_links import DescribeRunLinks - from ..models.run import Run - - -T = TypeVar("T", bound="DescribeRunResponse") - - -@_attrs_define -class DescribeRunResponse: - """ - Attributes: - links (DescribeRunLinks): - run (Run): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DescribeRunResponse.json. - """ - - links: DescribeRunLinks - run: Run - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - links = self.links.to_dict() - - run = self.run.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "$links": links, - "run": run, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.describe_run_links import DescribeRunLinks - from ..models.run import Run - - d = dict(src_dict) - links = DescribeRunLinks.from_dict(d.pop("$links")) - - run = Run.from_dict(d.pop("run")) - - schema = d.pop("$schema", UNSET) - - describe_run_response = cls( - links=links, - run=run, - schema=schema, - ) - - return describe_run_response diff --git a/src/tower/tower_api_client/models/describe_secrets_key_response.py b/src/tower/tower_api_client/models/describe_secrets_key_response.py deleted file mode 100644 index 855a4cdd..00000000 --- a/src/tower/tower_api_client/models/describe_secrets_key_response.py +++ /dev/null @@ -1,54 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="DescribeSecretsKeyResponse") - - -@_attrs_define -class DescribeSecretsKeyResponse: - """ - Attributes: - public_key (str): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DescribeSecretsKeyResponse.json. - """ - - public_key: str - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - public_key = self.public_key - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "public_key": public_key, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - public_key = d.pop("public_key") - - schema = d.pop("$schema", UNSET) - - describe_secrets_key_response = cls( - public_key=public_key, - schema=schema, - ) - - return describe_secrets_key_response diff --git a/src/tower/tower_api_client/models/describe_session_response.py b/src/tower/tower_api_client/models/describe_session_response.py deleted file mode 100644 index 132b2c0b..00000000 --- a/src/tower/tower_api_client/models/describe_session_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.session import Session - - -T = TypeVar("T", bound="DescribeSessionResponse") - - -@_attrs_define -class DescribeSessionResponse: - """ - Attributes: - session (Session): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DescribeSessionResponse.json. - """ - - session: Session - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - session = self.session.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "session": session, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.session import Session - - d = dict(src_dict) - session = Session.from_dict(d.pop("session")) - - schema = d.pop("$schema", UNSET) - - describe_session_response = cls( - session=session, - schema=schema, - ) - - return describe_session_response diff --git a/src/tower/tower_api_client/models/describe_team_response.py b/src/tower/tower_api_client/models/describe_team_response.py deleted file mode 100644 index 1d065bef..00000000 --- a/src/tower/tower_api_client/models/describe_team_response.py +++ /dev/null @@ -1,96 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.team import Team - from ..models.team_invitation import TeamInvitation - from ..models.user import User - - -T = TypeVar("T", bound="DescribeTeamResponse") - - -@_attrs_define -class DescribeTeamResponse: - """ - Attributes: - invitations (list[TeamInvitation]): Pending team invitations - members (list[User]): The members of the team - team (Team): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DescribeTeamResponse.json. - """ - - invitations: list[TeamInvitation] - members: list[User] - team: Team - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - invitations = [] - for invitations_item_data in self.invitations: - invitations_item = invitations_item_data.to_dict() - invitations.append(invitations_item) - - members = [] - for members_item_data in self.members: - members_item = members_item_data.to_dict() - members.append(members_item) - - team = self.team.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "invitations": invitations, - "members": members, - "team": team, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.team import Team - from ..models.team_invitation import TeamInvitation - from ..models.user import User - - d = dict(src_dict) - invitations = [] - _invitations = d.pop("invitations") - for invitations_item_data in _invitations: - invitations_item = TeamInvitation.from_dict(invitations_item_data) - - invitations.append(invitations_item) - - members = [] - _members = d.pop("members") - for members_item_data in _members: - members_item = User.from_dict(members_item_data) - - members.append(members_item) - - team = Team.from_dict(d.pop("team")) - - schema = d.pop("$schema", UNSET) - - describe_team_response = cls( - invitations=invitations, - members=members, - team=team, - schema=schema, - ) - - return describe_team_response diff --git a/src/tower/tower_api_client/models/describe_webhook_response.py b/src/tower/tower_api_client/models/describe_webhook_response.py deleted file mode 100644 index 0d34a83e..00000000 --- a/src/tower/tower_api_client/models/describe_webhook_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.webhook import Webhook - - -T = TypeVar("T", bound="DescribeWebhookResponse") - - -@_attrs_define -class DescribeWebhookResponse: - """ - Attributes: - webhook (Webhook): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/DescribeWebhookResponse.json. - """ - - webhook: Webhook - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - webhook = self.webhook.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "webhook": webhook, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.webhook import Webhook - - d = dict(src_dict) - webhook = Webhook.from_dict(d.pop("webhook")) - - schema = d.pop("$schema", UNSET) - - describe_webhook_response = cls( - webhook=webhook, - schema=schema, - ) - - return describe_webhook_response diff --git a/src/tower/tower_api_client/models/email_subscriptions.py b/src/tower/tower_api_client/models/email_subscriptions.py deleted file mode 100644 index c83bc98c..00000000 --- a/src/tower/tower_api_client/models/email_subscriptions.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="EmailSubscriptions") - - -@_attrs_define -class EmailSubscriptions: - """ - Attributes: - feature_updates (bool | Unset): - marketing_emails (bool | Unset): - tower_newsletter (bool | Unset): - """ - - feature_updates: bool | Unset = UNSET - marketing_emails: bool | Unset = UNSET - tower_newsletter: bool | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - feature_updates = self.feature_updates - - marketing_emails = self.marketing_emails - - tower_newsletter = self.tower_newsletter - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if feature_updates is not UNSET: - field_dict["feature_updates"] = feature_updates - if marketing_emails is not UNSET: - field_dict["marketing_emails"] = marketing_emails - if tower_newsletter is not UNSET: - field_dict["tower_newsletter"] = tower_newsletter - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - feature_updates = d.pop("feature_updates", UNSET) - - marketing_emails = d.pop("marketing_emails", UNSET) - - tower_newsletter = d.pop("tower_newsletter", UNSET) - - email_subscriptions = cls( - feature_updates=feature_updates, - marketing_emails=marketing_emails, - tower_newsletter=tower_newsletter, - ) - - return email_subscriptions diff --git a/src/tower/tower_api_client/models/encrypted_catalog_property.py b/src/tower/tower_api_client/models/encrypted_catalog_property.py deleted file mode 100644 index 368ee0d6..00000000 --- a/src/tower/tower_api_client/models/encrypted_catalog_property.py +++ /dev/null @@ -1,58 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -T = TypeVar("T", bound="EncryptedCatalogProperty") - - -@_attrs_define -class EncryptedCatalogProperty: - """ - Attributes: - encrypted_value (str): - name (str): - preview (str): - """ - - encrypted_value: str - name: str - preview: str - - def to_dict(self) -> dict[str, Any]: - encrypted_value = self.encrypted_value - - name = self.name - - preview = self.preview - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "encrypted_value": encrypted_value, - "name": name, - "preview": preview, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - encrypted_value = d.pop("encrypted_value") - - name = d.pop("name") - - preview = d.pop("preview") - - encrypted_catalog_property = cls( - encrypted_value=encrypted_value, - name=name, - preview=preview, - ) - - return encrypted_catalog_property diff --git a/src/tower/tower_api_client/models/environment.py b/src/tower/tower_api_client/models/environment.py deleted file mode 100644 index 065ebd2e..00000000 --- a/src/tower/tower_api_client/models/environment.py +++ /dev/null @@ -1,42 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -T = TypeVar("T", bound="Environment") - - -@_attrs_define -class Environment: - """ - Attributes: - name (str): The human readable name for the environment - """ - - name: str - - def to_dict(self) -> dict[str, Any]: - name = self.name - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "name": name, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - name = d.pop("name") - - environment = cls( - name=name, - ) - - return environment diff --git a/src/tower/tower_api_client/models/error_detail.py b/src/tower/tower_api_client/models/error_detail.py deleted file mode 100644 index fbcb181a..00000000 --- a/src/tower/tower_api_client/models/error_detail.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="ErrorDetail") - - -@_attrs_define -class ErrorDetail: - """ - Attributes: - location (str | Unset): Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id' - message (str | Unset): Error message text - value (Any | Unset): The value at the given location - """ - - location: str | Unset = UNSET - message: str | Unset = UNSET - value: Any | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - location = self.location - - message = self.message - - value = self.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if location is not UNSET: - field_dict["location"] = location - if message is not UNSET: - field_dict["message"] = message - if value is not UNSET: - field_dict["value"] = value - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - location = d.pop("location", UNSET) - - message = d.pop("message", UNSET) - - value = d.pop("value", UNSET) - - error_detail = cls( - location=location, - message=message, - value=value, - ) - - return error_detail diff --git a/src/tower/tower_api_client/models/error_model.py b/src/tower/tower_api_client/models/error_model.py deleted file mode 100644 index 64710047..00000000 --- a/src/tower/tower_api_client/models/error_model.py +++ /dev/null @@ -1,119 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.error_detail import ErrorDetail - - -T = TypeVar("T", bound="ErrorModel") - - -@_attrs_define -class ErrorModel: - """ - Attributes: - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/ErrorModel.json. - detail (str | Unset): A human-readable explanation specific to this occurrence of the problem. Example: Property - foo is required but is missing.. - errors (list[ErrorDetail] | Unset): Optional list of individual error details - instance (str | Unset): A URI reference that identifies the specific occurrence of the problem. Example: - https://example.com/error-log/abc123. - status (int | Unset): HTTP status code Example: 400. - title (str | Unset): A short, human-readable summary of the problem type. This value should not change between - occurrences of the error. Example: Bad Request. - type_ (str | Unset): A URI reference to human-readable documentation for the error. Default: 'about:blank'. - Example: https://example.com/errors/example. - """ - - schema: str | Unset = UNSET - detail: str | Unset = UNSET - errors: list[ErrorDetail] | Unset = UNSET - instance: str | Unset = UNSET - status: int | Unset = UNSET - title: str | Unset = UNSET - type_: str | Unset = "about:blank" - - def to_dict(self) -> dict[str, Any]: - schema = self.schema - - detail = self.detail - - errors: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.errors, Unset): - errors = [] - for errors_item_data in self.errors: - errors_item = errors_item_data.to_dict() - errors.append(errors_item) - - instance = self.instance - - status = self.status - - title = self.title - - type_ = self.type_ - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if schema is not UNSET: - field_dict["$schema"] = schema - if detail is not UNSET: - field_dict["detail"] = detail - if errors is not UNSET: - field_dict["errors"] = errors - if instance is not UNSET: - field_dict["instance"] = instance - if status is not UNSET: - field_dict["status"] = status - if title is not UNSET: - field_dict["title"] = title - if type_ is not UNSET: - field_dict["type"] = type_ - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.error_detail import ErrorDetail - - d = dict(src_dict) - schema = d.pop("$schema", UNSET) - - detail = d.pop("detail", UNSET) - - _errors = d.pop("errors", UNSET) - errors: list[ErrorDetail] | Unset = UNSET - if _errors is not UNSET: - errors = [] - for errors_item_data in _errors: - errors_item = ErrorDetail.from_dict(errors_item_data) - - errors.append(errors_item) - - instance = d.pop("instance", UNSET) - - status = d.pop("status", UNSET) - - title = d.pop("title", UNSET) - - type_ = d.pop("type", UNSET) - - error_model = cls( - schema=schema, - detail=detail, - errors=errors, - instance=instance, - status=status, - title=title, - type_=type_, - ) - - return error_model diff --git a/src/tower/tower_api_client/models/export_catalogs_params.py b/src/tower/tower_api_client/models/export_catalogs_params.py deleted file mode 100644 index 8183ce47..00000000 --- a/src/tower/tower_api_client/models/export_catalogs_params.py +++ /dev/null @@ -1,86 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="ExportCatalogsParams") - - -@_attrs_define -class ExportCatalogsParams: - """ - Attributes: - all_ (bool): Whether to fetch all catalogs or only the ones in the supplied environment. Default: False. - environment (str): The environment to filter by. Default: 'default'. - page (int): The page number to fetch. Default: 1. - page_size (int): The number of records to fetch on each page. Default: 20. - public_key (str): The PEM-encoded public key you want to use to encrypt sensitive catalog properties. - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/ExportCatalogsParams.json. - """ - - public_key: str - all_: bool = False - environment: str = "default" - page: int = 1 - page_size: int = 20 - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - all_ = self.all_ - - environment = self.environment - - page = self.page - - page_size = self.page_size - - public_key = self.public_key - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "all": all_, - "environment": environment, - "page": page, - "page_size": page_size, - "public_key": public_key, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - all_ = d.pop("all") - - environment = d.pop("environment") - - page = d.pop("page") - - page_size = d.pop("page_size") - - public_key = d.pop("public_key") - - schema = d.pop("$schema", UNSET) - - export_catalogs_params = cls( - all_=all_, - environment=environment, - page=page, - page_size=page_size, - public_key=public_key, - schema=schema, - ) - - return export_catalogs_params diff --git a/src/tower/tower_api_client/models/export_catalogs_response.py b/src/tower/tower_api_client/models/export_catalogs_response.py deleted file mode 100644 index 967665bf..00000000 --- a/src/tower/tower_api_client/models/export_catalogs_response.py +++ /dev/null @@ -1,78 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.exported_catalog import ExportedCatalog - from ..models.pagination import Pagination - - -T = TypeVar("T", bound="ExportCatalogsResponse") - - -@_attrs_define -class ExportCatalogsResponse: - """ - Attributes: - catalogs (list[ExportedCatalog]): - pages (Pagination): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/ExportCatalogsResponse.json. - """ - - catalogs: list[ExportedCatalog] - pages: Pagination - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - catalogs = [] - for catalogs_item_data in self.catalogs: - catalogs_item = catalogs_item_data.to_dict() - catalogs.append(catalogs_item) - - pages = self.pages.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "catalogs": catalogs, - "pages": pages, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.exported_catalog import ExportedCatalog - from ..models.pagination import Pagination - - d = dict(src_dict) - catalogs = [] - _catalogs = d.pop("catalogs") - for catalogs_item_data in _catalogs: - catalogs_item = ExportedCatalog.from_dict(catalogs_item_data) - - catalogs.append(catalogs_item) - - pages = Pagination.from_dict(d.pop("pages")) - - schema = d.pop("$schema", UNSET) - - export_catalogs_response = cls( - catalogs=catalogs, - pages=pages, - schema=schema, - ) - - return export_catalogs_response diff --git a/src/tower/tower_api_client/models/export_secrets_params.py b/src/tower/tower_api_client/models/export_secrets_params.py deleted file mode 100644 index a4ffbedc..00000000 --- a/src/tower/tower_api_client/models/export_secrets_params.py +++ /dev/null @@ -1,86 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="ExportSecretsParams") - - -@_attrs_define -class ExportSecretsParams: - """ - Attributes: - all_ (bool): Whether to fetch all secrets or only the ones that are not marked as deleted. Default: False. - environment (str): The environment to filter by. Default: 'default'. - page (int): The page number to fetch. Default: 1. - page_size (int): The number of records to fetch on each page. Default: 20. - public_key (str): The PEM-encoded public key you want to use to encrypt sensitive secret values. - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/ExportSecretsParams.json. - """ - - public_key: str - all_: bool = False - environment: str = "default" - page: int = 1 - page_size: int = 20 - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - all_ = self.all_ - - environment = self.environment - - page = self.page - - page_size = self.page_size - - public_key = self.public_key - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "all": all_, - "environment": environment, - "page": page, - "page_size": page_size, - "public_key": public_key, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - all_ = d.pop("all") - - environment = d.pop("environment") - - page = d.pop("page") - - page_size = d.pop("page_size") - - public_key = d.pop("public_key") - - schema = d.pop("$schema", UNSET) - - export_secrets_params = cls( - all_=all_, - environment=environment, - page=page, - page_size=page_size, - public_key=public_key, - schema=schema, - ) - - return export_secrets_params diff --git a/src/tower/tower_api_client/models/export_secrets_response.py b/src/tower/tower_api_client/models/export_secrets_response.py deleted file mode 100644 index 7002e11e..00000000 --- a/src/tower/tower_api_client/models/export_secrets_response.py +++ /dev/null @@ -1,78 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.exported_secret import ExportedSecret - from ..models.pagination import Pagination - - -T = TypeVar("T", bound="ExportSecretsResponse") - - -@_attrs_define -class ExportSecretsResponse: - """ - Attributes: - pages (Pagination): - secrets (list[ExportedSecret]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/ExportSecretsResponse.json. - """ - - pages: Pagination - secrets: list[ExportedSecret] - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - pages = self.pages.to_dict() - - secrets = [] - for secrets_item_data in self.secrets: - secrets_item = secrets_item_data.to_dict() - secrets.append(secrets_item) - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "pages": pages, - "secrets": secrets, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.exported_secret import ExportedSecret - from ..models.pagination import Pagination - - d = dict(src_dict) - pages = Pagination.from_dict(d.pop("pages")) - - secrets = [] - _secrets = d.pop("secrets") - for secrets_item_data in _secrets: - secrets_item = ExportedSecret.from_dict(secrets_item_data) - - secrets.append(secrets_item) - - schema = d.pop("$schema", UNSET) - - export_secrets_response = cls( - pages=pages, - secrets=secrets, - schema=schema, - ) - - return export_secrets_response diff --git a/src/tower/tower_api_client/models/exported_catalog.py b/src/tower/tower_api_client/models/exported_catalog.py deleted file mode 100644 index 0a18c5db..00000000 --- a/src/tower/tower_api_client/models/exported_catalog.py +++ /dev/null @@ -1,101 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from dateutil.parser import isoparse - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.exported_catalog_property import ExportedCatalogProperty - - -T = TypeVar("T", bound="ExportedCatalog") - - -@_attrs_define -class ExportedCatalog: - """ - Attributes: - created_at (datetime.datetime): - environment (str): - name (str): - properties (list[ExportedCatalogProperty]): - type_ (str): - slug (str | Unset): This property is deprecated. Use name instead. - """ - - created_at: datetime.datetime - environment: str - name: str - properties: list[ExportedCatalogProperty] - type_: str - slug: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - created_at = self.created_at.isoformat() - - environment = self.environment - - name = self.name - - properties = [] - for properties_item_data in self.properties: - properties_item = properties_item_data.to_dict() - properties.append(properties_item) - - type_ = self.type_ - - slug = self.slug - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "CreatedAt": created_at, - "environment": environment, - "name": name, - "properties": properties, - "type": type_, - } - ) - if slug is not UNSET: - field_dict["slug"] = slug - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.exported_catalog_property import ExportedCatalogProperty - - d = dict(src_dict) - created_at = isoparse(d.pop("CreatedAt")) - - environment = d.pop("environment") - - name = d.pop("name") - - properties = [] - _properties = d.pop("properties") - for properties_item_data in _properties: - properties_item = ExportedCatalogProperty.from_dict(properties_item_data) - - properties.append(properties_item) - - type_ = d.pop("type") - - slug = d.pop("slug", UNSET) - - exported_catalog = cls( - created_at=created_at, - environment=environment, - name=name, - properties=properties, - type_=type_, - slug=slug, - ) - - return exported_catalog diff --git a/src/tower/tower_api_client/models/exported_catalog_property.py b/src/tower/tower_api_client/models/exported_catalog_property.py deleted file mode 100644 index 30767aca..00000000 --- a/src/tower/tower_api_client/models/exported_catalog_property.py +++ /dev/null @@ -1,69 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="ExportedCatalogProperty") - - -@_attrs_define -class ExportedCatalogProperty: - """ - Attributes: - encrypted_value (str): - name (str): - preview (str): - environment_variable (str | Unset): The environment variable name this property is injected as at runtime. - """ - - encrypted_value: str - name: str - preview: str - environment_variable: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - encrypted_value = self.encrypted_value - - name = self.name - - preview = self.preview - - environment_variable = self.environment_variable - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "encrypted_value": encrypted_value, - "name": name, - "preview": preview, - } - ) - if environment_variable is not UNSET: - field_dict["environment_variable"] = environment_variable - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - encrypted_value = d.pop("encrypted_value") - - name = d.pop("name") - - preview = d.pop("preview") - - environment_variable = d.pop("environment_variable", UNSET) - - exported_catalog_property = cls( - encrypted_value=encrypted_value, - name=name, - preview=preview, - environment_variable=environment_variable, - ) - - return exported_catalog_property diff --git a/src/tower/tower_api_client/models/exported_secret.py b/src/tower/tower_api_client/models/exported_secret.py deleted file mode 100644 index 608e8609..00000000 --- a/src/tower/tower_api_client/models/exported_secret.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from dateutil.parser import isoparse - -T = TypeVar("T", bound="ExportedSecret") - - -@_attrs_define -class ExportedSecret: - """ - Attributes: - created_at (datetime.datetime): - encrypted_value (str): - environment (str): - name (str): - """ - - created_at: datetime.datetime - encrypted_value: str - environment: str - name: str - - def to_dict(self) -> dict[str, Any]: - created_at = self.created_at.isoformat() - - encrypted_value = self.encrypted_value - - environment = self.environment - - name = self.name - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "created_at": created_at, - "encrypted_value": encrypted_value, - "environment": environment, - "name": name, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - created_at = isoparse(d.pop("created_at")) - - encrypted_value = d.pop("encrypted_value") - - environment = d.pop("environment") - - name = d.pop("name") - - exported_secret = cls( - created_at=created_at, - encrypted_value=encrypted_value, - environment=environment, - name=name, - ) - - return exported_secret diff --git a/src/tower/tower_api_client/models/feature.py b/src/tower/tower_api_client/models/feature.py deleted file mode 100644 index 22c2e91e..00000000 --- a/src/tower/tower_api_client/models/feature.py +++ /dev/null @@ -1,66 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -T = TypeVar("T", bound="Feature") - - -@_attrs_define -class Feature: - """ - Attributes: - code (str): - name (str): - type_ (str): - value (int): - """ - - code: str - name: str - type_: str - value: int - - def to_dict(self) -> dict[str, Any]: - code = self.code - - name = self.name - - type_ = self.type_ - - value = self.value - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "code": code, - "name": name, - "type": type_, - "value": value, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - code = d.pop("code") - - name = d.pop("name") - - type_ = d.pop("type") - - value = d.pop("value") - - feature = cls( - code=code, - name=name, - type_=type_, - value=value, - ) - - return feature diff --git a/src/tower/tower_api_client/models/featurebase_identity.py b/src/tower/tower_api_client/models/featurebase_identity.py deleted file mode 100644 index 129d51a6..00000000 --- a/src/tower/tower_api_client/models/featurebase_identity.py +++ /dev/null @@ -1,50 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -T = TypeVar("T", bound="FeaturebaseIdentity") - - -@_attrs_define -class FeaturebaseIdentity: - """ - Attributes: - company_hash (str): - user_hash (str): - """ - - company_hash: str - user_hash: str - - def to_dict(self) -> dict[str, Any]: - company_hash = self.company_hash - - user_hash = self.user_hash - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "company_hash": company_hash, - "user_hash": user_hash, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - company_hash = d.pop("company_hash") - - user_hash = d.pop("user_hash") - - featurebase_identity = cls( - company_hash=company_hash, - user_hash=user_hash, - ) - - return featurebase_identity diff --git a/src/tower/tower_api_client/models/generate_app_statistics_response.py b/src/tower/tower_api_client/models/generate_app_statistics_response.py deleted file mode 100644 index 175f6ed0..00000000 --- a/src/tower/tower_api_client/models/generate_app_statistics_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.app_statistics import AppStatistics - - -T = TypeVar("T", bound="GenerateAppStatisticsResponse") - - -@_attrs_define -class GenerateAppStatisticsResponse: - """ - Attributes: - statistics (AppStatistics): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/GenerateAppStatisticsResponse.json. - """ - - statistics: AppStatistics - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - statistics = self.statistics.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "statistics": statistics, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.app_statistics import AppStatistics - - d = dict(src_dict) - statistics = AppStatistics.from_dict(d.pop("statistics")) - - schema = d.pop("$schema", UNSET) - - generate_app_statistics_response = cls( - statistics=statistics, - schema=schema, - ) - - return generate_app_statistics_response diff --git a/src/tower/tower_api_client/models/generate_authenticator_response.py b/src/tower/tower_api_client/models/generate_authenticator_response.py deleted file mode 100644 index 1a2a39f0..00000000 --- a/src/tower/tower_api_client/models/generate_authenticator_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.unverified_authenticator import UnverifiedAuthenticator - - -T = TypeVar("T", bound="GenerateAuthenticatorResponse") - - -@_attrs_define -class GenerateAuthenticatorResponse: - """ - Attributes: - authenticator (UnverifiedAuthenticator): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/GenerateAuthenticatorResponse.json. - """ - - authenticator: UnverifiedAuthenticator - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - authenticator = self.authenticator.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "authenticator": authenticator, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.unverified_authenticator import UnverifiedAuthenticator - - d = dict(src_dict) - authenticator = UnverifiedAuthenticator.from_dict(d.pop("authenticator")) - - schema = d.pop("$schema", UNSET) - - generate_authenticator_response = cls( - authenticator=authenticator, - schema=schema, - ) - - return generate_authenticator_response diff --git a/src/tower/tower_api_client/models/generate_run_statistics_response.py b/src/tower/tower_api_client/models/generate_run_statistics_response.py deleted file mode 100644 index babee7b8..00000000 --- a/src/tower/tower_api_client/models/generate_run_statistics_response.py +++ /dev/null @@ -1,88 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.run_statistics import RunStatistics - from ..models.run_timeseries_point import RunTimeseriesPoint - from ..models.statistics_settings import StatisticsSettings - - -T = TypeVar("T", bound="GenerateRunStatisticsResponse") - - -@_attrs_define -class GenerateRunStatisticsResponse: - """ - Attributes: - series (list[RunTimeseriesPoint]): - settings (StatisticsSettings): - stats (RunStatistics): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/GenerateRunStatisticsResponse.json. - """ - - series: list[RunTimeseriesPoint] - settings: StatisticsSettings - stats: RunStatistics - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - series = [] - for series_item_data in self.series: - series_item = series_item_data.to_dict() - series.append(series_item) - - settings = self.settings.to_dict() - - stats = self.stats.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "series": series, - "settings": settings, - "stats": stats, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.run_statistics import RunStatistics - from ..models.run_timeseries_point import RunTimeseriesPoint - from ..models.statistics_settings import StatisticsSettings - - d = dict(src_dict) - series = [] - _series = d.pop("series") - for series_item_data in _series: - series_item = RunTimeseriesPoint.from_dict(series_item_data) - - series.append(series_item) - - settings = StatisticsSettings.from_dict(d.pop("settings")) - - stats = RunStatistics.from_dict(d.pop("stats")) - - schema = d.pop("$schema", UNSET) - - generate_run_statistics_response = cls( - series=series, - settings=settings, - stats=stats, - schema=schema, - ) - - return generate_run_statistics_response diff --git a/src/tower/tower_api_client/models/generate_run_statistics_status_item.py b/src/tower/tower_api_client/models/generate_run_statistics_status_item.py deleted file mode 100644 index 84597b2a..00000000 --- a/src/tower/tower_api_client/models/generate_run_statistics_status_item.py +++ /dev/null @@ -1,14 +0,0 @@ -from enum import Enum - - -class GenerateRunStatisticsStatusItem(str, Enum): - CANCELLED = "cancelled" - CRASHED = "crashed" - ERRORED = "errored" - EXITED = "exited" - PENDING = "pending" - RETRYING = "retrying" - RUNNING = "running" - - def __str__(self) -> str: - return str(self.value) diff --git a/src/tower/tower_api_client/models/generate_runner_credentials_response.py b/src/tower/tower_api_client/models/generate_runner_credentials_response.py deleted file mode 100644 index f00c2ac3..00000000 --- a/src/tower/tower_api_client/models/generate_runner_credentials_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.runner_credentials import RunnerCredentials - - -T = TypeVar("T", bound="GenerateRunnerCredentialsResponse") - - -@_attrs_define -class GenerateRunnerCredentialsResponse: - """ - Attributes: - credentials (RunnerCredentials): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/GenerateRunnerCredentialsResponse.json. - """ - - credentials: RunnerCredentials - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - credentials = self.credentials.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "credentials": credentials, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.runner_credentials import RunnerCredentials - - d = dict(src_dict) - credentials = RunnerCredentials.from_dict(d.pop("credentials")) - - schema = d.pop("$schema", UNSET) - - generate_runner_credentials_response = cls( - credentials=credentials, - schema=schema, - ) - - return generate_runner_credentials_response diff --git a/src/tower/tower_api_client/models/get_feature_flag_response_body.py b/src/tower/tower_api_client/models/get_feature_flag_response_body.py deleted file mode 100644 index 6dbae81b..00000000 --- a/src/tower/tower_api_client/models/get_feature_flag_response_body.py +++ /dev/null @@ -1,81 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..models.get_feature_flag_response_body_value_type import ( - GetFeatureFlagResponseBodyValueType, -) -from ..types import UNSET, Unset - -T = TypeVar("T", bound="GetFeatureFlagResponseBody") - - -@_attrs_define -class GetFeatureFlagResponseBody: - """ - Attributes: - enabled (bool): Whether the flag is enabled - key (str): The feature flag key - value (Any): The flag value (type depends on value_type) - value_type (GetFeatureFlagResponseBodyValueType): The type of the value - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/GetFeatureFlagResponseBody.json. - """ - - enabled: bool - key: str - value: Any - value_type: GetFeatureFlagResponseBodyValueType - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - enabled = self.enabled - - key = self.key - - value = self.value - - value_type = self.value_type.value - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "enabled": enabled, - "key": key, - "value": value, - "value_type": value_type, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - enabled = d.pop("enabled") - - key = d.pop("key") - - value = d.pop("value") - - value_type = GetFeatureFlagResponseBodyValueType(d.pop("value_type")) - - schema = d.pop("$schema", UNSET) - - get_feature_flag_response_body = cls( - enabled=enabled, - key=key, - value=value, - value_type=value_type, - schema=schema, - ) - - return get_feature_flag_response_body diff --git a/src/tower/tower_api_client/models/get_feature_flag_response_body_value_type.py b/src/tower/tower_api_client/models/get_feature_flag_response_body_value_type.py deleted file mode 100644 index 20e19b5d..00000000 --- a/src/tower/tower_api_client/models/get_feature_flag_response_body_value_type.py +++ /dev/null @@ -1,11 +0,0 @@ -from enum import Enum - - -class GetFeatureFlagResponseBodyValueType(str, Enum): - BOOLEAN = "boolean" - NUMBER = "number" - OBJECT = "object" - STRING = "string" - - def __str__(self) -> str: - return str(self.value) diff --git a/src/tower/tower_api_client/models/guest.py b/src/tower/tower_api_client/models/guest.py deleted file mode 100644 index c8859768..00000000 --- a/src/tower/tower_api_client/models/guest.py +++ /dev/null @@ -1,71 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from dateutil.parser import isoparse - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="Guest") - - -@_attrs_define -class Guest: - """ - Attributes: - app (str): The name of the app this guest can access. - created_at (datetime.datetime): When the guest was created. - id (str): The unique identifier for the guest. - name (str | Unset): Optional display name for the guest. - """ - - app: str - created_at: datetime.datetime - id: str - name: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - app = self.app - - created_at = self.created_at.isoformat() - - id = self.id - - name = self.name - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "app": app, - "created_at": created_at, - "id": id, - } - ) - if name is not UNSET: - field_dict["name"] = name - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - app = d.pop("app") - - created_at = isoparse(d.pop("created_at")) - - id = d.pop("id") - - name = d.pop("name", UNSET) - - guest = cls( - app=app, - created_at=created_at, - id=id, - name=name, - ) - - return guest diff --git a/src/tower/tower_api_client/models/invite_team_member_params.py b/src/tower/tower_api_client/models/invite_team_member_params.py deleted file mode 100644 index 7d651150..00000000 --- a/src/tower/tower_api_client/models/invite_team_member_params.py +++ /dev/null @@ -1,74 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..models.invite_team_member_params_role import InviteTeamMemberParamsRole -from ..types import UNSET, Unset - -T = TypeVar("T", bound="InviteTeamMemberParams") - - -@_attrs_define -class InviteTeamMemberParams: - """ - Attributes: - emails (str): 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 - role (InviteTeamMemberParamsRole): The role to assign to the invitations Default: - InviteTeamMemberParamsRole.DEVELOPER. - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/InviteTeamMemberParams.json. - message (str | Unset): Optional message to include in the invite email - """ - - emails: str - role: InviteTeamMemberParamsRole = InviteTeamMemberParamsRole.DEVELOPER - schema: str | Unset = UNSET - message: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - emails = self.emails - - role = self.role.value - - schema = self.schema - - message = self.message - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "emails": emails, - "role": role, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - if message is not UNSET: - field_dict["message"] = message - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - emails = d.pop("emails") - - role = InviteTeamMemberParamsRole(d.pop("role")) - - schema = d.pop("$schema", UNSET) - - message = d.pop("message", UNSET) - - invite_team_member_params = cls( - emails=emails, - role=role, - schema=schema, - message=message, - ) - - return invite_team_member_params diff --git a/src/tower/tower_api_client/models/invite_team_member_params_role.py b/src/tower/tower_api_client/models/invite_team_member_params_role.py deleted file mode 100644 index d238fd86..00000000 --- a/src/tower/tower_api_client/models/invite_team_member_params_role.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class InviteTeamMemberParamsRole(str, Enum): - ADMIN = "admin" - DEVELOPER = "developer" - - def __str__(self) -> str: - return str(self.value) diff --git a/src/tower/tower_api_client/models/invite_team_member_response.py b/src/tower/tower_api_client/models/invite_team_member_response.py deleted file mode 100644 index 8e2faf3e..00000000 --- a/src/tower/tower_api_client/models/invite_team_member_response.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.team_invitation import TeamInvitation - - -T = TypeVar("T", bound="InviteTeamMemberResponse") - - -@_attrs_define -class InviteTeamMemberResponse: - """ - Attributes: - team_invitations (list[TeamInvitation]): The team invitation that you created - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/InviteTeamMemberResponse.json. - """ - - team_invitations: list[TeamInvitation] - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - team_invitations = [] - for team_invitations_item_data in self.team_invitations: - team_invitations_item = team_invitations_item_data.to_dict() - team_invitations.append(team_invitations_item) - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "team_invitations": team_invitations, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.team_invitation import TeamInvitation - - d = dict(src_dict) - team_invitations = [] - _team_invitations = d.pop("team_invitations") - for team_invitations_item_data in _team_invitations: - team_invitations_item = TeamInvitation.from_dict(team_invitations_item_data) - - team_invitations.append(team_invitations_item) - - schema = d.pop("$schema", UNSET) - - invite_team_member_response = cls( - team_invitations=team_invitations, - schema=schema, - ) - - return invite_team_member_response diff --git a/src/tower/tower_api_client/models/leave_team_response.py b/src/tower/tower_api_client/models/leave_team_response.py deleted file mode 100644 index 381a9b26..00000000 --- a/src/tower/tower_api_client/models/leave_team_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.team import Team - - -T = TypeVar("T", bound="LeaveTeamResponse") - - -@_attrs_define -class LeaveTeamResponse: - """ - Attributes: - team (Team): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/LeaveTeamResponse.json. - """ - - team: Team - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - team = self.team.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "team": team, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.team import Team - - d = dict(src_dict) - team = Team.from_dict(d.pop("team")) - - schema = d.pop("$schema", UNSET) - - leave_team_response = cls( - team=team, - schema=schema, - ) - - return leave_team_response diff --git a/src/tower/tower_api_client/models/list_alerts_response.py b/src/tower/tower_api_client/models/list_alerts_response.py deleted file mode 100644 index d08e0e19..00000000 --- a/src/tower/tower_api_client/models/list_alerts_response.py +++ /dev/null @@ -1,78 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.alert import Alert - from ..models.pagination import Pagination - - -T = TypeVar("T", bound="ListAlertsResponse") - - -@_attrs_define -class ListAlertsResponse: - """ - Attributes: - alerts (list[Alert]): List of alerts - pages (Pagination): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/ListAlertsResponse.json. - """ - - alerts: list[Alert] - pages: Pagination - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - alerts = [] - for alerts_item_data in self.alerts: - alerts_item = alerts_item_data.to_dict() - alerts.append(alerts_item) - - pages = self.pages.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "alerts": alerts, - "pages": pages, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.alert import Alert - from ..models.pagination import Pagination - - d = dict(src_dict) - alerts = [] - _alerts = d.pop("alerts") - for alerts_item_data in _alerts: - alerts_item = Alert.from_dict(alerts_item_data) - - alerts.append(alerts_item) - - pages = Pagination.from_dict(d.pop("pages")) - - schema = d.pop("$schema", UNSET) - - list_alerts_response = cls( - alerts=alerts, - pages=pages, - schema=schema, - ) - - return list_alerts_response diff --git a/src/tower/tower_api_client/models/list_api_keys_response.py b/src/tower/tower_api_client/models/list_api_keys_response.py deleted file mode 100644 index 9ae9a7e6..00000000 --- a/src/tower/tower_api_client/models/list_api_keys_response.py +++ /dev/null @@ -1,78 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.api_key import APIKey - from ..models.pagination import Pagination - - -T = TypeVar("T", bound="ListAPIKeysResponse") - - -@_attrs_define -class ListAPIKeysResponse: - """ - Attributes: - api_keys (list[APIKey]): List of API keys - pages (Pagination): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/ListAPIKeysResponse.json. - """ - - api_keys: list[APIKey] - pages: Pagination - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - api_keys = [] - for api_keys_item_data in self.api_keys: - api_keys_item = api_keys_item_data.to_dict() - api_keys.append(api_keys_item) - - pages = self.pages.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "api_keys": api_keys, - "pages": pages, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.api_key import APIKey - from ..models.pagination import Pagination - - d = dict(src_dict) - api_keys = [] - _api_keys = d.pop("api_keys") - for api_keys_item_data in _api_keys: - api_keys_item = APIKey.from_dict(api_keys_item_data) - - api_keys.append(api_keys_item) - - pages = Pagination.from_dict(d.pop("pages")) - - schema = d.pop("$schema", UNSET) - - list_api_keys_response = cls( - api_keys=api_keys, - pages=pages, - schema=schema, - ) - - return list_api_keys_response diff --git a/src/tower/tower_api_client/models/list_app_environments_response.py b/src/tower/tower_api_client/models/list_app_environments_response.py deleted file mode 100644 index 6eacb692..00000000 --- a/src/tower/tower_api_client/models/list_app_environments_response.py +++ /dev/null @@ -1,54 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="ListAppEnvironmentsResponse") - - -@_attrs_define -class ListAppEnvironmentsResponse: - """ - Attributes: - environments (list[str]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/ListAppEnvironmentsResponse.json. - """ - - environments: list[str] - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - environments = self.environments - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "environments": environments, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - environments = cast(list[str], d.pop("environments")) - - schema = d.pop("$schema", UNSET) - - list_app_environments_response = cls( - environments=environments, - schema=schema, - ) - - return list_app_environments_response diff --git a/src/tower/tower_api_client/models/list_app_versions_response.py b/src/tower/tower_api_client/models/list_app_versions_response.py deleted file mode 100644 index 28013c23..00000000 --- a/src/tower/tower_api_client/models/list_app_versions_response.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.app_version import AppVersion - - -T = TypeVar("T", bound="ListAppVersionsResponse") - - -@_attrs_define -class ListAppVersionsResponse: - """ - Attributes: - versions (list[AppVersion]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/ListAppVersionsResponse.json. - """ - - versions: list[AppVersion] - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - versions = [] - for versions_item_data in self.versions: - versions_item = versions_item_data.to_dict() - versions.append(versions_item) - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "versions": versions, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.app_version import AppVersion - - d = dict(src_dict) - versions = [] - _versions = d.pop("versions") - for versions_item_data in _versions: - versions_item = AppVersion.from_dict(versions_item_data) - - versions.append(versions_item) - - schema = d.pop("$schema", UNSET) - - list_app_versions_response = cls( - versions=versions, - schema=schema, - ) - - return list_app_versions_response diff --git a/src/tower/tower_api_client/models/list_apps_filter.py b/src/tower/tower_api_client/models/list_apps_filter.py deleted file mode 100644 index 491a047f..00000000 --- a/src/tower/tower_api_client/models/list_apps_filter.py +++ /dev/null @@ -1,12 +0,0 @@ -from enum import Enum - - -class ListAppsFilter(str, Enum): - DISABLED = "disabled" - HEALTHY = "healthy" - RUNNING = "running" - SCHEDULED = "scheduled" - WITHWARNING = "withWarning" - - def __str__(self) -> str: - return str(self.value) diff --git a/src/tower/tower_api_client/models/list_apps_response.py b/src/tower/tower_api_client/models/list_apps_response.py deleted file mode 100644 index 6804cec0..00000000 --- a/src/tower/tower_api_client/models/list_apps_response.py +++ /dev/null @@ -1,78 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.app_summary import AppSummary - from ..models.pagination import Pagination - - -T = TypeVar("T", bound="ListAppsResponse") - - -@_attrs_define -class ListAppsResponse: - """ - Attributes: - apps (list[AppSummary]): - pages (Pagination): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/ListAppsResponse.json. - """ - - apps: list[AppSummary] - pages: Pagination - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - apps = [] - for apps_item_data in self.apps: - apps_item = apps_item_data.to_dict() - apps.append(apps_item) - - pages = self.pages.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "apps": apps, - "pages": pages, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.app_summary import AppSummary - from ..models.pagination import Pagination - - d = dict(src_dict) - apps = [] - _apps = d.pop("apps") - for apps_item_data in _apps: - apps_item = AppSummary.from_dict(apps_item_data) - - apps.append(apps_item) - - pages = Pagination.from_dict(d.pop("pages")) - - schema = d.pop("$schema", UNSET) - - list_apps_response = cls( - apps=apps, - pages=pages, - schema=schema, - ) - - return list_apps_response diff --git a/src/tower/tower_api_client/models/list_apps_sort.py b/src/tower/tower_api_client/models/list_apps_sort.py deleted file mode 100644 index 862fe65a..00000000 --- a/src/tower/tower_api_client/models/list_apps_sort.py +++ /dev/null @@ -1,11 +0,0 @@ -from enum import Enum - - -class ListAppsSort(str, Enum): - A_TO_Z = "a_to_z" - CREATED_AT = "created_at" - MOST_RECENT_RUN = "most_recent_run" - UPDATED_AT = "updated_at" - - def __str__(self) -> str: - return str(self.value) diff --git a/src/tower/tower_api_client/models/list_authenticators_response.py b/src/tower/tower_api_client/models/list_authenticators_response.py deleted file mode 100644 index ba5bcac4..00000000 --- a/src/tower/tower_api_client/models/list_authenticators_response.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.verified_authenticator import VerifiedAuthenticator - - -T = TypeVar("T", bound="ListAuthenticatorsResponse") - - -@_attrs_define -class ListAuthenticatorsResponse: - """ - Attributes: - authenticators (list[VerifiedAuthenticator]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/ListAuthenticatorsResponse.json. - """ - - authenticators: list[VerifiedAuthenticator] - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - authenticators = [] - for authenticators_item_data in self.authenticators: - authenticators_item = authenticators_item_data.to_dict() - authenticators.append(authenticators_item) - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "authenticators": authenticators, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.verified_authenticator import VerifiedAuthenticator - - d = dict(src_dict) - authenticators = [] - _authenticators = d.pop("authenticators") - for authenticators_item_data in _authenticators: - authenticators_item = VerifiedAuthenticator.from_dict( - authenticators_item_data - ) - - authenticators.append(authenticators_item) - - schema = d.pop("$schema", UNSET) - - list_authenticators_response = cls( - authenticators=authenticators, - schema=schema, - ) - - return list_authenticators_response diff --git a/src/tower/tower_api_client/models/list_catalogs_response.py b/src/tower/tower_api_client/models/list_catalogs_response.py deleted file mode 100644 index 53e12797..00000000 --- a/src/tower/tower_api_client/models/list_catalogs_response.py +++ /dev/null @@ -1,78 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.catalog import Catalog - from ..models.pagination import Pagination - - -T = TypeVar("T", bound="ListCatalogsResponse") - - -@_attrs_define -class ListCatalogsResponse: - """ - Attributes: - catalogs (list[Catalog]): - pages (Pagination): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/ListCatalogsResponse.json. - """ - - catalogs: list[Catalog] - pages: Pagination - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - catalogs = [] - for catalogs_item_data in self.catalogs: - catalogs_item = catalogs_item_data.to_dict() - catalogs.append(catalogs_item) - - pages = self.pages.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "catalogs": catalogs, - "pages": pages, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.catalog import Catalog - from ..models.pagination import Pagination - - d = dict(src_dict) - catalogs = [] - _catalogs = d.pop("catalogs") - for catalogs_item_data in _catalogs: - catalogs_item = Catalog.from_dict(catalogs_item_data) - - catalogs.append(catalogs_item) - - pages = Pagination.from_dict(d.pop("pages")) - - schema = d.pop("$schema", UNSET) - - list_catalogs_response = cls( - catalogs=catalogs, - pages=pages, - schema=schema, - ) - - return list_catalogs_response diff --git a/src/tower/tower_api_client/models/list_environments_response.py b/src/tower/tower_api_client/models/list_environments_response.py deleted file mode 100644 index 0078a00f..00000000 --- a/src/tower/tower_api_client/models/list_environments_response.py +++ /dev/null @@ -1,78 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.environment import Environment - from ..models.pagination import Pagination - - -T = TypeVar("T", bound="ListEnvironmentsResponse") - - -@_attrs_define -class ListEnvironmentsResponse: - """ - Attributes: - environments (list[Environment]): - pages (Pagination): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/ListEnvironmentsResponse.json. - """ - - environments: list[Environment] - pages: Pagination - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - environments = [] - for environments_item_data in self.environments: - environments_item = environments_item_data.to_dict() - environments.append(environments_item) - - pages = self.pages.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "environments": environments, - "pages": pages, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.environment import Environment - from ..models.pagination import Pagination - - d = dict(src_dict) - environments = [] - _environments = d.pop("environments") - for environments_item_data in _environments: - environments_item = Environment.from_dict(environments_item_data) - - environments.append(environments_item) - - pages = Pagination.from_dict(d.pop("pages")) - - schema = d.pop("$schema", UNSET) - - list_environments_response = cls( - environments=environments, - pages=pages, - schema=schema, - ) - - return list_environments_response diff --git a/src/tower/tower_api_client/models/list_guests_response.py b/src/tower/tower_api_client/models/list_guests_response.py deleted file mode 100644 index d574a7cb..00000000 --- a/src/tower/tower_api_client/models/list_guests_response.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.guest import Guest - - -T = TypeVar("T", bound="ListGuestsResponse") - - -@_attrs_define -class ListGuestsResponse: - """ - Attributes: - guests (list[Guest]): List of guests. - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/ListGuestsResponse.json. - """ - - guests: list[Guest] - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - guests = [] - for guests_item_data in self.guests: - guests_item = guests_item_data.to_dict() - guests.append(guests_item) - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "guests": guests, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.guest import Guest - - d = dict(src_dict) - guests = [] - _guests = d.pop("guests") - for guests_item_data in _guests: - guests_item = Guest.from_dict(guests_item_data) - - guests.append(guests_item) - - schema = d.pop("$schema", UNSET) - - list_guests_response = cls( - guests=guests, - schema=schema, - ) - - return list_guests_response diff --git a/src/tower/tower_api_client/models/list_my_team_invitations_response.py b/src/tower/tower_api_client/models/list_my_team_invitations_response.py deleted file mode 100644 index 3723ec83..00000000 --- a/src/tower/tower_api_client/models/list_my_team_invitations_response.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.team_invitation import TeamInvitation - - -T = TypeVar("T", bound="ListMyTeamInvitationsResponse") - - -@_attrs_define -class ListMyTeamInvitationsResponse: - """ - Attributes: - team_invitations (list[TeamInvitation]): All of team invitations - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/ListMyTeamInvitationsResponse.json. - """ - - team_invitations: list[TeamInvitation] - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - team_invitations = [] - for team_invitations_item_data in self.team_invitations: - team_invitations_item = team_invitations_item_data.to_dict() - team_invitations.append(team_invitations_item) - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "team_invitations": team_invitations, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.team_invitation import TeamInvitation - - d = dict(src_dict) - team_invitations = [] - _team_invitations = d.pop("team_invitations") - for team_invitations_item_data in _team_invitations: - team_invitations_item = TeamInvitation.from_dict(team_invitations_item_data) - - team_invitations.append(team_invitations_item) - - schema = d.pop("$schema", UNSET) - - list_my_team_invitations_response = cls( - team_invitations=team_invitations, - schema=schema, - ) - - return list_my_team_invitations_response diff --git a/src/tower/tower_api_client/models/list_runners_response.py b/src/tower/tower_api_client/models/list_runners_response.py deleted file mode 100644 index dfb1be95..00000000 --- a/src/tower/tower_api_client/models/list_runners_response.py +++ /dev/null @@ -1,78 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.pagination import Pagination - from ..models.runner import Runner - - -T = TypeVar("T", bound="ListRunnersResponse") - - -@_attrs_define -class ListRunnersResponse: - """ - Attributes: - pages (Pagination): - runners (list[Runner]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/ListRunnersResponse.json. - """ - - pages: Pagination - runners: list[Runner] - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - pages = self.pages.to_dict() - - runners = [] - for runners_item_data in self.runners: - runners_item = runners_item_data.to_dict() - runners.append(runners_item) - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "pages": pages, - "runners": runners, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.pagination import Pagination - from ..models.runner import Runner - - d = dict(src_dict) - pages = Pagination.from_dict(d.pop("pages")) - - runners = [] - _runners = d.pop("runners") - for runners_item_data in _runners: - runners_item = Runner.from_dict(runners_item_data) - - runners.append(runners_item) - - schema = d.pop("$schema", UNSET) - - list_runners_response = cls( - pages=pages, - runners=runners, - schema=schema, - ) - - return list_runners_response diff --git a/src/tower/tower_api_client/models/list_runs_response.py b/src/tower/tower_api_client/models/list_runs_response.py deleted file mode 100644 index a58100a0..00000000 --- a/src/tower/tower_api_client/models/list_runs_response.py +++ /dev/null @@ -1,78 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.pagination import Pagination - from ..models.run import Run - - -T = TypeVar("T", bound="ListRunsResponse") - - -@_attrs_define -class ListRunsResponse: - """ - Attributes: - pages (Pagination): - runs (list[Run]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/ListRunsResponse.json. - """ - - pages: Pagination - runs: list[Run] - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - pages = self.pages.to_dict() - - runs = [] - for runs_item_data in self.runs: - runs_item = runs_item_data.to_dict() - runs.append(runs_item) - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "pages": pages, - "runs": runs, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.pagination import Pagination - from ..models.run import Run - - d = dict(src_dict) - pages = Pagination.from_dict(d.pop("pages")) - - runs = [] - _runs = d.pop("runs") - for runs_item_data in _runs: - runs_item = Run.from_dict(runs_item_data) - - runs.append(runs_item) - - schema = d.pop("$schema", UNSET) - - list_runs_response = cls( - pages=pages, - runs=runs, - schema=schema, - ) - - return list_runs_response diff --git a/src/tower/tower_api_client/models/list_runs_status_item.py b/src/tower/tower_api_client/models/list_runs_status_item.py deleted file mode 100644 index 46671e20..00000000 --- a/src/tower/tower_api_client/models/list_runs_status_item.py +++ /dev/null @@ -1,14 +0,0 @@ -from enum import Enum - - -class ListRunsStatusItem(str, Enum): - CANCELLED = "cancelled" - CRASHED = "crashed" - ERRORED = "errored" - EXITED = "exited" - PENDING = "pending" - RETRYING = "retrying" - RUNNING = "running" - - def __str__(self) -> str: - return str(self.value) diff --git a/src/tower/tower_api_client/models/list_schedules_response.py b/src/tower/tower_api_client/models/list_schedules_response.py deleted file mode 100644 index 766adbae..00000000 --- a/src/tower/tower_api_client/models/list_schedules_response.py +++ /dev/null @@ -1,78 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.pagination import Pagination - from ..models.schedule import Schedule - - -T = TypeVar("T", bound="ListSchedulesResponse") - - -@_attrs_define -class ListSchedulesResponse: - """ - Attributes: - pages (Pagination): - schedules (list[Schedule]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/ListSchedulesResponse.json. - """ - - pages: Pagination - schedules: list[Schedule] - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - pages = self.pages.to_dict() - - schedules = [] - for schedules_item_data in self.schedules: - schedules_item = schedules_item_data.to_dict() - schedules.append(schedules_item) - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "pages": pages, - "schedules": schedules, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.pagination import Pagination - from ..models.schedule import Schedule - - d = dict(src_dict) - pages = Pagination.from_dict(d.pop("pages")) - - schedules = [] - _schedules = d.pop("schedules") - for schedules_item_data in _schedules: - schedules_item = Schedule.from_dict(schedules_item_data) - - schedules.append(schedules_item) - - schema = d.pop("$schema", UNSET) - - list_schedules_response = cls( - pages=pages, - schedules=schedules, - schema=schema, - ) - - return list_schedules_response diff --git a/src/tower/tower_api_client/models/list_secret_environments_response.py b/src/tower/tower_api_client/models/list_secret_environments_response.py deleted file mode 100644 index 0b44f822..00000000 --- a/src/tower/tower_api_client/models/list_secret_environments_response.py +++ /dev/null @@ -1,54 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="ListSecretEnvironmentsResponse") - - -@_attrs_define -class ListSecretEnvironmentsResponse: - """ - Attributes: - environments (list[str]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/ListSecretEnvironmentsResponse.json. - """ - - environments: list[str] - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - environments = self.environments - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "environments": environments, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - environments = cast(list[str], d.pop("environments")) - - schema = d.pop("$schema", UNSET) - - list_secret_environments_response = cls( - environments=environments, - schema=schema, - ) - - return list_secret_environments_response diff --git a/src/tower/tower_api_client/models/list_secrets_response.py b/src/tower/tower_api_client/models/list_secrets_response.py deleted file mode 100644 index 04fac0e7..00000000 --- a/src/tower/tower_api_client/models/list_secrets_response.py +++ /dev/null @@ -1,78 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.pagination import Pagination - from ..models.secret import Secret - - -T = TypeVar("T", bound="ListSecretsResponse") - - -@_attrs_define -class ListSecretsResponse: - """ - Attributes: - pages (Pagination): - secrets (list[Secret]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/ListSecretsResponse.json. - """ - - pages: Pagination - secrets: list[Secret] - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - pages = self.pages.to_dict() - - secrets = [] - for secrets_item_data in self.secrets: - secrets_item = secrets_item_data.to_dict() - secrets.append(secrets_item) - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "pages": pages, - "secrets": secrets, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.pagination import Pagination - from ..models.secret import Secret - - d = dict(src_dict) - pages = Pagination.from_dict(d.pop("pages")) - - secrets = [] - _secrets = d.pop("secrets") - for secrets_item_data in _secrets: - secrets_item = Secret.from_dict(secrets_item_data) - - secrets.append(secrets_item) - - schema = d.pop("$schema", UNSET) - - list_secrets_response = cls( - pages=pages, - secrets=secrets, - schema=schema, - ) - - return list_secrets_response diff --git a/src/tower/tower_api_client/models/list_team_invitations_response.py b/src/tower/tower_api_client/models/list_team_invitations_response.py deleted file mode 100644 index 52846ca3..00000000 --- a/src/tower/tower_api_client/models/list_team_invitations_response.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.team_invitation import TeamInvitation - - -T = TypeVar("T", bound="ListTeamInvitationsResponse") - - -@_attrs_define -class ListTeamInvitationsResponse: - """ - Attributes: - team_invitations (list[TeamInvitation]): All of team invitations - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/ListTeamInvitationsResponse.json. - """ - - team_invitations: list[TeamInvitation] - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - team_invitations = [] - for team_invitations_item_data in self.team_invitations: - team_invitations_item = team_invitations_item_data.to_dict() - team_invitations.append(team_invitations_item) - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "team_invitations": team_invitations, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.team_invitation import TeamInvitation - - d = dict(src_dict) - team_invitations = [] - _team_invitations = d.pop("team_invitations") - for team_invitations_item_data in _team_invitations: - team_invitations_item = TeamInvitation.from_dict(team_invitations_item_data) - - team_invitations.append(team_invitations_item) - - schema = d.pop("$schema", UNSET) - - list_team_invitations_response = cls( - team_invitations=team_invitations, - schema=schema, - ) - - return list_team_invitations_response diff --git a/src/tower/tower_api_client/models/list_team_members_response.py b/src/tower/tower_api_client/models/list_team_members_response.py deleted file mode 100644 index 7c5921be..00000000 --- a/src/tower/tower_api_client/models/list_team_members_response.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.team_membership import TeamMembership - - -T = TypeVar("T", bound="ListTeamMembersResponse") - - -@_attrs_define -class ListTeamMembersResponse: - """ - Attributes: - team_members (list[TeamMembership]): All of the members of a team - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/ListTeamMembersResponse.json. - """ - - team_members: list[TeamMembership] - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - team_members = [] - for team_members_item_data in self.team_members: - team_members_item = team_members_item_data.to_dict() - team_members.append(team_members_item) - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "team_members": team_members, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.team_membership import TeamMembership - - d = dict(src_dict) - team_members = [] - _team_members = d.pop("team_members") - for team_members_item_data in _team_members: - team_members_item = TeamMembership.from_dict(team_members_item_data) - - team_members.append(team_members_item) - - schema = d.pop("$schema", UNSET) - - list_team_members_response = cls( - team_members=team_members, - schema=schema, - ) - - return list_team_members_response diff --git a/src/tower/tower_api_client/models/list_teams_response.py b/src/tower/tower_api_client/models/list_teams_response.py deleted file mode 100644 index bff5edee..00000000 --- a/src/tower/tower_api_client/models/list_teams_response.py +++ /dev/null @@ -1,78 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.pagination import Pagination - from ..models.team import Team - - -T = TypeVar("T", bound="ListTeamsResponse") - - -@_attrs_define -class ListTeamsResponse: - """ - Attributes: - pages (Pagination): - teams (list[Team]): List of teams - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/ListTeamsResponse.json. - """ - - pages: Pagination - teams: list[Team] - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - pages = self.pages.to_dict() - - teams = [] - for teams_item_data in self.teams: - teams_item = teams_item_data.to_dict() - teams.append(teams_item) - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "pages": pages, - "teams": teams, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.pagination import Pagination - from ..models.team import Team - - d = dict(src_dict) - pages = Pagination.from_dict(d.pop("pages")) - - teams = [] - _teams = d.pop("teams") - for teams_item_data in _teams: - teams_item = Team.from_dict(teams_item_data) - - teams.append(teams_item) - - schema = d.pop("$schema", UNSET) - - list_teams_response = cls( - pages=pages, - teams=teams, - schema=schema, - ) - - return list_teams_response diff --git a/src/tower/tower_api_client/models/list_webhooks_response.py b/src/tower/tower_api_client/models/list_webhooks_response.py deleted file mode 100644 index b10e5c4e..00000000 --- a/src/tower/tower_api_client/models/list_webhooks_response.py +++ /dev/null @@ -1,78 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.pagination import Pagination - from ..models.webhook import Webhook - - -T = TypeVar("T", bound="ListWebhooksResponse") - - -@_attrs_define -class ListWebhooksResponse: - """ - Attributes: - pages (Pagination): - webhooks (list[Webhook]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/ListWebhooksResponse.json. - """ - - pages: Pagination - webhooks: list[Webhook] - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - pages = self.pages.to_dict() - - webhooks = [] - for webhooks_item_data in self.webhooks: - webhooks_item = webhooks_item_data.to_dict() - webhooks.append(webhooks_item) - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "pages": pages, - "webhooks": webhooks, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.pagination import Pagination - from ..models.webhook import Webhook - - d = dict(src_dict) - pages = Pagination.from_dict(d.pop("pages")) - - webhooks = [] - _webhooks = d.pop("webhooks") - for webhooks_item_data in _webhooks: - webhooks_item = Webhook.from_dict(webhooks_item_data) - - webhooks.append(webhooks_item) - - schema = d.pop("$schema", UNSET) - - list_webhooks_response = cls( - pages=pages, - webhooks=webhooks, - schema=schema, - ) - - return list_webhooks_response diff --git a/src/tower/tower_api_client/models/organization.py b/src/tower/tower_api_client/models/organization.py deleted file mode 100644 index 8fe5c4a3..00000000 --- a/src/tower/tower_api_client/models/organization.py +++ /dev/null @@ -1,56 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -if TYPE_CHECKING: - from ..models.user import User - - -T = TypeVar("T", bound="Organization") - - -@_attrs_define -class Organization: - """ - Attributes: - name (str): The name of the organization - owner (User): - """ - - name: str - owner: User - - def to_dict(self) -> dict[str, Any]: - name = self.name - - owner = self.owner.to_dict() - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "name": name, - "owner": owner, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.user import User - - d = dict(src_dict) - name = d.pop("name") - - owner = User.from_dict(d.pop("owner")) - - organization = cls( - name=name, - owner=owner, - ) - - return organization diff --git a/src/tower/tower_api_client/models/organization_usage.py b/src/tower/tower_api_client/models/organization_usage.py deleted file mode 100644 index 74bda4e3..00000000 --- a/src/tower/tower_api_client/models/organization_usage.py +++ /dev/null @@ -1,108 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.usage_limit import UsageLimit - - -T = TypeVar("T", bound="OrganizationUsage") - - -@_attrs_define -class OrganizationUsage: - """ - Attributes: - active_schedules (UsageLimit): - apps (UsageLimit): - base_plan_name (str): The name of the organization's base plan. - compute_minutes (UsageLimit): - members (UsageLimit): - organization_name (str): The name of the organization. - self_hosted_runners (UsageLimit): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/OrganizationUsage.json. - """ - - active_schedules: UsageLimit - apps: UsageLimit - base_plan_name: str - compute_minutes: UsageLimit - members: UsageLimit - organization_name: str - self_hosted_runners: UsageLimit - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - active_schedules = self.active_schedules.to_dict() - - apps = self.apps.to_dict() - - base_plan_name = self.base_plan_name - - compute_minutes = self.compute_minutes.to_dict() - - members = self.members.to_dict() - - organization_name = self.organization_name - - self_hosted_runners = self.self_hosted_runners.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "active_schedules": active_schedules, - "apps": apps, - "base_plan_name": base_plan_name, - "compute_minutes": compute_minutes, - "members": members, - "organization_name": organization_name, - "self_hosted_runners": self_hosted_runners, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.usage_limit import UsageLimit - - d = dict(src_dict) - active_schedules = UsageLimit.from_dict(d.pop("active_schedules")) - - apps = UsageLimit.from_dict(d.pop("apps")) - - base_plan_name = d.pop("base_plan_name") - - compute_minutes = UsageLimit.from_dict(d.pop("compute_minutes")) - - members = UsageLimit.from_dict(d.pop("members")) - - organization_name = d.pop("organization_name") - - self_hosted_runners = UsageLimit.from_dict(d.pop("self_hosted_runners")) - - schema = d.pop("$schema", UNSET) - - organization_usage = cls( - active_schedules=active_schedules, - apps=apps, - base_plan_name=base_plan_name, - compute_minutes=compute_minutes, - members=members, - organization_name=organization_name, - self_hosted_runners=self_hosted_runners, - schema=schema, - ) - - return organization_usage diff --git a/src/tower/tower_api_client/models/pagination.py b/src/tower/tower_api_client/models/pagination.py deleted file mode 100644 index 70bef512..00000000 --- a/src/tower/tower_api_client/models/pagination.py +++ /dev/null @@ -1,66 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -T = TypeVar("T", bound="Pagination") - - -@_attrs_define -class Pagination: - """ - Attributes: - num_pages (int): - page (int): - page_size (int): - total (int): - """ - - num_pages: int - page: int - page_size: int - total: int - - def to_dict(self) -> dict[str, Any]: - num_pages = self.num_pages - - page = self.page - - page_size = self.page_size - - total = self.total - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "num_pages": num_pages, - "page": page, - "page_size": page_size, - "total": total, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - num_pages = d.pop("num_pages") - - page = d.pop("page") - - page_size = d.pop("page_size") - - total = d.pop("total") - - pagination = cls( - num_pages=num_pages, - page=page, - page_size=page_size, - total=total, - ) - - return pagination diff --git a/src/tower/tower_api_client/models/parameter.py b/src/tower/tower_api_client/models/parameter.py deleted file mode 100644 index 131d5881..00000000 --- a/src/tower/tower_api_client/models/parameter.py +++ /dev/null @@ -1,69 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="Parameter") - - -@_attrs_define -class Parameter: - """ - Attributes: - default (str): - description (str): - name (str): - hidden (bool | Unset): Whether this parameter is hidden/secret. Defaults to false. Default: False. - """ - - default: str - description: str - name: str - hidden: bool | Unset = False - - def to_dict(self) -> dict[str, Any]: - default = self.default - - description = self.description - - name = self.name - - hidden = self.hidden - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "default": default, - "description": description, - "name": name, - } - ) - if hidden is not UNSET: - field_dict["hidden"] = hidden - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - default = d.pop("default") - - description = d.pop("description") - - name = d.pop("name") - - hidden = d.pop("hidden", UNSET) - - parameter = cls( - default=default, - description=description, - name=name, - hidden=hidden, - ) - - return parameter diff --git a/src/tower/tower_api_client/models/plan.py b/src/tower/tower_api_client/models/plan.py deleted file mode 100644 index 83476e8c..00000000 --- a/src/tower/tower_api_client/models/plan.py +++ /dev/null @@ -1,129 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from dateutil.parser import isoparse - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.feature import Feature - - -T = TypeVar("T", bound="Plan") - - -@_attrs_define -class Plan: - """ - Attributes: - base_plan_name (str): - created_at (datetime.datetime): - features (list[Feature]): - id (str): - start_at (datetime.datetime): - end_at (datetime.datetime | Unset): - extras (list[Feature] | Unset): - """ - - base_plan_name: str - created_at: datetime.datetime - features: list[Feature] - id: str - start_at: datetime.datetime - end_at: datetime.datetime | Unset = UNSET - extras: list[Feature] | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - base_plan_name = self.base_plan_name - - created_at = self.created_at.isoformat() - - features = [] - for features_item_data in self.features: - features_item = features_item_data.to_dict() - features.append(features_item) - - id = self.id - - start_at = self.start_at.isoformat() - - end_at: str | Unset = UNSET - if not isinstance(self.end_at, Unset): - end_at = self.end_at.isoformat() - - extras: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.extras, Unset): - extras = [] - for extras_item_data in self.extras: - extras_item = extras_item_data.to_dict() - extras.append(extras_item) - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "base_plan_name": base_plan_name, - "created_at": created_at, - "features": features, - "id": id, - "start_at": start_at, - } - ) - if end_at is not UNSET: - field_dict["end_at"] = end_at - if extras is not UNSET: - field_dict["extras"] = extras - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.feature import Feature - - d = dict(src_dict) - base_plan_name = d.pop("base_plan_name") - - created_at = isoparse(d.pop("created_at")) - - features = [] - _features = d.pop("features") - for features_item_data in _features: - features_item = Feature.from_dict(features_item_data) - - features.append(features_item) - - id = d.pop("id") - - start_at = isoparse(d.pop("start_at")) - - _end_at = d.pop("end_at", UNSET) - end_at: datetime.datetime | Unset - if isinstance(_end_at, Unset): - end_at = UNSET - else: - end_at = isoparse(_end_at) - - _extras = d.pop("extras", UNSET) - extras: list[Feature] | Unset = UNSET - if _extras is not UNSET: - extras = [] - for extras_item_data in _extras: - extras_item = Feature.from_dict(extras_item_data) - - extras.append(extras_item) - - plan = cls( - base_plan_name=base_plan_name, - created_at=created_at, - features=features, - id=id, - start_at=start_at, - end_at=end_at, - extras=extras, - ) - - return plan diff --git a/src/tower/tower_api_client/models/refresh_session_params.py b/src/tower/tower_api_client/models/refresh_session_params.py deleted file mode 100644 index bbf86d5f..00000000 --- a/src/tower/tower_api_client/models/refresh_session_params.py +++ /dev/null @@ -1,52 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="RefreshSessionParams") - - -@_attrs_define -class RefreshSessionParams: - """ - Attributes: - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/RefreshSessionParams.json. - refresh_token (str | Unset): The refresh token associated with the session to refresh. - """ - - schema: str | Unset = UNSET - refresh_token: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - schema = self.schema - - refresh_token = self.refresh_token - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if schema is not UNSET: - field_dict["$schema"] = schema - if refresh_token is not UNSET: - field_dict["refresh_token"] = refresh_token - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - schema = d.pop("$schema", UNSET) - - refresh_token = d.pop("refresh_token", UNSET) - - refresh_session_params = cls( - schema=schema, - refresh_token=refresh_token, - ) - - return refresh_session_params diff --git a/src/tower/tower_api_client/models/refresh_session_response.py b/src/tower/tower_api_client/models/refresh_session_response.py deleted file mode 100644 index f694faa8..00000000 --- a/src/tower/tower_api_client/models/refresh_session_response.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from dateutil.parser import isoparse - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.session import Session - - -T = TypeVar("T", bound="RefreshSessionResponse") - - -@_attrs_define -class RefreshSessionResponse: - """ - Attributes: - refreshed_at (datetime.datetime): A timestamp that indicates the last time the session data was refreshed. - session (Session): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/RefreshSessionResponse.json. - """ - - refreshed_at: datetime.datetime - session: Session - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - refreshed_at = self.refreshed_at.isoformat() - - session = self.session.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "refreshed_at": refreshed_at, - "session": session, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.session import Session - - d = dict(src_dict) - refreshed_at = isoparse(d.pop("refreshed_at")) - - session = Session.from_dict(d.pop("session")) - - schema = d.pop("$schema", UNSET) - - refresh_session_response = cls( - refreshed_at=refreshed_at, - session=session, - schema=schema, - ) - - return refresh_session_response diff --git a/src/tower/tower_api_client/models/regenerate_guest_login_url_params.py b/src/tower/tower_api_client/models/regenerate_guest_login_url_params.py deleted file mode 100644 index 7d8caf40..00000000 --- a/src/tower/tower_api_client/models/regenerate_guest_login_url_params.py +++ /dev/null @@ -1,62 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="RegenerateGuestLoginURLParams") - - -@_attrs_define -class RegenerateGuestLoginURLParams: - """ - Attributes: - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/RegenerateGuestLoginURLParams.json. - expires_in (int | Unset): The number of seconds the guest session should last. Defaults to 72 hours. Default: - 259200. - redirect_url (str | Unset): Where to redirect the guest after they log in. - """ - - schema: str | Unset = UNSET - expires_in: int | Unset = 259200 - redirect_url: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - schema = self.schema - - expires_in = self.expires_in - - redirect_url = self.redirect_url - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if schema is not UNSET: - field_dict["$schema"] = schema - if expires_in is not UNSET: - field_dict["expires_in"] = expires_in - if redirect_url is not UNSET: - field_dict["redirect_url"] = redirect_url - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - schema = d.pop("$schema", UNSET) - - expires_in = d.pop("expires_in", UNSET) - - redirect_url = d.pop("redirect_url", UNSET) - - regenerate_guest_login_url_params = cls( - schema=schema, - expires_in=expires_in, - redirect_url=redirect_url, - ) - - return regenerate_guest_login_url_params diff --git a/src/tower/tower_api_client/models/regenerate_guest_login_url_response.py b/src/tower/tower_api_client/models/regenerate_guest_login_url_response.py deleted file mode 100644 index 062f0623..00000000 --- a/src/tower/tower_api_client/models/regenerate_guest_login_url_response.py +++ /dev/null @@ -1,64 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from dateutil.parser import isoparse - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="RegenerateGuestLoginURLResponse") - - -@_attrs_define -class RegenerateGuestLoginURLResponse: - """ - Attributes: - login_url (str): The new login URL to share with the guest. - login_url_expires_at (datetime.datetime): When the login URL expires. - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/RegenerateGuestLoginURLResponse.json. - """ - - login_url: str - login_url_expires_at: datetime.datetime - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - login_url = self.login_url - - login_url_expires_at = self.login_url_expires_at.isoformat() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "login_url": login_url, - "login_url_expires_at": login_url_expires_at, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - login_url = d.pop("login_url") - - login_url_expires_at = isoparse(d.pop("login_url_expires_at")) - - schema = d.pop("$schema", UNSET) - - regenerate_guest_login_url_response = cls( - login_url=login_url, - login_url_expires_at=login_url_expires_at, - schema=schema, - ) - - return regenerate_guest_login_url_response diff --git a/src/tower/tower_api_client/models/remove_team_member_params.py b/src/tower/tower_api_client/models/remove_team_member_params.py deleted file mode 100644 index 4f2cebfc..00000000 --- a/src/tower/tower_api_client/models/remove_team_member_params.py +++ /dev/null @@ -1,54 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="RemoveTeamMemberParams") - - -@_attrs_define -class RemoveTeamMemberParams: - """ - Attributes: - email (str): The email address of the team member to remove - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/RemoveTeamMemberParams.json. - """ - - email: str - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - email = self.email - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "email": email, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - email = d.pop("email") - - schema = d.pop("$schema", UNSET) - - remove_team_member_params = cls( - email=email, - schema=schema, - ) - - return remove_team_member_params diff --git a/src/tower/tower_api_client/models/remove_team_member_response.py b/src/tower/tower_api_client/models/remove_team_member_response.py deleted file mode 100644 index bfc98bcd..00000000 --- a/src/tower/tower_api_client/models/remove_team_member_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.user import User - - -T = TypeVar("T", bound="RemoveTeamMemberResponse") - - -@_attrs_define -class RemoveTeamMemberResponse: - """ - Attributes: - team_member (User): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/RemoveTeamMemberResponse.json. - """ - - team_member: User - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - team_member = self.team_member.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "team_member": team_member, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.user import User - - d = dict(src_dict) - team_member = User.from_dict(d.pop("team_member")) - - schema = d.pop("$schema", UNSET) - - remove_team_member_response = cls( - team_member=team_member, - schema=schema, - ) - - return remove_team_member_response diff --git a/src/tower/tower_api_client/models/resend_team_invitation_params.py b/src/tower/tower_api_client/models/resend_team_invitation_params.py deleted file mode 100644 index 66142e9e..00000000 --- a/src/tower/tower_api_client/models/resend_team_invitation_params.py +++ /dev/null @@ -1,63 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="ResendTeamInvitationParams") - - -@_attrs_define -class ResendTeamInvitationParams: - """ - Attributes: - email (str): The email address of team invitation to resend - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/ResendTeamInvitationParams.json. - message (str | Unset): Optional message to include in the invite email - """ - - email: str - schema: str | Unset = UNSET - message: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - email = self.email - - schema = self.schema - - message = self.message - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "email": email, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - if message is not UNSET: - field_dict["message"] = message - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - email = d.pop("email") - - schema = d.pop("$schema", UNSET) - - message = d.pop("message", UNSET) - - resend_team_invitation_params = cls( - email=email, - schema=schema, - message=message, - ) - - return resend_team_invitation_params diff --git a/src/tower/tower_api_client/models/resend_team_invitation_response.py b/src/tower/tower_api_client/models/resend_team_invitation_response.py deleted file mode 100644 index 6821b60a..00000000 --- a/src/tower/tower_api_client/models/resend_team_invitation_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.team_invitation import TeamInvitation - - -T = TypeVar("T", bound="ResendTeamInvitationResponse") - - -@_attrs_define -class ResendTeamInvitationResponse: - """ - Attributes: - team_invitation (TeamInvitation): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/ResendTeamInvitationResponse.json. - """ - - team_invitation: TeamInvitation - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - team_invitation = self.team_invitation.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "team_invitation": team_invitation, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.team_invitation import TeamInvitation - - d = dict(src_dict) - team_invitation = TeamInvitation.from_dict(d.pop("team_invitation")) - - schema = d.pop("$schema", UNSET) - - resend_team_invitation_response = cls( - team_invitation=team_invitation, - schema=schema, - ) - - return resend_team_invitation_response diff --git a/src/tower/tower_api_client/models/run.py b/src/tower/tower_api_client/models/run.py deleted file mode 100644 index 3eb0219b..00000000 --- a/src/tower/tower_api_client/models/run.py +++ /dev/null @@ -1,338 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast - -from attrs import define as _attrs_define -from dateutil.parser import isoparse - -from ..models.run_status import RunStatus -from ..models.run_status_group import RunStatusGroup -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.run_attempt import RunAttempt - from ..models.run_initiator import RunInitiator - from ..models.run_parameter import RunParameter - from ..models.run_retry_policy import RunRetryPolicy - - -T = TypeVar("T", bound="Run") - - -@_attrs_define -class Run: - """ - Attributes: - link (str): $link is deprecated. Individual responses include links. - app_name (str): - app_version (str): - cancelled_at (datetime.datetime | None): - created_at (datetime.datetime): - ended_at (datetime.datetime | None): - environment (str): - exit_code (int | None): Exit code of the run, if the run is completed. Null if there is no exit code - initiator (RunInitiator): - is_scheduled (bool): Whether this run was triggered by a schedule (true) or on-demand (false). Historical - records default to false. - num_attempts (int): Number of attempts for this run (1 = original, 2+ = retries). - number (int): - parameters (list[RunParameter]): Parameters used to invoke this run. - run_id (str): - scheduled_at (datetime.datetime): - started_at (datetime.datetime | None): - status (RunStatus): - status_group (RunStatusGroup): - app_slug (str | Unset): This property is deprecated. Use app_name instead. - attempts (list[RunAttempt] | Unset): Previous attempt details. Populated on describe, omitted on list. - hostname (str | Unset): hostname is deprecated, use subdomain - retry_policy (RunRetryPolicy | Unset): - subdomain (None | str | Unset): If app is externally accessible, then you can access this run with this - hostname. - """ - - link: str - app_name: str - app_version: str - cancelled_at: datetime.datetime | None - created_at: datetime.datetime - ended_at: datetime.datetime | None - environment: str - exit_code: int | None - initiator: RunInitiator - is_scheduled: bool - num_attempts: int - number: int - parameters: list[RunParameter] - run_id: str - scheduled_at: datetime.datetime - started_at: datetime.datetime | None - status: RunStatus - status_group: RunStatusGroup - app_slug: str | Unset = UNSET - attempts: list[RunAttempt] | Unset = UNSET - hostname: str | Unset = UNSET - retry_policy: RunRetryPolicy | Unset = UNSET - subdomain: None | str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - link = self.link - - app_name = self.app_name - - app_version = self.app_version - - cancelled_at: None | str - if isinstance(self.cancelled_at, datetime.datetime): - cancelled_at = self.cancelled_at.isoformat() - else: - cancelled_at = self.cancelled_at - - created_at = self.created_at.isoformat() - - ended_at: None | str - if isinstance(self.ended_at, datetime.datetime): - ended_at = self.ended_at.isoformat() - else: - ended_at = self.ended_at - - environment = self.environment - - exit_code: int | None - exit_code = self.exit_code - - initiator = self.initiator.to_dict() - - is_scheduled = self.is_scheduled - - num_attempts = self.num_attempts - - number = self.number - - parameters = [] - for parameters_item_data in self.parameters: - parameters_item = parameters_item_data.to_dict() - parameters.append(parameters_item) - - run_id = self.run_id - - scheduled_at = self.scheduled_at.isoformat() - - started_at: None | str - if isinstance(self.started_at, datetime.datetime): - started_at = self.started_at.isoformat() - else: - started_at = self.started_at - - status = self.status.value - - status_group = self.status_group.value - - app_slug = self.app_slug - - attempts: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.attempts, Unset): - attempts = [] - for attempts_item_data in self.attempts: - attempts_item = attempts_item_data.to_dict() - attempts.append(attempts_item) - - hostname = self.hostname - - retry_policy: dict[str, Any] | Unset = UNSET - if not isinstance(self.retry_policy, Unset): - retry_policy = self.retry_policy.to_dict() - - subdomain: None | str | Unset - if isinstance(self.subdomain, Unset): - subdomain = UNSET - else: - subdomain = self.subdomain - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "$link": link, - "app_name": app_name, - "app_version": app_version, - "cancelled_at": cancelled_at, - "created_at": created_at, - "ended_at": ended_at, - "environment": environment, - "exit_code": exit_code, - "initiator": initiator, - "is_scheduled": is_scheduled, - "num_attempts": num_attempts, - "number": number, - "parameters": parameters, - "run_id": run_id, - "scheduled_at": scheduled_at, - "started_at": started_at, - "status": status, - "status_group": status_group, - } - ) - if app_slug is not UNSET: - field_dict["app_slug"] = app_slug - if attempts is not UNSET: - field_dict["attempts"] = attempts - if hostname is not UNSET: - field_dict["hostname"] = hostname - if retry_policy is not UNSET: - field_dict["retry_policy"] = retry_policy - if subdomain is not UNSET: - field_dict["subdomain"] = subdomain - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.run_attempt import RunAttempt - from ..models.run_initiator import RunInitiator - from ..models.run_parameter import RunParameter - from ..models.run_retry_policy import RunRetryPolicy - - d = dict(src_dict) - link = d.pop("$link") - - app_name = d.pop("app_name") - - app_version = d.pop("app_version") - - def _parse_cancelled_at(data: object) -> datetime.datetime | None: - if data is None: - return data - try: - if not isinstance(data, str): - raise TypeError() - cancelled_at_type_0 = isoparse(data) - - return cancelled_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(datetime.datetime | None, data) - - cancelled_at = _parse_cancelled_at(d.pop("cancelled_at")) - - created_at = isoparse(d.pop("created_at")) - - def _parse_ended_at(data: object) -> datetime.datetime | None: - if data is None: - return data - try: - if not isinstance(data, str): - raise TypeError() - ended_at_type_0 = isoparse(data) - - return ended_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(datetime.datetime | None, data) - - ended_at = _parse_ended_at(d.pop("ended_at")) - - environment = d.pop("environment") - - def _parse_exit_code(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - exit_code = _parse_exit_code(d.pop("exit_code")) - - initiator = RunInitiator.from_dict(d.pop("initiator")) - - is_scheduled = d.pop("is_scheduled") - - num_attempts = d.pop("num_attempts") - - number = d.pop("number") - - parameters = [] - _parameters = d.pop("parameters") - for parameters_item_data in _parameters: - parameters_item = RunParameter.from_dict(parameters_item_data) - - parameters.append(parameters_item) - - run_id = d.pop("run_id") - - scheduled_at = isoparse(d.pop("scheduled_at")) - - def _parse_started_at(data: object) -> datetime.datetime | None: - if data is None: - return data - try: - if not isinstance(data, str): - raise TypeError() - started_at_type_0 = isoparse(data) - - return started_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(datetime.datetime | None, data) - - started_at = _parse_started_at(d.pop("started_at")) - - status = RunStatus(d.pop("status")) - - status_group = RunStatusGroup(d.pop("status_group")) - - app_slug = d.pop("app_slug", UNSET) - - _attempts = d.pop("attempts", UNSET) - attempts: list[RunAttempt] | Unset = UNSET - if _attempts is not UNSET: - attempts = [] - for attempts_item_data in _attempts: - attempts_item = RunAttempt.from_dict(attempts_item_data) - - attempts.append(attempts_item) - - hostname = d.pop("hostname", UNSET) - - _retry_policy = d.pop("retry_policy", UNSET) - retry_policy: RunRetryPolicy | Unset - if isinstance(_retry_policy, Unset): - retry_policy = UNSET - else: - retry_policy = RunRetryPolicy.from_dict(_retry_policy) - - def _parse_subdomain(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - subdomain = _parse_subdomain(d.pop("subdomain", UNSET)) - - run = cls( - link=link, - app_name=app_name, - app_version=app_version, - cancelled_at=cancelled_at, - created_at=created_at, - ended_at=ended_at, - environment=environment, - exit_code=exit_code, - initiator=initiator, - is_scheduled=is_scheduled, - num_attempts=num_attempts, - number=number, - parameters=parameters, - run_id=run_id, - scheduled_at=scheduled_at, - started_at=started_at, - status=status, - status_group=status_group, - app_slug=app_slug, - attempts=attempts, - hostname=hostname, - retry_policy=retry_policy, - subdomain=subdomain, - ) - - return run diff --git a/src/tower/tower_api_client/models/run_app_initiator_data.py b/src/tower/tower_api_client/models/run_app_initiator_data.py deleted file mode 100644 index 36a382bd..00000000 --- a/src/tower/tower_api_client/models/run_app_initiator_data.py +++ /dev/null @@ -1,44 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..models.run_app_initiator_data_type import RunAppInitiatorDataType - -T = TypeVar("T", bound="RunAppInitiatorData") - - -@_attrs_define -class RunAppInitiatorData: - """ - Attributes: - type_ (RunAppInitiatorDataType): The type of the initiator for this run. - """ - - type_: RunAppInitiatorDataType - - def to_dict(self) -> dict[str, Any]: - type_ = self.type_.value - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "type": type_, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - type_ = RunAppInitiatorDataType(d.pop("type")) - - run_app_initiator_data = cls( - type_=type_, - ) - - return run_app_initiator_data diff --git a/src/tower/tower_api_client/models/run_app_initiator_data_type.py b/src/tower/tower_api_client/models/run_app_initiator_data_type.py deleted file mode 100644 index eb4a1b8b..00000000 --- a/src/tower/tower_api_client/models/run_app_initiator_data_type.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class RunAppInitiatorDataType(str, Enum): - TOWER_CLI = "tower_cli" - TOWER_RUN = "tower_run" - TOWER_UI = "tower_ui" - - def __str__(self) -> str: - return str(self.value) diff --git a/src/tower/tower_api_client/models/run_app_params.py b/src/tower/tower_api_client/models/run_app_params.py deleted file mode 100644 index 943b4a12..00000000 --- a/src/tower/tower_api_client/models/run_app_params.py +++ /dev/null @@ -1,125 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.run_app_initiator_data import RunAppInitiatorData - from ..models.run_app_params_parameters import RunAppParamsParameters - from ..models.run_retry_policy import RunRetryPolicy - - -T = TypeVar("T", bound="RunAppParams") - - -@_attrs_define -class RunAppParams: - """ - Attributes: - environment (str): The environment to run this app in. - parameters (RunAppParamsParameters): The parameters to pass into this app. - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/RunAppParams.json. - initiator (RunAppInitiatorData | Unset): - parent_run_id (None | str | Unset): The ID of the run that invoked this run, if relevant. Should be null, if - none. - retry_policy (RunRetryPolicy | Unset): - """ - - environment: str - parameters: RunAppParamsParameters - schema: str | Unset = UNSET - initiator: RunAppInitiatorData | Unset = UNSET - parent_run_id: None | str | Unset = UNSET - retry_policy: RunRetryPolicy | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - environment = self.environment - - parameters = self.parameters.to_dict() - - schema = self.schema - - initiator: dict[str, Any] | Unset = UNSET - if not isinstance(self.initiator, Unset): - initiator = self.initiator.to_dict() - - parent_run_id: None | str | Unset - if isinstance(self.parent_run_id, Unset): - parent_run_id = UNSET - else: - parent_run_id = self.parent_run_id - - retry_policy: dict[str, Any] | Unset = UNSET - if not isinstance(self.retry_policy, Unset): - retry_policy = self.retry_policy.to_dict() - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "environment": environment, - "parameters": parameters, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - if initiator is not UNSET: - field_dict["initiator"] = initiator - if parent_run_id is not UNSET: - field_dict["parent_run_id"] = parent_run_id - if retry_policy is not UNSET: - field_dict["retry_policy"] = retry_policy - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.run_app_initiator_data import RunAppInitiatorData - from ..models.run_app_params_parameters import RunAppParamsParameters - from ..models.run_retry_policy import RunRetryPolicy - - d = dict(src_dict) - environment = d.pop("environment") - - parameters = RunAppParamsParameters.from_dict(d.pop("parameters")) - - schema = d.pop("$schema", UNSET) - - _initiator = d.pop("initiator", UNSET) - initiator: RunAppInitiatorData | Unset - if isinstance(_initiator, Unset): - initiator = UNSET - else: - initiator = RunAppInitiatorData.from_dict(_initiator) - - def _parse_parent_run_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - parent_run_id = _parse_parent_run_id(d.pop("parent_run_id", UNSET)) - - _retry_policy = d.pop("retry_policy", UNSET) - retry_policy: RunRetryPolicy | Unset - if isinstance(_retry_policy, Unset): - retry_policy = UNSET - else: - retry_policy = RunRetryPolicy.from_dict(_retry_policy) - - run_app_params = cls( - environment=environment, - parameters=parameters, - schema=schema, - initiator=initiator, - parent_run_id=parent_run_id, - retry_policy=retry_policy, - ) - - return run_app_params diff --git a/src/tower/tower_api_client/models/run_app_params_parameters.py b/src/tower/tower_api_client/models/run_app_params_parameters.py deleted file mode 100644 index fff7dd8f..00000000 --- a/src/tower/tower_api_client/models/run_app_params_parameters.py +++ /dev/null @@ -1,46 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="RunAppParamsParameters") - - -@_attrs_define -class RunAppParamsParameters: - """The parameters to pass into this app.""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - run_app_params_parameters = cls() - - run_app_params_parameters.additional_properties = d - return run_app_params_parameters - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/tower/tower_api_client/models/run_app_response.py b/src/tower/tower_api_client/models/run_app_response.py deleted file mode 100644 index ae1464b6..00000000 --- a/src/tower/tower_api_client/models/run_app_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.run import Run - - -T = TypeVar("T", bound="RunAppResponse") - - -@_attrs_define -class RunAppResponse: - """ - Attributes: - run (Run): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/RunAppResponse.json. - """ - - run: Run - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - run = self.run.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "run": run, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.run import Run - - d = dict(src_dict) - run = Run.from_dict(d.pop("run")) - - schema = d.pop("$schema", UNSET) - - run_app_response = cls( - run=run, - schema=schema, - ) - - return run_app_response diff --git a/src/tower/tower_api_client/models/run_attempt.py b/src/tower/tower_api_client/models/run_attempt.py deleted file mode 100644 index da912e6d..00000000 --- a/src/tower/tower_api_client/models/run_attempt.py +++ /dev/null @@ -1,117 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from dateutil.parser import isoparse - -T = TypeVar("T", bound="RunAttempt") - - -@_attrs_define -class RunAttempt: - """ - Attributes: - ended_at (datetime.datetime | None): When this attempt ended. - exit_code (int | None): Exit code for this attempt. - seq (int): 1-based attempt number. - started_at (datetime.datetime | None): When this attempt started. - status (str): Terminal status of this attempt. - """ - - ended_at: datetime.datetime | None - exit_code: int | None - seq: int - started_at: datetime.datetime | None - status: str - - def to_dict(self) -> dict[str, Any]: - ended_at: None | str - if isinstance(self.ended_at, datetime.datetime): - ended_at = self.ended_at.isoformat() - else: - ended_at = self.ended_at - - exit_code: int | None - exit_code = self.exit_code - - seq = self.seq - - started_at: None | str - if isinstance(self.started_at, datetime.datetime): - started_at = self.started_at.isoformat() - else: - started_at = self.started_at - - status = self.status - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "ended_at": ended_at, - "exit_code": exit_code, - "seq": seq, - "started_at": started_at, - "status": status, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_ended_at(data: object) -> datetime.datetime | None: - if data is None: - return data - try: - if not isinstance(data, str): - raise TypeError() - ended_at_type_0 = isoparse(data) - - return ended_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(datetime.datetime | None, data) - - ended_at = _parse_ended_at(d.pop("ended_at")) - - def _parse_exit_code(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - exit_code = _parse_exit_code(d.pop("exit_code")) - - seq = d.pop("seq") - - def _parse_started_at(data: object) -> datetime.datetime | None: - if data is None: - return data - try: - if not isinstance(data, str): - raise TypeError() - started_at_type_0 = isoparse(data) - - return started_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(datetime.datetime | None, data) - - started_at = _parse_started_at(d.pop("started_at")) - - status = d.pop("status") - - run_attempt = cls( - ended_at=ended_at, - exit_code=exit_code, - seq=seq, - started_at=started_at, - status=status, - ) - - return run_attempt diff --git a/src/tower/tower_api_client/models/run_failure_alert.py b/src/tower/tower_api_client/models/run_failure_alert.py deleted file mode 100644 index 6a799b4b..00000000 --- a/src/tower/tower_api_client/models/run_failure_alert.py +++ /dev/null @@ -1,66 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -if TYPE_CHECKING: - from ..models.app import App - from ..models.run import Run - - -T = TypeVar("T", bound="RunFailureAlert") - - -@_attrs_define -class RunFailureAlert: - """ - Attributes: - app (App): - environment (str): Environment this run was in - run (Run): - """ - - app: App - environment: str - run: Run - - def to_dict(self) -> dict[str, Any]: - app = self.app.to_dict() - - environment = self.environment - - run = self.run.to_dict() - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "app": app, - "environment": environment, - "run": run, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.app import App - from ..models.run import Run - - d = dict(src_dict) - app = App.from_dict(d.pop("app")) - - environment = d.pop("environment") - - run = Run.from_dict(d.pop("run")) - - run_failure_alert = cls( - app=app, - environment=environment, - run=run, - ) - - return run_failure_alert diff --git a/src/tower/tower_api_client/models/run_graph_node.py b/src/tower/tower_api_client/models/run_graph_node.py deleted file mode 100644 index 4c94b26a..00000000 --- a/src/tower/tower_api_client/models/run_graph_node.py +++ /dev/null @@ -1,56 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -if TYPE_CHECKING: - from ..models.run_graph_run_id import RunGraphRunID - - -T = TypeVar("T", bound="RunGraphNode") - - -@_attrs_define -class RunGraphNode: - """ - Attributes: - id (RunGraphRunID): - parent_id (RunGraphRunID): - """ - - id: RunGraphRunID - parent_id: RunGraphRunID - - def to_dict(self) -> dict[str, Any]: - id = self.id.to_dict() - - parent_id = self.parent_id.to_dict() - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "id": id, - "parent_id": parent_id, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.run_graph_run_id import RunGraphRunID - - d = dict(src_dict) - id = RunGraphRunID.from_dict(d.pop("id")) - - parent_id = RunGraphRunID.from_dict(d.pop("parent_id")) - - run_graph_node = cls( - id=id, - parent_id=parent_id, - ) - - return run_graph_node diff --git a/src/tower/tower_api_client/models/run_graph_run_id.py b/src/tower/tower_api_client/models/run_graph_run_id.py deleted file mode 100644 index d9c503a8..00000000 --- a/src/tower/tower_api_client/models/run_graph_run_id.py +++ /dev/null @@ -1,50 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -T = TypeVar("T", bound="RunGraphRunID") - - -@_attrs_define -class RunGraphRunID: - """ - Attributes: - app_name (str): - number (int): - """ - - app_name: str - number: int - - def to_dict(self) -> dict[str, Any]: - app_name = self.app_name - - number = self.number - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "app_name": app_name, - "number": number, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - app_name = d.pop("app_name") - - number = d.pop("number") - - run_graph_run_id = cls( - app_name=app_name, - number=number, - ) - - return run_graph_run_id diff --git a/src/tower/tower_api_client/models/run_initiator.py b/src/tower/tower_api_client/models/run_initiator.py deleted file mode 100644 index e0df03d9..00000000 --- a/src/tower/tower_api_client/models/run_initiator.py +++ /dev/null @@ -1,89 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast - -from attrs import define as _attrs_define - -if TYPE_CHECKING: - from ..models.run_run_initiator_details import RunRunInitiatorDetails - from ..models.schedule_run_initiator_details import ScheduleRunInitiatorDetails - - -T = TypeVar("T", bound="RunInitiator") - - -@_attrs_define -class RunInitiator: - """ - Attributes: - details (RunRunInitiatorDetails | ScheduleRunInitiatorDetails): Additional information about the initiator of a - run. - type_ (None | str): The type of initiator for this run. Null if none or unknown. - """ - - details: RunRunInitiatorDetails | ScheduleRunInitiatorDetails - type_: None | str - - def to_dict(self) -> dict[str, Any]: - from ..models.schedule_run_initiator_details import ScheduleRunInitiatorDetails - - details: dict[str, Any] - if isinstance(self.details, ScheduleRunInitiatorDetails): - details = self.details.to_dict() - else: - details = self.details.to_dict() - - type_: None | str - type_ = self.type_ - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "details": details, - "type": type_, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.run_run_initiator_details import RunRunInitiatorDetails - from ..models.schedule_run_initiator_details import ScheduleRunInitiatorDetails - - d = dict(src_dict) - - def _parse_details( - data: object, - ) -> RunRunInitiatorDetails | ScheduleRunInitiatorDetails: - try: - if not isinstance(data, dict): - raise TypeError() - details_type_0 = ScheduleRunInitiatorDetails.from_dict(data) - - return details_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - if not isinstance(data, dict): - raise TypeError() - details_type_1 = RunRunInitiatorDetails.from_dict(data) - - return details_type_1 - - details = _parse_details(d.pop("details")) - - def _parse_type_(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - type_ = _parse_type_(d.pop("type")) - - run_initiator = cls( - details=details, - type_=type_, - ) - - return run_initiator diff --git a/src/tower/tower_api_client/models/run_log_line.py b/src/tower/tower_api_client/models/run_log_line.py deleted file mode 100644 index 01ecc67c..00000000 --- a/src/tower/tower_api_client/models/run_log_line.py +++ /dev/null @@ -1,113 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from dateutil.parser import isoparse - -from ..models.run_log_line_channel import RunLogLineChannel -from ..types import UNSET, Unset - -T = TypeVar("T", bound="RunLogLine") - - -@_attrs_define -class RunLogLine: - """ - Attributes: - attempt_seq (int): The attempt number this log line belongs to (1-based). Attempt 1 is the original execution; - 2+ are retries. - channel (RunLogLineChannel): The channel this log line belongs to. - content (str): Contents of the log message. - line_num (int): Line number. - reported_at (datetime.datetime): Timestamp of the log line. - run_id (str): The uuid of the Run. - message (str | Unset): This property is deprecated. Use content instead. - timestamp (datetime.datetime | Unset): This property is deprecated. Use reported_at instead. - """ - - attempt_seq: int - channel: RunLogLineChannel - content: str - line_num: int - reported_at: datetime.datetime - run_id: str - message: str | Unset = UNSET - timestamp: datetime.datetime | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - attempt_seq = self.attempt_seq - - channel = self.channel.value - - content = self.content - - line_num = self.line_num - - reported_at = self.reported_at.isoformat() - - run_id = self.run_id - - message = self.message - - timestamp: str | Unset = UNSET - if not isinstance(self.timestamp, Unset): - timestamp = self.timestamp.isoformat() - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "attempt_seq": attempt_seq, - "channel": channel, - "content": content, - "line_num": line_num, - "reported_at": reported_at, - "run_id": run_id, - } - ) - if message is not UNSET: - field_dict["message"] = message - if timestamp is not UNSET: - field_dict["timestamp"] = timestamp - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - attempt_seq = d.pop("attempt_seq") - - channel = RunLogLineChannel(d.pop("channel")) - - content = d.pop("content") - - line_num = d.pop("line_num") - - reported_at = isoparse(d.pop("reported_at")) - - run_id = d.pop("run_id") - - message = d.pop("message", UNSET) - - _timestamp = d.pop("timestamp", UNSET) - timestamp: datetime.datetime | Unset - if isinstance(_timestamp, Unset): - timestamp = UNSET - else: - timestamp = isoparse(_timestamp) - - run_log_line = cls( - attempt_seq=attempt_seq, - channel=channel, - content=content, - line_num=line_num, - reported_at=reported_at, - run_id=run_id, - message=message, - timestamp=timestamp, - ) - - return run_log_line diff --git a/src/tower/tower_api_client/models/run_log_line_channel.py b/src/tower/tower_api_client/models/run_log_line_channel.py deleted file mode 100644 index 547ca73c..00000000 --- a/src/tower/tower_api_client/models/run_log_line_channel.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class RunLogLineChannel(str, Enum): - PROGRAM = "program" - SETUP = "setup" - - def __str__(self) -> str: - return str(self.value) diff --git a/src/tower/tower_api_client/models/run_parameter.py b/src/tower/tower_api_client/models/run_parameter.py deleted file mode 100644 index f668ccc1..00000000 --- a/src/tower/tower_api_client/models/run_parameter.py +++ /dev/null @@ -1,61 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="RunParameter") - - -@_attrs_define -class RunParameter: - """ - Attributes: - name (str): - value (str): - hidden (bool | Unset): Whether this parameter is hidden/secret. Defaults to false. Default: False. - """ - - name: str - value: str - hidden: bool | Unset = False - - def to_dict(self) -> dict[str, Any]: - name = self.name - - value = self.value - - hidden = self.hidden - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "name": name, - "value": value, - } - ) - if hidden is not UNSET: - field_dict["hidden"] = hidden - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - name = d.pop("name") - - value = d.pop("value") - - hidden = d.pop("hidden", UNSET) - - run_parameter = cls( - name=name, - value=value, - hidden=hidden, - ) - - return run_parameter diff --git a/src/tower/tower_api_client/models/run_results.py b/src/tower/tower_api_client/models/run_results.py deleted file mode 100644 index 37c69711..00000000 --- a/src/tower/tower_api_client/models/run_results.py +++ /dev/null @@ -1,90 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -T = TypeVar("T", bound="RunResults") - - -@_attrs_define -class RunResults: - """ - Attributes: - cancelled (int): - crashed (int): - errored (int): - exited (int): - pending (int): - retrying (int): - running (int): - """ - - cancelled: int - crashed: int - errored: int - exited: int - pending: int - retrying: int - running: int - - def to_dict(self) -> dict[str, Any]: - cancelled = self.cancelled - - crashed = self.crashed - - errored = self.errored - - exited = self.exited - - pending = self.pending - - retrying = self.retrying - - running = self.running - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "cancelled": cancelled, - "crashed": crashed, - "errored": errored, - "exited": exited, - "pending": pending, - "retrying": retrying, - "running": running, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - cancelled = d.pop("cancelled") - - crashed = d.pop("crashed") - - errored = d.pop("errored") - - exited = d.pop("exited") - - pending = d.pop("pending") - - retrying = d.pop("retrying") - - running = d.pop("running") - - run_results = cls( - cancelled=cancelled, - crashed=crashed, - errored=errored, - exited=exited, - pending=pending, - retrying=retrying, - running=running, - ) - - return run_results diff --git a/src/tower/tower_api_client/models/run_retry_policy.py b/src/tower/tower_api_client/models/run_retry_policy.py deleted file mode 100644 index bcc3db09..00000000 --- a/src/tower/tower_api_client/models/run_retry_policy.py +++ /dev/null @@ -1,58 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -T = TypeVar("T", bound="RunRetryPolicy") - - -@_attrs_define -class RunRetryPolicy: - """ - Attributes: - max_retries (int): - retry_delay_seconds (int): - use_exponential_backoff (bool): - """ - - max_retries: int - retry_delay_seconds: int - use_exponential_backoff: bool - - def to_dict(self) -> dict[str, Any]: - max_retries = self.max_retries - - retry_delay_seconds = self.retry_delay_seconds - - use_exponential_backoff = self.use_exponential_backoff - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "max_retries": max_retries, - "retry_delay_seconds": retry_delay_seconds, - "use_exponential_backoff": use_exponential_backoff, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - max_retries = d.pop("max_retries") - - retry_delay_seconds = d.pop("retry_delay_seconds") - - use_exponential_backoff = d.pop("use_exponential_backoff") - - run_retry_policy = cls( - max_retries=max_retries, - retry_delay_seconds=retry_delay_seconds, - use_exponential_backoff=use_exponential_backoff, - ) - - return run_retry_policy diff --git a/src/tower/tower_api_client/models/run_run_initiator_details.py b/src/tower/tower_api_client/models/run_run_initiator_details.py deleted file mode 100644 index a111d53d..00000000 --- a/src/tower/tower_api_client/models/run_run_initiator_details.py +++ /dev/null @@ -1,51 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="RunRunInitiatorDetails") - - -@_attrs_define -class RunRunInitiatorDetails: - """ - Attributes: - run_app_name (str | Unset): The name of the app that initiated this run, if type is 'tower_run' - run_number (int | Unset): The number of the run that initaited this run, if type is 'tower_run' - """ - - run_app_name: str | Unset = UNSET - run_number: int | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - run_app_name = self.run_app_name - - run_number = self.run_number - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if run_app_name is not UNSET: - field_dict["run_app_name"] = run_app_name - if run_number is not UNSET: - field_dict["run_number"] = run_number - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - run_app_name = d.pop("run_app_name", UNSET) - - run_number = d.pop("run_number", UNSET) - - run_run_initiator_details = cls( - run_app_name=run_app_name, - run_number=run_number, - ) - - return run_run_initiator_details diff --git a/src/tower/tower_api_client/models/run_statistics.py b/src/tower/tower_api_client/models/run_statistics.py deleted file mode 100644 index 92e20b21..00000000 --- a/src/tower/tower_api_client/models/run_statistics.py +++ /dev/null @@ -1,82 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -T = TypeVar("T", bound="RunStatistics") - - -@_attrs_define -class RunStatistics: - """ - Attributes: - cancelled_runs (int): - crashed_runs (int): - errored_runs (int): - exited_runs (int): - running_runs (int): - total_runs (int): - """ - - cancelled_runs: int - crashed_runs: int - errored_runs: int - exited_runs: int - running_runs: int - total_runs: int - - def to_dict(self) -> dict[str, Any]: - cancelled_runs = self.cancelled_runs - - crashed_runs = self.crashed_runs - - errored_runs = self.errored_runs - - exited_runs = self.exited_runs - - running_runs = self.running_runs - - total_runs = self.total_runs - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "cancelled_runs": cancelled_runs, - "crashed_runs": crashed_runs, - "errored_runs": errored_runs, - "exited_runs": exited_runs, - "running_runs": running_runs, - "total_runs": total_runs, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - cancelled_runs = d.pop("cancelled_runs") - - crashed_runs = d.pop("crashed_runs") - - errored_runs = d.pop("errored_runs") - - exited_runs = d.pop("exited_runs") - - running_runs = d.pop("running_runs") - - total_runs = d.pop("total_runs") - - run_statistics = cls( - cancelled_runs=cancelled_runs, - crashed_runs=crashed_runs, - errored_runs=errored_runs, - exited_runs=exited_runs, - running_runs=running_runs, - total_runs=total_runs, - ) - - return run_statistics diff --git a/src/tower/tower_api_client/models/run_status.py b/src/tower/tower_api_client/models/run_status.py deleted file mode 100644 index 1cad2eb3..00000000 --- a/src/tower/tower_api_client/models/run_status.py +++ /dev/null @@ -1,15 +0,0 @@ -from enum import Enum - - -class RunStatus(str, Enum): - CANCELLED = "cancelled" - CRASHED = "crashed" - ERRORED = "errored" - EXITED = "exited" - PENDING = "pending" - RETRYING = "retrying" - RUNNING = "running" - SCHEDULED = "scheduled" - - def __str__(self) -> str: - return str(self.value) diff --git a/src/tower/tower_api_client/models/run_status_group.py b/src/tower/tower_api_client/models/run_status_group.py deleted file mode 100644 index 942edb5f..00000000 --- a/src/tower/tower_api_client/models/run_status_group.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class RunStatusGroup(str, Enum): - FAILED = "failed" - SUCCESSFUL = "successful" - VALUE_2 = "" - - def __str__(self) -> str: - return str(self.value) diff --git a/src/tower/tower_api_client/models/run_timeseries_point.py b/src/tower/tower_api_client/models/run_timeseries_point.py deleted file mode 100644 index de83c155..00000000 --- a/src/tower/tower_api_client/models/run_timeseries_point.py +++ /dev/null @@ -1,108 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from dateutil.parser import isoparse - -T = TypeVar("T", bound="RunTimeseriesPoint") - - -@_attrs_define -class RunTimeseriesPoint: - """ - Attributes: - cancelled (int): - crashed (int): - errored (int): - exited (int): - pending (int): - period (datetime.datetime): The period of the timeseries point, typically the start of the period. - retrying (int): - running (int): - scheduled (int): - """ - - cancelled: int - crashed: int - errored: int - exited: int - pending: int - period: datetime.datetime - retrying: int - running: int - scheduled: int - - def to_dict(self) -> dict[str, Any]: - cancelled = self.cancelled - - crashed = self.crashed - - errored = self.errored - - exited = self.exited - - pending = self.pending - - period = self.period.isoformat() - - retrying = self.retrying - - running = self.running - - scheduled = self.scheduled - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "cancelled": cancelled, - "crashed": crashed, - "errored": errored, - "exited": exited, - "pending": pending, - "period": period, - "retrying": retrying, - "running": running, - "scheduled": scheduled, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - cancelled = d.pop("cancelled") - - crashed = d.pop("crashed") - - errored = d.pop("errored") - - exited = d.pop("exited") - - pending = d.pop("pending") - - period = isoparse(d.pop("period")) - - retrying = d.pop("retrying") - - running = d.pop("running") - - scheduled = d.pop("scheduled") - - run_timeseries_point = cls( - cancelled=cancelled, - crashed=crashed, - errored=errored, - exited=exited, - pending=pending, - period=period, - retrying=retrying, - running=running, - scheduled=scheduled, - ) - - return run_timeseries_point diff --git a/src/tower/tower_api_client/models/runner.py b/src/tower/tower_api_client/models/runner.py deleted file mode 100644 index 668afb5d..00000000 --- a/src/tower/tower_api_client/models/runner.py +++ /dev/null @@ -1,116 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.run import Run - - -T = TypeVar("T", bound="Runner") - - -@_attrs_define -class Runner: - """ - Attributes: - active_runs (list[Run]): - created_at (str): - id (str): - max_concurrent_apps (int): - num_runs (int): - status (str): - last_health_check_at (str | Unset): - name (str | Unset): Optional human-readable name for the runner - """ - - active_runs: list[Run] - created_at: str - id: str - max_concurrent_apps: int - num_runs: int - status: str - last_health_check_at: str | Unset = UNSET - name: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - active_runs = [] - for active_runs_item_data in self.active_runs: - active_runs_item = active_runs_item_data.to_dict() - active_runs.append(active_runs_item) - - created_at = self.created_at - - id = self.id - - max_concurrent_apps = self.max_concurrent_apps - - num_runs = self.num_runs - - status = self.status - - last_health_check_at = self.last_health_check_at - - name = self.name - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "active_runs": active_runs, - "created_at": created_at, - "id": id, - "max_concurrent_apps": max_concurrent_apps, - "num_runs": num_runs, - "status": status, - } - ) - if last_health_check_at is not UNSET: - field_dict["last_health_check_at"] = last_health_check_at - if name is not UNSET: - field_dict["name"] = name - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.run import Run - - d = dict(src_dict) - active_runs = [] - _active_runs = d.pop("active_runs") - for active_runs_item_data in _active_runs: - active_runs_item = Run.from_dict(active_runs_item_data) - - active_runs.append(active_runs_item) - - created_at = d.pop("created_at") - - id = d.pop("id") - - max_concurrent_apps = d.pop("max_concurrent_apps") - - num_runs = d.pop("num_runs") - - status = d.pop("status") - - last_health_check_at = d.pop("last_health_check_at", UNSET) - - name = d.pop("name", UNSET) - - runner = cls( - active_runs=active_runs, - created_at=created_at, - id=id, - max_concurrent_apps=max_concurrent_apps, - num_runs=num_runs, - status=status, - last_health_check_at=last_health_check_at, - name=name, - ) - - return runner diff --git a/src/tower/tower_api_client/models/runner_credentials.py b/src/tower/tower_api_client/models/runner_credentials.py deleted file mode 100644 index a04a5e82..00000000 --- a/src/tower/tower_api_client/models/runner_credentials.py +++ /dev/null @@ -1,74 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define - -T = TypeVar("T", bound="RunnerCredentials") - - -@_attrs_define -class RunnerCredentials: - """ - Attributes: - certificate (str): The signed certificate used by the runner to authenticate itself to Tower. - private_key (str): The private key used by the runner to authenticate itself to Tower. - root_ca (None | str): The PEM encoded root CA certificate that is used to verify the runner's certificate when - Tower is responsible for signing server certs. - runner_service_url (str): The host of the runner service that this runner will connect to. This is typically the - Tower service host. - """ - - certificate: str - private_key: str - root_ca: None | str - runner_service_url: str - - def to_dict(self) -> dict[str, Any]: - certificate = self.certificate - - private_key = self.private_key - - root_ca: None | str - root_ca = self.root_ca - - runner_service_url = self.runner_service_url - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "certificate": certificate, - "private_key": private_key, - "root_ca": root_ca, - "runner_service_url": runner_service_url, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - certificate = d.pop("certificate") - - private_key = d.pop("private_key") - - def _parse_root_ca(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - root_ca = _parse_root_ca(d.pop("root_ca")) - - runner_service_url = d.pop("runner_service_url") - - runner_credentials = cls( - certificate=certificate, - private_key=private_key, - root_ca=root_ca, - runner_service_url=runner_service_url, - ) - - return runner_credentials diff --git a/src/tower/tower_api_client/models/schedule.py b/src/tower/tower_api_client/models/schedule.py deleted file mode 100644 index 42f77665..00000000 --- a/src/tower/tower_api_client/models/schedule.py +++ /dev/null @@ -1,166 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from dateutil.parser import isoparse - -from ..models.schedule_app_status import ScheduleAppStatus -from ..models.schedule_overlap_policy import ScheduleOverlapPolicy -from ..models.schedule_status import ScheduleStatus -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.run_parameter import RunParameter - - -T = TypeVar("T", bound="Schedule") - - -@_attrs_define -class Schedule: - """ - Attributes: - app_name (str): The name of the app that will be executed - app_status (ScheduleAppStatus): The status of the app - created_at (datetime.datetime): The timestamp when the schedule was created - cron (str): The cron expression defining when the app should run - environment (str): The environment to run the app in - id (str): The unique identifier for the schedule - name (str): The name of this schedule - overlap_policy (ScheduleOverlapPolicy): The policy for handling overlapping runs - status (ScheduleStatus): The status of the schedule - timezone (str): The IANA timezone identifier that the cron expression is evaluated in (e.g., 'America/New_York', - 'Europe/London'). Defaults to 'UTC'. - updated_at (datetime.datetime): The timestamp when the schedule was last updated - app_version (str | Unset): The specific app version to run, or null for the default version - parameters (list[RunParameter] | Unset): The parameters to pass when running the app - """ - - app_name: str - app_status: ScheduleAppStatus - created_at: datetime.datetime - cron: str - environment: str - id: str - name: str - overlap_policy: ScheduleOverlapPolicy - status: ScheduleStatus - timezone: str - updated_at: datetime.datetime - app_version: str | Unset = UNSET - parameters: list[RunParameter] | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - app_name = self.app_name - - app_status = self.app_status.value - - created_at = self.created_at.isoformat() - - cron = self.cron - - environment = self.environment - - id = self.id - - name = self.name - - overlap_policy = self.overlap_policy.value - - status = self.status.value - - timezone = self.timezone - - updated_at = self.updated_at.isoformat() - - app_version = self.app_version - - parameters: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.parameters, Unset): - parameters = [] - for parameters_item_data in self.parameters: - parameters_item = parameters_item_data.to_dict() - parameters.append(parameters_item) - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "app_name": app_name, - "app_status": app_status, - "created_at": created_at, - "cron": cron, - "environment": environment, - "id": id, - "name": name, - "overlap_policy": overlap_policy, - "status": status, - "timezone": timezone, - "updated_at": updated_at, - } - ) - if app_version is not UNSET: - field_dict["app_version"] = app_version - if parameters is not UNSET: - field_dict["parameters"] = parameters - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.run_parameter import RunParameter - - d = dict(src_dict) - app_name = d.pop("app_name") - - app_status = ScheduleAppStatus(d.pop("app_status")) - - created_at = isoparse(d.pop("created_at")) - - cron = d.pop("cron") - - environment = d.pop("environment") - - id = d.pop("id") - - name = d.pop("name") - - overlap_policy = ScheduleOverlapPolicy(d.pop("overlap_policy")) - - status = ScheduleStatus(d.pop("status")) - - timezone = d.pop("timezone") - - updated_at = isoparse(d.pop("updated_at")) - - app_version = d.pop("app_version", UNSET) - - _parameters = d.pop("parameters", UNSET) - parameters: list[RunParameter] | Unset = UNSET - if _parameters is not UNSET: - parameters = [] - for parameters_item_data in _parameters: - parameters_item = RunParameter.from_dict(parameters_item_data) - - parameters.append(parameters_item) - - schedule = cls( - app_name=app_name, - app_status=app_status, - created_at=created_at, - cron=cron, - environment=environment, - id=id, - name=name, - overlap_policy=overlap_policy, - status=status, - timezone=timezone, - updated_at=updated_at, - app_version=app_version, - parameters=parameters, - ) - - return schedule diff --git a/src/tower/tower_api_client/models/schedule_app_status.py b/src/tower/tower_api_client/models/schedule_app_status.py deleted file mode 100644 index cc79ba66..00000000 --- a/src/tower/tower_api_client/models/schedule_app_status.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class ScheduleAppStatus(str, Enum): - ACTIVE = "active" - DISABLED = "disabled" - - def __str__(self) -> str: - return str(self.value) diff --git a/src/tower/tower_api_client/models/schedule_overlap_policy.py b/src/tower/tower_api_client/models/schedule_overlap_policy.py deleted file mode 100644 index 2f4c0e12..00000000 --- a/src/tower/tower_api_client/models/schedule_overlap_policy.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class ScheduleOverlapPolicy(str, Enum): - ALLOW = "allow" - SKIP = "skip" - - def __str__(self) -> str: - return str(self.value) diff --git a/src/tower/tower_api_client/models/schedule_run_initiator_details.py b/src/tower/tower_api_client/models/schedule_run_initiator_details.py deleted file mode 100644 index ccb85ded..00000000 --- a/src/tower/tower_api_client/models/schedule_run_initiator_details.py +++ /dev/null @@ -1,42 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="ScheduleRunInitiatorDetails") - - -@_attrs_define -class ScheduleRunInitiatorDetails: - """ - Attributes: - schedule_name (str | Unset): The name of the schedule that initiated this run, if type is 'tower_schedule' - """ - - schedule_name: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - schedule_name = self.schedule_name - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if schedule_name is not UNSET: - field_dict["schedule_name"] = schedule_name - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - schedule_name = d.pop("schedule_name", UNSET) - - schedule_run_initiator_details = cls( - schedule_name=schedule_name, - ) - - return schedule_run_initiator_details diff --git a/src/tower/tower_api_client/models/schedule_status.py b/src/tower/tower_api_client/models/schedule_status.py deleted file mode 100644 index 20e02959..00000000 --- a/src/tower/tower_api_client/models/schedule_status.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class ScheduleStatus(str, Enum): - ACTIVE = "active" - DISABLED = "disabled" - - def __str__(self) -> str: - return str(self.value) diff --git a/src/tower/tower_api_client/models/search_runs_response.py b/src/tower/tower_api_client/models/search_runs_response.py deleted file mode 100644 index 365ae75c..00000000 --- a/src/tower/tower_api_client/models/search_runs_response.py +++ /dev/null @@ -1,78 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.pagination import Pagination - from ..models.run import Run - - -T = TypeVar("T", bound="SearchRunsResponse") - - -@_attrs_define -class SearchRunsResponse: - """ - Attributes: - pages (Pagination): - runs (list[Run]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/SearchRunsResponse.json. - """ - - pages: Pagination - runs: list[Run] - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - pages = self.pages.to_dict() - - runs = [] - for runs_item_data in self.runs: - runs_item = runs_item_data.to_dict() - runs.append(runs_item) - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "pages": pages, - "runs": runs, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.pagination import Pagination - from ..models.run import Run - - d = dict(src_dict) - pages = Pagination.from_dict(d.pop("pages")) - - runs = [] - _runs = d.pop("runs") - for runs_item_data in _runs: - runs_item = Run.from_dict(runs_item_data) - - runs.append(runs_item) - - schema = d.pop("$schema", UNSET) - - search_runs_response = cls( - pages=pages, - runs=runs, - schema=schema, - ) - - return search_runs_response diff --git a/src/tower/tower_api_client/models/search_runs_status_item.py b/src/tower/tower_api_client/models/search_runs_status_item.py deleted file mode 100644 index afac0331..00000000 --- a/src/tower/tower_api_client/models/search_runs_status_item.py +++ /dev/null @@ -1,14 +0,0 @@ -from enum import Enum - - -class SearchRunsStatusItem(str, Enum): - CANCELLED = "cancelled" - CRASHED = "crashed" - ERRORED = "errored" - EXITED = "exited" - PENDING = "pending" - RETRYING = "retrying" - RUNNING = "running" - - def __str__(self) -> str: - return str(self.value) diff --git a/src/tower/tower_api_client/models/secret.py b/src/tower/tower_api_client/models/secret.py deleted file mode 100644 index acac2b20..00000000 --- a/src/tower/tower_api_client/models/secret.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from dateutil.parser import isoparse - -T = TypeVar("T", bound="Secret") - - -@_attrs_define -class Secret: - """ - Attributes: - created_at (datetime.datetime): - environment (str): - name (str): - preview (str): - """ - - created_at: datetime.datetime - environment: str - name: str - preview: str - - def to_dict(self) -> dict[str, Any]: - created_at = self.created_at.isoformat() - - environment = self.environment - - name = self.name - - preview = self.preview - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "created_at": created_at, - "environment": environment, - "name": name, - "preview": preview, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - created_at = isoparse(d.pop("created_at")) - - environment = d.pop("environment") - - name = d.pop("name") - - preview = d.pop("preview") - - secret = cls( - created_at=created_at, - environment=environment, - name=name, - preview=preview, - ) - - return secret diff --git a/src/tower/tower_api_client/models/session.py b/src/tower/tower_api_client/models/session.py deleted file mode 100644 index a3c8bcaa..00000000 --- a/src/tower/tower_api_client/models/session.py +++ /dev/null @@ -1,88 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -if TYPE_CHECKING: - from ..models.featurebase_identity import FeaturebaseIdentity - from ..models.team import Team - from ..models.token import Token - from ..models.user import User - - -T = TypeVar("T", bound="Session") - - -@_attrs_define -class Session: - """ - Attributes: - featurebase_identity (FeaturebaseIdentity): - teams (list[Team]): - token (Token): - user (User): - """ - - featurebase_identity: FeaturebaseIdentity - teams: list[Team] - token: Token - user: User - - def to_dict(self) -> dict[str, Any]: - featurebase_identity = self.featurebase_identity.to_dict() - - teams = [] - for teams_item_data in self.teams: - teams_item = teams_item_data.to_dict() - teams.append(teams_item) - - token = self.token.to_dict() - - user = self.user.to_dict() - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "featurebase_identity": featurebase_identity, - "teams": teams, - "token": token, - "user": user, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.featurebase_identity import FeaturebaseIdentity - from ..models.team import Team - from ..models.token import Token - from ..models.user import User - - d = dict(src_dict) - featurebase_identity = FeaturebaseIdentity.from_dict( - d.pop("featurebase_identity") - ) - - teams = [] - _teams = d.pop("teams") - for teams_item_data in _teams: - teams_item = Team.from_dict(teams_item_data) - - teams.append(teams_item) - - token = Token.from_dict(d.pop("token")) - - user = User.from_dict(d.pop("user")) - - session = cls( - featurebase_identity=featurebase_identity, - teams=teams, - token=token, - user=user, - ) - - return session diff --git a/src/tower/tower_api_client/models/shoulder_tap.py b/src/tower/tower_api_client/models/shoulder_tap.py deleted file mode 100644 index 181e7ae4..00000000 --- a/src/tower/tower_api_client/models/shoulder_tap.py +++ /dev/null @@ -1,76 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from dateutil.parser import isoparse - -T = TypeVar("T", bound="ShoulderTap") - - -@_attrs_define -class ShoulderTap: - """ - Attributes: - account_id (str): Account ID that owns the resource. - event_type (str): Event type in format resource.changed (e.g., apps.changed, runs.changed). - resource_id (str): Unique identifier of the resource. - resource_type (str): Type of resource (apps, runs, schedules, secrets, environments, catalogs). - timestamp (datetime.datetime): Timestamp when the event occurred. - """ - - account_id: str - event_type: str - resource_id: str - resource_type: str - timestamp: datetime.datetime - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - event_type = self.event_type - - resource_id = self.resource_id - - resource_type = self.resource_type - - timestamp = self.timestamp.isoformat() - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "account_id": account_id, - "event_type": event_type, - "resource_id": resource_id, - "resource_type": resource_type, - "timestamp": timestamp, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = d.pop("account_id") - - event_type = d.pop("event_type") - - resource_id = d.pop("resource_id") - - resource_type = d.pop("resource_type") - - timestamp = isoparse(d.pop("timestamp")) - - shoulder_tap = cls( - account_id=account_id, - event_type=event_type, - resource_id=resource_id, - resource_type=resource_type, - timestamp=timestamp, - ) - - return shoulder_tap diff --git a/src/tower/tower_api_client/models/sse_warning.py b/src/tower/tower_api_client/models/sse_warning.py deleted file mode 100644 index 6b6cfdcf..00000000 --- a/src/tower/tower_api_client/models/sse_warning.py +++ /dev/null @@ -1,52 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from dateutil.parser import isoparse - -T = TypeVar("T", bound="SSEWarning") - - -@_attrs_define -class SSEWarning: - """ - Attributes: - content (str): Contents of the warning. - reported_at (datetime.datetime): Timestamp of the event. - """ - - content: str - reported_at: datetime.datetime - - def to_dict(self) -> dict[str, Any]: - content = self.content - - reported_at = self.reported_at.isoformat() - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "content": content, - "reported_at": reported_at, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - content = d.pop("content") - - reported_at = isoparse(d.pop("reported_at")) - - sse_warning = cls( - content=content, - reported_at=reported_at, - ) - - return sse_warning diff --git a/src/tower/tower_api_client/models/statistics_settings.py b/src/tower/tower_api_client/models/statistics_settings.py deleted file mode 100644 index 2791d517..00000000 --- a/src/tower/tower_api_client/models/statistics_settings.py +++ /dev/null @@ -1,78 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from dateutil.parser import isoparse - -from ..models.statistics_settings_interval import StatisticsSettingsInterval - -T = TypeVar("T", bound="StatisticsSettings") - - -@_attrs_define -class StatisticsSettings: - """ - Attributes: - end_at (datetime.datetime): The end time for the statistics period. - environment (str): The environment to get statistics for. - interval (StatisticsSettingsInterval): The interval for the statistics period. - start_at (datetime.datetime): The start time for the statistics period. - timezone (str): The time zone for the statistics period. - """ - - end_at: datetime.datetime - environment: str - interval: StatisticsSettingsInterval - start_at: datetime.datetime - timezone: str - - def to_dict(self) -> dict[str, Any]: - end_at = self.end_at.isoformat() - - environment = self.environment - - interval = self.interval.value - - start_at = self.start_at.isoformat() - - timezone = self.timezone - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "end_at": end_at, - "environment": environment, - "interval": interval, - "start_at": start_at, - "timezone": timezone, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - end_at = isoparse(d.pop("end_at")) - - environment = d.pop("environment") - - interval = StatisticsSettingsInterval(d.pop("interval")) - - start_at = isoparse(d.pop("start_at")) - - timezone = d.pop("timezone") - - statistics_settings = cls( - end_at=end_at, - environment=environment, - interval=interval, - start_at=start_at, - timezone=timezone, - ) - - return statistics_settings diff --git a/src/tower/tower_api_client/models/statistics_settings_interval.py b/src/tower/tower_api_client/models/statistics_settings_interval.py deleted file mode 100644 index def5d1a0..00000000 --- a/src/tower/tower_api_client/models/statistics_settings_interval.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class StatisticsSettingsInterval(str, Enum): - DAILY = "daily" - HOURLY = "hourly" - - def __str__(self) -> str: - return str(self.value) diff --git a/src/tower/tower_api_client/models/stream_alerts_event_alert.py b/src/tower/tower_api_client/models/stream_alerts_event_alert.py deleted file mode 100644 index 53a97347..00000000 --- a/src/tower/tower_api_client/models/stream_alerts_event_alert.py +++ /dev/null @@ -1,103 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import ( - TYPE_CHECKING, - Any, - Literal, - TypeVar, - cast, -) - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.alert import Alert - - -T = TypeVar("T", bound="StreamAlertsEventAlert") - - -@_attrs_define -class StreamAlertsEventAlert: - """ - Attributes: - data (Alert): - event (Literal['alert']): The event name. - id (int | Unset): The event ID. - retry (int | Unset): The retry time in milliseconds. - """ - - data: Alert - event: Literal["alert"] - id: int | Unset = UNSET - retry: int | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - - event = self.event - - id = self.id - - retry = self.retry - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "event": event, - } - ) - if id is not UNSET: - field_dict["id"] = id - if retry is not UNSET: - field_dict["retry"] = retry - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.alert import Alert - - d = dict(src_dict) - data = Alert.from_dict(d.pop("data")) - - event = cast(Literal["alert"], d.pop("event")) - if event != "alert": - raise ValueError(f"event must match const 'alert', got '{event}'") - - id = d.pop("id", UNSET) - - retry = d.pop("retry", UNSET) - - stream_alerts_event_alert = cls( - data=data, - event=event, - id=id, - retry=retry, - ) - - stream_alerts_event_alert.additional_properties = d - return stream_alerts_event_alert - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/tower/tower_api_client/models/stream_alerts_event_error.py b/src/tower/tower_api_client/models/stream_alerts_event_error.py deleted file mode 100644 index ffd5e1d1..00000000 --- a/src/tower/tower_api_client/models/stream_alerts_event_error.py +++ /dev/null @@ -1,103 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import ( - TYPE_CHECKING, - Any, - Literal, - TypeVar, - cast, -) - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.sse_warning import SSEWarning - - -T = TypeVar("T", bound="StreamAlertsEventError") - - -@_attrs_define -class StreamAlertsEventError: - """ - Attributes: - data (SSEWarning): - event (Literal['error']): The event name. - id (int | Unset): The event ID. - retry (int | Unset): The retry time in milliseconds. - """ - - data: SSEWarning - event: Literal["error"] - id: int | Unset = UNSET - retry: int | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - - event = self.event - - id = self.id - - retry = self.retry - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "event": event, - } - ) - if id is not UNSET: - field_dict["id"] = id - if retry is not UNSET: - field_dict["retry"] = retry - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.sse_warning import SSEWarning - - d = dict(src_dict) - data = SSEWarning.from_dict(d.pop("data")) - - event = cast(Literal["error"], d.pop("event")) - if event != "error": - raise ValueError(f"event must match const 'error', got '{event}'") - - id = d.pop("id", UNSET) - - retry = d.pop("retry", UNSET) - - stream_alerts_event_error = cls( - data=data, - event=event, - id=id, - retry=retry, - ) - - stream_alerts_event_error.additional_properties = d - return stream_alerts_event_error - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/tower/tower_api_client/models/stream_run_logs_event_log.py b/src/tower/tower_api_client/models/stream_run_logs_event_log.py deleted file mode 100644 index ec751a57..00000000 --- a/src/tower/tower_api_client/models/stream_run_logs_event_log.py +++ /dev/null @@ -1,103 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import ( - TYPE_CHECKING, - Any, - Literal, - TypeVar, - cast, -) - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.run_log_line import RunLogLine - - -T = TypeVar("T", bound="StreamRunLogsEventLog") - - -@_attrs_define -class StreamRunLogsEventLog: - """ - Attributes: - data (RunLogLine): - event (Literal['log']): The event name. - id (int | Unset): The event ID. - retry (int | Unset): The retry time in milliseconds. - """ - - data: RunLogLine - event: Literal["log"] - id: int | Unset = UNSET - retry: int | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - - event = self.event - - id = self.id - - retry = self.retry - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "event": event, - } - ) - if id is not UNSET: - field_dict["id"] = id - if retry is not UNSET: - field_dict["retry"] = retry - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.run_log_line import RunLogLine - - d = dict(src_dict) - data = RunLogLine.from_dict(d.pop("data")) - - event = cast(Literal["log"], d.pop("event")) - if event != "log": - raise ValueError(f"event must match const 'log', got '{event}'") - - id = d.pop("id", UNSET) - - retry = d.pop("retry", UNSET) - - stream_run_logs_event_log = cls( - data=data, - event=event, - id=id, - retry=retry, - ) - - stream_run_logs_event_log.additional_properties = d - return stream_run_logs_event_log - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/tower/tower_api_client/models/stream_run_logs_event_warning.py b/src/tower/tower_api_client/models/stream_run_logs_event_warning.py deleted file mode 100644 index 4419d8ee..00000000 --- a/src/tower/tower_api_client/models/stream_run_logs_event_warning.py +++ /dev/null @@ -1,103 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import ( - TYPE_CHECKING, - Any, - Literal, - TypeVar, - cast, -) - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.sse_warning import SSEWarning - - -T = TypeVar("T", bound="StreamRunLogsEventWarning") - - -@_attrs_define -class StreamRunLogsEventWarning: - """ - Attributes: - data (SSEWarning): - event (Literal['warning']): The event name. - id (int | Unset): The event ID. - retry (int | Unset): The retry time in milliseconds. - """ - - data: SSEWarning - event: Literal["warning"] - id: int | Unset = UNSET - retry: int | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - - event = self.event - - id = self.id - - retry = self.retry - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "event": event, - } - ) - if id is not UNSET: - field_dict["id"] = id - if retry is not UNSET: - field_dict["retry"] = retry - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.sse_warning import SSEWarning - - d = dict(src_dict) - data = SSEWarning.from_dict(d.pop("data")) - - event = cast(Literal["warning"], d.pop("event")) - if event != "warning": - raise ValueError(f"event must match const 'warning', got '{event}'") - - id = d.pop("id", UNSET) - - retry = d.pop("retry", UNSET) - - stream_run_logs_event_warning = cls( - data=data, - event=event, - id=id, - retry=retry, - ) - - stream_run_logs_event_warning.additional_properties = d - return stream_run_logs_event_warning - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/tower/tower_api_client/models/stream_shouldertaps_event_shouldertap.py b/src/tower/tower_api_client/models/stream_shouldertaps_event_shouldertap.py deleted file mode 100644 index 4f983426..00000000 --- a/src/tower/tower_api_client/models/stream_shouldertaps_event_shouldertap.py +++ /dev/null @@ -1,103 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import ( - TYPE_CHECKING, - Any, - Literal, - TypeVar, - cast, -) - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.shoulder_tap import ShoulderTap - - -T = TypeVar("T", bound="StreamShouldertapsEventShouldertap") - - -@_attrs_define -class StreamShouldertapsEventShouldertap: - """ - Attributes: - data (ShoulderTap): - event (Literal['shouldertap']): The event name. - id (int | Unset): The event ID. - retry (int | Unset): The retry time in milliseconds. - """ - - data: ShoulderTap - event: Literal["shouldertap"] - id: int | Unset = UNSET - retry: int | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - - event = self.event - - id = self.id - - retry = self.retry - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "event": event, - } - ) - if id is not UNSET: - field_dict["id"] = id - if retry is not UNSET: - field_dict["retry"] = retry - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.shoulder_tap import ShoulderTap - - d = dict(src_dict) - data = ShoulderTap.from_dict(d.pop("data")) - - event = cast(Literal["shouldertap"], d.pop("event")) - if event != "shouldertap": - raise ValueError(f"event must match const 'shouldertap', got '{event}'") - - id = d.pop("id", UNSET) - - retry = d.pop("retry", UNSET) - - stream_shouldertaps_event_shouldertap = cls( - data=data, - event=event, - id=id, - retry=retry, - ) - - stream_shouldertaps_event_shouldertap.additional_properties = d - return stream_shouldertaps_event_shouldertap - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/tower/tower_api_client/models/stream_shouldertaps_event_warning.py b/src/tower/tower_api_client/models/stream_shouldertaps_event_warning.py deleted file mode 100644 index b1fc8a4c..00000000 --- a/src/tower/tower_api_client/models/stream_shouldertaps_event_warning.py +++ /dev/null @@ -1,103 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import ( - TYPE_CHECKING, - Any, - Literal, - TypeVar, - cast, -) - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.sse_warning import SSEWarning - - -T = TypeVar("T", bound="StreamShouldertapsEventWarning") - - -@_attrs_define -class StreamShouldertapsEventWarning: - """ - Attributes: - data (SSEWarning): - event (Literal['warning']): The event name. - id (int | Unset): The event ID. - retry (int | Unset): The retry time in milliseconds. - """ - - data: SSEWarning - event: Literal["warning"] - id: int | Unset = UNSET - retry: int | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - - event = self.event - - id = self.id - - retry = self.retry - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "event": event, - } - ) - if id is not UNSET: - field_dict["id"] = id - if retry is not UNSET: - field_dict["retry"] = retry - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.sse_warning import SSEWarning - - d = dict(src_dict) - data = SSEWarning.from_dict(d.pop("data")) - - event = cast(Literal["warning"], d.pop("event")) - if event != "warning": - raise ValueError(f"event must match const 'warning', got '{event}'") - - id = d.pop("id", UNSET) - - retry = d.pop("retry", UNSET) - - stream_shouldertaps_event_warning = cls( - data=data, - event=event, - id=id, - retry=retry, - ) - - stream_shouldertaps_event_warning.additional_properties = d - return stream_shouldertaps_event_warning - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/tower/tower_api_client/models/team.py b/src/tower/tower_api_client/models/team.py deleted file mode 100644 index 21d8eebd..00000000 --- a/src/tower/tower_api_client/models/team.py +++ /dev/null @@ -1,99 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.token import Token - - -T = TypeVar("T", bound="Team") - - -@_attrs_define -class Team: - """ - Attributes: - execution_region (str): - name (str): - organization (str): The name of the organization this team belongs to. - type_ (str): The type of team, either 'personal' or 'team'. - slug (str | Unset): This property is deprecated. Use name instead. - token (Token | Unset): - """ - - execution_region: str - name: str - organization: str - type_: str - slug: str | Unset = UNSET - token: Token | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - execution_region = self.execution_region - - name = self.name - - organization = self.organization - - type_ = self.type_ - - slug = self.slug - - token: dict[str, Any] | Unset = UNSET - if not isinstance(self.token, Unset): - token = self.token.to_dict() - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "execution_region": execution_region, - "name": name, - "organization": organization, - "type": type_, - } - ) - if slug is not UNSET: - field_dict["slug"] = slug - if token is not UNSET: - field_dict["token"] = token - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.token import Token - - d = dict(src_dict) - execution_region = d.pop("execution_region") - - name = d.pop("name") - - organization = d.pop("organization") - - type_ = d.pop("type") - - slug = d.pop("slug", UNSET) - - _token = d.pop("token", UNSET) - token: Token | Unset - if isinstance(_token, Unset): - token = UNSET - else: - token = Token.from_dict(_token) - - team = cls( - execution_region=execution_region, - name=name, - organization=organization, - type_=type_, - slug=slug, - token=token, - ) - - return team diff --git a/src/tower/tower_api_client/models/team_invitation.py b/src/tower/tower_api_client/models/team_invitation.py deleted file mode 100644 index b253abef..00000000 --- a/src/tower/tower_api_client/models/team_invitation.py +++ /dev/null @@ -1,74 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from dateutil.parser import isoparse - -if TYPE_CHECKING: - from ..models.team import Team - - -T = TypeVar("T", bound="TeamInvitation") - - -@_attrs_define -class TeamInvitation: - """ - Attributes: - email (str): - invitation_sent_at (datetime.datetime): - role (str): - team (Team): - """ - - email: str - invitation_sent_at: datetime.datetime - role: str - team: Team - - def to_dict(self) -> dict[str, Any]: - email = self.email - - invitation_sent_at = self.invitation_sent_at.isoformat() - - role = self.role - - team = self.team.to_dict() - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "email": email, - "invitation_sent_at": invitation_sent_at, - "role": role, - "team": team, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.team import Team - - d = dict(src_dict) - email = d.pop("email") - - invitation_sent_at = isoparse(d.pop("invitation_sent_at")) - - role = d.pop("role") - - team = Team.from_dict(d.pop("team")) - - team_invitation = cls( - email=email, - invitation_sent_at=invitation_sent_at, - role=role, - team=team, - ) - - return team_invitation diff --git a/src/tower/tower_api_client/models/team_membership.py b/src/tower/tower_api_client/models/team_membership.py deleted file mode 100644 index 21a0df06..00000000 --- a/src/tower/tower_api_client/models/team_membership.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..models.team_membership_role import TeamMembershipRole - -if TYPE_CHECKING: - from ..models.team import Team - from ..models.user import User - - -T = TypeVar("T", bound="TeamMembership") - - -@_attrs_define -class TeamMembership: - """ - Attributes: - role (TeamMembershipRole): - team (Team): - user (User): - """ - - role: TeamMembershipRole - team: Team - user: User - - def to_dict(self) -> dict[str, Any]: - role = self.role.value - - team = self.team.to_dict() - - user = self.user.to_dict() - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "role": role, - "team": team, - "user": user, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.team import Team - from ..models.user import User - - d = dict(src_dict) - role = TeamMembershipRole(d.pop("role")) - - team = Team.from_dict(d.pop("team")) - - user = User.from_dict(d.pop("user")) - - team_membership = cls( - role=role, - team=team, - user=user, - ) - - return team_membership diff --git a/src/tower/tower_api_client/models/team_membership_role.py b/src/tower/tower_api_client/models/team_membership_role.py deleted file mode 100644 index 64f85be0..00000000 --- a/src/tower/tower_api_client/models/team_membership_role.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class TeamMembershipRole(str, Enum): - ADMIN = "admin" - DEVELOPER = "developer" - - def __str__(self) -> str: - return str(self.value) diff --git a/src/tower/tower_api_client/models/test_webhook_response.py b/src/tower/tower_api_client/models/test_webhook_response.py deleted file mode 100644 index fc269b07..00000000 --- a/src/tower/tower_api_client/models/test_webhook_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.webhook import Webhook - - -T = TypeVar("T", bound="TestWebhookResponse") - - -@_attrs_define -class TestWebhookResponse: - """ - Attributes: - webhook (Webhook): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/TestWebhookResponse.json. - """ - - webhook: Webhook - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - webhook = self.webhook.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "webhook": webhook, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.webhook import Webhook - - d = dict(src_dict) - webhook = Webhook.from_dict(d.pop("webhook")) - - schema = d.pop("$schema", UNSET) - - test_webhook_response = cls( - webhook=webhook, - schema=schema, - ) - - return test_webhook_response diff --git a/src/tower/tower_api_client/models/token.py b/src/tower/tower_api_client/models/token.py deleted file mode 100644 index 598af35c..00000000 --- a/src/tower/tower_api_client/models/token.py +++ /dev/null @@ -1,63 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="Token") - - -@_attrs_define -class Token: - """ - Attributes: - access_token (str): The access token to use when authenticating API requests with Tower. - jwt (str): - refresh_token (str | Unset): The refresh token to use when refreshing an expired access token. For security - reasons, refresh tokens should only be transmitted over secure channels and never logged or stored in plaintext. - It will only be returned upon initial authentication or when explicitly refreshing the access token. - """ - - access_token: str - jwt: str - refresh_token: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - access_token = self.access_token - - jwt = self.jwt - - refresh_token = self.refresh_token - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "access_token": access_token, - "jwt": jwt, - } - ) - if refresh_token is not UNSET: - field_dict["refresh_token"] = refresh_token - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - access_token = d.pop("access_token") - - jwt = d.pop("jwt") - - refresh_token = d.pop("refresh_token", UNSET) - - token = cls( - access_token=access_token, - jwt=jwt, - refresh_token=refresh_token, - ) - - return token diff --git a/src/tower/tower_api_client/models/unverified_authenticator.py b/src/tower/tower_api_client/models/unverified_authenticator.py deleted file mode 100644 index 6fd77faa..00000000 --- a/src/tower/tower_api_client/models/unverified_authenticator.py +++ /dev/null @@ -1,66 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -T = TypeVar("T", bound="UnverifiedAuthenticator") - - -@_attrs_define -class UnverifiedAuthenticator: - """ - Attributes: - issuer (str): The issuer of the unverified authenticator. - key (str): The key of the unverified authenticator. - label (str): The label that is used for this unverified authenticator. - url (str): The full URL of the authenticator. - """ - - issuer: str - key: str - label: str - url: str - - def to_dict(self) -> dict[str, Any]: - issuer = self.issuer - - key = self.key - - label = self.label - - url = self.url - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "issuer": issuer, - "key": key, - "label": label, - "url": url, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - issuer = d.pop("issuer") - - key = d.pop("key") - - label = d.pop("label") - - url = d.pop("url") - - unverified_authenticator = cls( - issuer=issuer, - key=key, - label=label, - url=url, - ) - - return unverified_authenticator diff --git a/src/tower/tower_api_client/models/update_account_params.py b/src/tower/tower_api_client/models/update_account_params.py deleted file mode 100644 index d59cdf63..00000000 --- a/src/tower/tower_api_client/models/update_account_params.py +++ /dev/null @@ -1,81 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..models.update_account_params_execution_region import ( - UpdateAccountParamsExecutionRegion, -) -from ..types import UNSET, Unset - -T = TypeVar("T", bound="UpdateAccountParams") - - -@_attrs_define -class UpdateAccountParams: - """ - Attributes: - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdateAccountParams.json. - execution_region (UpdateAccountParamsExecutionRegion | Unset): The execution region for runs (eu-central-1 or - us-east-1) - is_self_hosted_only (bool | Unset): Whether the account is for self-hosted use only - name (str | Unset): The new name for the account, if any - """ - - schema: str | Unset = UNSET - execution_region: UpdateAccountParamsExecutionRegion | Unset = UNSET - is_self_hosted_only: bool | Unset = UNSET - name: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - schema = self.schema - - execution_region: str | Unset = UNSET - if not isinstance(self.execution_region, Unset): - execution_region = self.execution_region.value - - is_self_hosted_only = self.is_self_hosted_only - - name = self.name - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if schema is not UNSET: - field_dict["$schema"] = schema - if execution_region is not UNSET: - field_dict["execution_region"] = execution_region - if is_self_hosted_only is not UNSET: - field_dict["is_self_hosted_only"] = is_self_hosted_only - if name is not UNSET: - field_dict["name"] = name - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - schema = d.pop("$schema", UNSET) - - _execution_region = d.pop("execution_region", UNSET) - execution_region: UpdateAccountParamsExecutionRegion | Unset - if isinstance(_execution_region, Unset): - execution_region = UNSET - else: - execution_region = UpdateAccountParamsExecutionRegion(_execution_region) - - is_self_hosted_only = d.pop("is_self_hosted_only", UNSET) - - name = d.pop("name", UNSET) - - update_account_params = cls( - schema=schema, - execution_region=execution_region, - is_self_hosted_only=is_self_hosted_only, - name=name, - ) - - return update_account_params diff --git a/src/tower/tower_api_client/models/update_account_params_execution_region.py b/src/tower/tower_api_client/models/update_account_params_execution_region.py deleted file mode 100644 index 0e5e7047..00000000 --- a/src/tower/tower_api_client/models/update_account_params_execution_region.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class UpdateAccountParamsExecutionRegion(str, Enum): - EU_CENTRAL_1 = "eu-central-1" - US_EAST_1 = "us-east-1" - - def __str__(self) -> str: - return str(self.value) diff --git a/src/tower/tower_api_client/models/update_account_response.py b/src/tower/tower_api_client/models/update_account_response.py deleted file mode 100644 index df301652..00000000 --- a/src/tower/tower_api_client/models/update_account_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.account import Account - - -T = TypeVar("T", bound="UpdateAccountResponse") - - -@_attrs_define -class UpdateAccountResponse: - """ - Attributes: - account (Account): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdateAccountResponse.json. - """ - - account: Account - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - account = self.account.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "account": account, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.account import Account - - d = dict(src_dict) - account = Account.from_dict(d.pop("account")) - - schema = d.pop("$schema", UNSET) - - update_account_response = cls( - account=account, - schema=schema, - ) - - return update_account_response diff --git a/src/tower/tower_api_client/models/update_app_params.py b/src/tower/tower_api_client/models/update_app_params.py deleted file mode 100644 index c970dfd0..00000000 --- a/src/tower/tower_api_client/models/update_app_params.py +++ /dev/null @@ -1,191 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.run_retry_policy import RunRetryPolicy - - -T = TypeVar("T", bound="UpdateAppParams") - - -@_attrs_define -class UpdateAppParams: - """ - Attributes: - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdateAppParams.json. - description (None | str | Unset): New description for the App - is_externally_accessible (bool | None | Unset): Indicates that web traffic should be routed to this app and that - its runs should get a hostname assigned to it. - pending_timeout (int | None | Unset): The amount of time in seconds that runs of this app can stay in pending - state before being marked as failed. - retry_policy (RunRetryPolicy | Unset): - running_timeout (int | None | Unset): The amount of time in seconds that runs of this app can stay in running - state before being marked as failed. - status (None | str | Unset): New status for the App - subdomain (None | str | Unset): The subdomain this app is accessible under. Requires is_externally_accessible to - be true. - """ - - schema: str | Unset = UNSET - description: None | str | Unset = UNSET - is_externally_accessible: bool | None | Unset = UNSET - pending_timeout: int | None | Unset = UNSET - retry_policy: RunRetryPolicy | Unset = UNSET - running_timeout: int | None | Unset = UNSET - status: None | str | Unset = UNSET - subdomain: None | str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - schema = self.schema - - description: None | str | Unset - if isinstance(self.description, Unset): - description = UNSET - else: - description = self.description - - is_externally_accessible: bool | None | Unset - if isinstance(self.is_externally_accessible, Unset): - is_externally_accessible = UNSET - else: - is_externally_accessible = self.is_externally_accessible - - pending_timeout: int | None | Unset - if isinstance(self.pending_timeout, Unset): - pending_timeout = UNSET - else: - pending_timeout = self.pending_timeout - - retry_policy: dict[str, Any] | Unset = UNSET - if not isinstance(self.retry_policy, Unset): - retry_policy = self.retry_policy.to_dict() - - running_timeout: int | None | Unset - if isinstance(self.running_timeout, Unset): - running_timeout = UNSET - else: - running_timeout = self.running_timeout - - status: None | str | Unset - if isinstance(self.status, Unset): - status = UNSET - else: - status = self.status - - subdomain: None | str | Unset - if isinstance(self.subdomain, Unset): - subdomain = UNSET - else: - subdomain = self.subdomain - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if schema is not UNSET: - field_dict["$schema"] = schema - if description is not UNSET: - field_dict["description"] = description - if is_externally_accessible is not UNSET: - field_dict["is_externally_accessible"] = is_externally_accessible - if pending_timeout is not UNSET: - field_dict["pending_timeout"] = pending_timeout - if retry_policy is not UNSET: - field_dict["retry_policy"] = retry_policy - if running_timeout is not UNSET: - field_dict["running_timeout"] = running_timeout - if status is not UNSET: - field_dict["status"] = status - if subdomain is not UNSET: - field_dict["subdomain"] = subdomain - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.run_retry_policy import RunRetryPolicy - - d = dict(src_dict) - schema = d.pop("$schema", UNSET) - - def _parse_description(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - description = _parse_description(d.pop("description", UNSET)) - - def _parse_is_externally_accessible(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - is_externally_accessible = _parse_is_externally_accessible( - d.pop("is_externally_accessible", UNSET) - ) - - def _parse_pending_timeout(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - pending_timeout = _parse_pending_timeout(d.pop("pending_timeout", UNSET)) - - _retry_policy = d.pop("retry_policy", UNSET) - retry_policy: RunRetryPolicy | Unset - if isinstance(_retry_policy, Unset): - retry_policy = UNSET - else: - retry_policy = RunRetryPolicy.from_dict(_retry_policy) - - def _parse_running_timeout(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - running_timeout = _parse_running_timeout(d.pop("running_timeout", UNSET)) - - def _parse_status(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - status = _parse_status(d.pop("status", UNSET)) - - def _parse_subdomain(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - subdomain = _parse_subdomain(d.pop("subdomain", UNSET)) - - update_app_params = cls( - schema=schema, - description=description, - is_externally_accessible=is_externally_accessible, - pending_timeout=pending_timeout, - retry_policy=retry_policy, - running_timeout=running_timeout, - status=status, - subdomain=subdomain, - ) - - return update_app_params diff --git a/src/tower/tower_api_client/models/update_app_response.py b/src/tower/tower_api_client/models/update_app_response.py deleted file mode 100644 index d5d9817d..00000000 --- a/src/tower/tower_api_client/models/update_app_response.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.app import App - - -T = TypeVar("T", bound="UpdateAppResponse") - - -@_attrs_define -class UpdateAppResponse: - """ - Attributes: - App (App): - app (App): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdateAppResponse.json. - """ - - App: App - app: App - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - from ..models.app import App - - App = self.App.to_dict() - - app = self.app.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "App": App, - "app": app, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.app import App - - d = dict(src_dict) - App = App.from_dict(d.pop("App")) - - app = App.from_dict(d.pop("app")) - - schema = d.pop("$schema", UNSET) - - update_app_response = cls( - App=App, - app=app, - schema=schema, - ) - - return update_app_response diff --git a/src/tower/tower_api_client/models/update_catalog_params.py b/src/tower/tower_api_client/models/update_catalog_params.py deleted file mode 100644 index 673099c9..00000000 --- a/src/tower/tower_api_client/models/update_catalog_params.py +++ /dev/null @@ -1,76 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.encrypted_catalog_property import EncryptedCatalogProperty - - -T = TypeVar("T", bound="UpdateCatalogParams") - - -@_attrs_define -class UpdateCatalogParams: - """ - Attributes: - environment (str): New environment for the catalog - properties (list[EncryptedCatalogProperty]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdateCatalogParams.json. - """ - - environment: str - properties: list[EncryptedCatalogProperty] - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - environment = self.environment - - properties = [] - for properties_item_data in self.properties: - properties_item = properties_item_data.to_dict() - properties.append(properties_item) - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "environment": environment, - "properties": properties, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.encrypted_catalog_property import EncryptedCatalogProperty - - d = dict(src_dict) - environment = d.pop("environment") - - properties = [] - _properties = d.pop("properties") - for properties_item_data in _properties: - properties_item = EncryptedCatalogProperty.from_dict(properties_item_data) - - properties.append(properties_item) - - schema = d.pop("$schema", UNSET) - - update_catalog_params = cls( - environment=environment, - properties=properties, - schema=schema, - ) - - return update_catalog_params diff --git a/src/tower/tower_api_client/models/update_catalog_response.py b/src/tower/tower_api_client/models/update_catalog_response.py deleted file mode 100644 index 6a8cd272..00000000 --- a/src/tower/tower_api_client/models/update_catalog_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.catalog import Catalog - - -T = TypeVar("T", bound="UpdateCatalogResponse") - - -@_attrs_define -class UpdateCatalogResponse: - """ - Attributes: - catalog (Catalog): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdateCatalogResponse.json. - """ - - catalog: Catalog - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - catalog = self.catalog.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "catalog": catalog, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.catalog import Catalog - - d = dict(src_dict) - catalog = Catalog.from_dict(d.pop("catalog")) - - schema = d.pop("$schema", UNSET) - - update_catalog_response = cls( - catalog=catalog, - schema=schema, - ) - - return update_catalog_response diff --git a/src/tower/tower_api_client/models/update_email_preferences_body.py b/src/tower/tower_api_client/models/update_email_preferences_body.py deleted file mode 100644 index 0b810b28..00000000 --- a/src/tower/tower_api_client/models/update_email_preferences_body.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.email_subscriptions import EmailSubscriptions - - -T = TypeVar("T", bound="UpdateEmailPreferencesBody") - - -@_attrs_define -class UpdateEmailPreferencesBody: - """ - Attributes: - subscriptions (EmailSubscriptions): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdateEmailPreferencesBody.json. - """ - - subscriptions: EmailSubscriptions - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - subscriptions = self.subscriptions.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "subscriptions": subscriptions, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.email_subscriptions import EmailSubscriptions - - d = dict(src_dict) - subscriptions = EmailSubscriptions.from_dict(d.pop("subscriptions")) - - schema = d.pop("$schema", UNSET) - - update_email_preferences_body = cls( - subscriptions=subscriptions, - schema=schema, - ) - - return update_email_preferences_body diff --git a/src/tower/tower_api_client/models/update_environment_params.py b/src/tower/tower_api_client/models/update_environment_params.py deleted file mode 100644 index bfab90bd..00000000 --- a/src/tower/tower_api_client/models/update_environment_params.py +++ /dev/null @@ -1,54 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="UpdateEnvironmentParams") - - -@_attrs_define -class UpdateEnvironmentParams: - """ - Attributes: - new_name (str): The desired new name of the environment - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdateEnvironmentParams.json. - """ - - new_name: str - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - new_name = self.new_name - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "new_name": new_name, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - new_name = d.pop("new_name") - - schema = d.pop("$schema", UNSET) - - update_environment_params = cls( - new_name=new_name, - schema=schema, - ) - - return update_environment_params diff --git a/src/tower/tower_api_client/models/update_environment_response.py b/src/tower/tower_api_client/models/update_environment_response.py deleted file mode 100644 index 1fd5d864..00000000 --- a/src/tower/tower_api_client/models/update_environment_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.environment import Environment - - -T = TypeVar("T", bound="UpdateEnvironmentResponse") - - -@_attrs_define -class UpdateEnvironmentResponse: - """ - Attributes: - environment (Environment): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdateEnvironmentResponse.json. - """ - - environment: Environment - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - environment = self.environment.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "environment": environment, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.environment import Environment - - d = dict(src_dict) - environment = Environment.from_dict(d.pop("environment")) - - schema = d.pop("$schema", UNSET) - - update_environment_response = cls( - environment=environment, - schema=schema, - ) - - return update_environment_response diff --git a/src/tower/tower_api_client/models/update_my_team_invitation_params.py b/src/tower/tower_api_client/models/update_my_team_invitation_params.py deleted file mode 100644 index 88efaa64..00000000 --- a/src/tower/tower_api_client/models/update_my_team_invitation_params.py +++ /dev/null @@ -1,62 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="UpdateMyTeamInvitationParams") - - -@_attrs_define -class UpdateMyTeamInvitationParams: - """ - Attributes: - accepted (bool): Whether or not the invitation was accepted. If false, it's considered rejected. - name (str): The name of the team invitation to update - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdateMyTeamInvitationParams.json. - """ - - accepted: bool - name: str - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - accepted = self.accepted - - name = self.name - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "accepted": accepted, - "name": name, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - accepted = d.pop("accepted") - - name = d.pop("name") - - schema = d.pop("$schema", UNSET) - - update_my_team_invitation_params = cls( - accepted=accepted, - name=name, - schema=schema, - ) - - return update_my_team_invitation_params diff --git a/src/tower/tower_api_client/models/update_my_team_invitation_response.py b/src/tower/tower_api_client/models/update_my_team_invitation_response.py deleted file mode 100644 index ec74b580..00000000 --- a/src/tower/tower_api_client/models/update_my_team_invitation_response.py +++ /dev/null @@ -1,43 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="UpdateMyTeamInvitationResponse") - - -@_attrs_define -class UpdateMyTeamInvitationResponse: - """ - Attributes: - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdateMyTeamInvitationResponse.json. - """ - - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - schema = d.pop("$schema", UNSET) - - update_my_team_invitation_response = cls( - schema=schema, - ) - - return update_my_team_invitation_response diff --git a/src/tower/tower_api_client/models/update_organization_params.py b/src/tower/tower_api_client/models/update_organization_params.py deleted file mode 100644 index 877b7b2a..00000000 --- a/src/tower/tower_api_client/models/update_organization_params.py +++ /dev/null @@ -1,53 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="UpdateOrganizationParams") - - -@_attrs_define -class UpdateOrganizationParams: - """ - Attributes: - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdateOrganizationParams.json. - name (str | Unset): The name of the organization to update. This is optional, if you supply null it will not - update the organization name. - """ - - schema: str | Unset = UNSET - name: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - schema = self.schema - - name = self.name - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if schema is not UNSET: - field_dict["$schema"] = schema - if name is not UNSET: - field_dict["name"] = name - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - schema = d.pop("$schema", UNSET) - - name = d.pop("name", UNSET) - - update_organization_params = cls( - schema=schema, - name=name, - ) - - return update_organization_params diff --git a/src/tower/tower_api_client/models/update_organization_response.py b/src/tower/tower_api_client/models/update_organization_response.py deleted file mode 100644 index 06af12a5..00000000 --- a/src/tower/tower_api_client/models/update_organization_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.organization import Organization - - -T = TypeVar("T", bound="UpdateOrganizationResponse") - - -@_attrs_define -class UpdateOrganizationResponse: - """ - Attributes: - organization (Organization): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdateOrganizationResponse.json. - """ - - organization: Organization - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - organization = self.organization.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "organization": organization, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.organization import Organization - - d = dict(src_dict) - organization = Organization.from_dict(d.pop("organization")) - - schema = d.pop("$schema", UNSET) - - update_organization_response = cls( - organization=organization, - schema=schema, - ) - - return update_organization_response diff --git a/src/tower/tower_api_client/models/update_password_reset_params.py b/src/tower/tower_api_client/models/update_password_reset_params.py deleted file mode 100644 index a7dd2720..00000000 --- a/src/tower/tower_api_client/models/update_password_reset_params.py +++ /dev/null @@ -1,54 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="UpdatePasswordResetParams") - - -@_attrs_define -class UpdatePasswordResetParams: - """ - Attributes: - password (str): The new password that you want to set for your account - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdatePasswordResetParams.json. - """ - - password: str - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - password = self.password - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "password": password, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - password = d.pop("password") - - schema = d.pop("$schema", UNSET) - - update_password_reset_params = cls( - password=password, - schema=schema, - ) - - return update_password_reset_params diff --git a/src/tower/tower_api_client/models/update_password_reset_response.py b/src/tower/tower_api_client/models/update_password_reset_response.py deleted file mode 100644 index 3e18fc74..00000000 --- a/src/tower/tower_api_client/models/update_password_reset_response.py +++ /dev/null @@ -1,54 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="UpdatePasswordResetResponse") - - -@_attrs_define -class UpdatePasswordResetResponse: - """ - Attributes: - ok (bool): A boolean indicating the request was successfully processed. - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdatePasswordResetResponse.json. - """ - - ok: bool - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - ok = self.ok - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "ok": ok, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - ok = d.pop("ok") - - schema = d.pop("$schema", UNSET) - - update_password_reset_response = cls( - ok=ok, - schema=schema, - ) - - return update_password_reset_response diff --git a/src/tower/tower_api_client/models/update_plan_params.py b/src/tower/tower_api_client/models/update_plan_params.py deleted file mode 100644 index 61e124aa..00000000 --- a/src/tower/tower_api_client/models/update_plan_params.py +++ /dev/null @@ -1,54 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="UpdatePlanParams") - - -@_attrs_define -class UpdatePlanParams: - """ - Attributes: - base_plan_name (str): The name of the base plan to use. - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdatePlanParams.json. - """ - - base_plan_name: str - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - base_plan_name = self.base_plan_name - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "base_plan_name": base_plan_name, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - base_plan_name = d.pop("base_plan_name") - - schema = d.pop("$schema", UNSET) - - update_plan_params = cls( - base_plan_name=base_plan_name, - schema=schema, - ) - - return update_plan_params diff --git a/src/tower/tower_api_client/models/update_plan_response.py b/src/tower/tower_api_client/models/update_plan_response.py deleted file mode 100644 index 196b5503..00000000 --- a/src/tower/tower_api_client/models/update_plan_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.plan import Plan - - -T = TypeVar("T", bound="UpdatePlanResponse") - - -@_attrs_define -class UpdatePlanResponse: - """ - Attributes: - plan (Plan): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdatePlanResponse.json. - """ - - plan: Plan - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - plan = self.plan.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "plan": plan, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.plan import Plan - - d = dict(src_dict) - plan = Plan.from_dict(d.pop("plan")) - - schema = d.pop("$schema", UNSET) - - update_plan_response = cls( - plan=plan, - schema=schema, - ) - - return update_plan_response diff --git a/src/tower/tower_api_client/models/update_schedule_params.py b/src/tower/tower_api_client/models/update_schedule_params.py deleted file mode 100644 index 23a80a7e..00000000 --- a/src/tower/tower_api_client/models/update_schedule_params.py +++ /dev/null @@ -1,186 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast - -from attrs import define as _attrs_define - -from ..models.update_schedule_params_overlap_policy import ( - UpdateScheduleParamsOverlapPolicy, -) -from ..models.update_schedule_params_status import UpdateScheduleParamsStatus -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.run_parameter import RunParameter - - -T = TypeVar("T", bound="UpdateScheduleParams") - - -@_attrs_define -class UpdateScheduleParams: - """ - Attributes: - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdateScheduleParams.json. - app_version (None | str | Unset): The specific app version to run (if omitted, will use the app's default - version) - cron (str | Unset): The cron expression defining when the app should run - environment (str | Unset): The environment to run the app in Default: 'default'. - name (None | str | Unset): The name for this schedule. Must be unique per team. - overlap_policy (UpdateScheduleParamsOverlapPolicy | Unset): The overlap policy for the schedule - parameters (list[RunParameter] | Unset): Parameters to pass when running the app - status (UpdateScheduleParamsStatus | Unset): The status of the schedule - timezone (None | str | Unset): The IANA timezone identifier that the cron expression should be evaluated in - (e.g., 'America/New_York', 'Europe/London'). - """ - - schema: str | Unset = UNSET - app_version: None | str | Unset = UNSET - cron: str | Unset = UNSET - environment: str | Unset = "default" - name: None | str | Unset = UNSET - overlap_policy: UpdateScheduleParamsOverlapPolicy | Unset = UNSET - parameters: list[RunParameter] | Unset = UNSET - status: UpdateScheduleParamsStatus | Unset = UNSET - timezone: None | str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - schema = self.schema - - app_version: None | str | Unset - if isinstance(self.app_version, Unset): - app_version = UNSET - else: - app_version = self.app_version - - cron = self.cron - - environment = self.environment - - name: None | str | Unset - if isinstance(self.name, Unset): - name = UNSET - else: - name = self.name - - overlap_policy: str | Unset = UNSET - if not isinstance(self.overlap_policy, Unset): - overlap_policy = self.overlap_policy.value - - parameters: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.parameters, Unset): - parameters = [] - for parameters_item_data in self.parameters: - parameters_item = parameters_item_data.to_dict() - parameters.append(parameters_item) - - status: str | Unset = UNSET - if not isinstance(self.status, Unset): - status = self.status.value - - timezone: None | str | Unset - if isinstance(self.timezone, Unset): - timezone = UNSET - else: - timezone = self.timezone - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if schema is not UNSET: - field_dict["$schema"] = schema - if app_version is not UNSET: - field_dict["app_version"] = app_version - if cron is not UNSET: - field_dict["cron"] = cron - if environment is not UNSET: - field_dict["environment"] = environment - if name is not UNSET: - field_dict["name"] = name - if overlap_policy is not UNSET: - field_dict["overlap_policy"] = overlap_policy - if parameters is not UNSET: - field_dict["parameters"] = parameters - if status is not UNSET: - field_dict["status"] = status - if timezone is not UNSET: - field_dict["timezone"] = timezone - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.run_parameter import RunParameter - - d = dict(src_dict) - schema = d.pop("$schema", UNSET) - - def _parse_app_version(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - app_version = _parse_app_version(d.pop("app_version", UNSET)) - - cron = d.pop("cron", UNSET) - - environment = d.pop("environment", UNSET) - - def _parse_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - name = _parse_name(d.pop("name", UNSET)) - - _overlap_policy = d.pop("overlap_policy", UNSET) - overlap_policy: UpdateScheduleParamsOverlapPolicy | Unset - if isinstance(_overlap_policy, Unset): - overlap_policy = UNSET - else: - overlap_policy = UpdateScheduleParamsOverlapPolicy(_overlap_policy) - - _parameters = d.pop("parameters", UNSET) - parameters: list[RunParameter] | Unset = UNSET - if _parameters is not UNSET: - parameters = [] - for parameters_item_data in _parameters: - parameters_item = RunParameter.from_dict(parameters_item_data) - - parameters.append(parameters_item) - - _status = d.pop("status", UNSET) - status: UpdateScheduleParamsStatus | Unset - if isinstance(_status, Unset): - status = UNSET - else: - status = UpdateScheduleParamsStatus(_status) - - def _parse_timezone(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - timezone = _parse_timezone(d.pop("timezone", UNSET)) - - update_schedule_params = cls( - schema=schema, - app_version=app_version, - cron=cron, - environment=environment, - name=name, - overlap_policy=overlap_policy, - parameters=parameters, - status=status, - timezone=timezone, - ) - - return update_schedule_params diff --git a/src/tower/tower_api_client/models/update_schedule_params_overlap_policy.py b/src/tower/tower_api_client/models/update_schedule_params_overlap_policy.py deleted file mode 100644 index ffa1779a..00000000 --- a/src/tower/tower_api_client/models/update_schedule_params_overlap_policy.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class UpdateScheduleParamsOverlapPolicy(str, Enum): - ALLOW = "allow" - SKIP = "skip" - - def __str__(self) -> str: - return str(self.value) diff --git a/src/tower/tower_api_client/models/update_schedule_params_status.py b/src/tower/tower_api_client/models/update_schedule_params_status.py deleted file mode 100644 index 2959b194..00000000 --- a/src/tower/tower_api_client/models/update_schedule_params_status.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class UpdateScheduleParamsStatus(str, Enum): - ACTIVE = "active" - DISABLED = "disabled" - - def __str__(self) -> str: - return str(self.value) diff --git a/src/tower/tower_api_client/models/update_schedule_response.py b/src/tower/tower_api_client/models/update_schedule_response.py deleted file mode 100644 index d1a534b8..00000000 --- a/src/tower/tower_api_client/models/update_schedule_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.schedule import Schedule - - -T = TypeVar("T", bound="UpdateScheduleResponse") - - -@_attrs_define -class UpdateScheduleResponse: - """ - Attributes: - schedule (Schedule): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdateScheduleResponse.json. - """ - - schedule: Schedule - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - schedule = self.schedule.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "schedule": schedule, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.schedule import Schedule - - d = dict(src_dict) - schedule = Schedule.from_dict(d.pop("schedule")) - - schema = d.pop("$schema", UNSET) - - update_schedule_response = cls( - schedule=schedule, - schema=schema, - ) - - return update_schedule_response diff --git a/src/tower/tower_api_client/models/update_secret_params.py b/src/tower/tower_api_client/models/update_secret_params.py deleted file mode 100644 index 072e0f74..00000000 --- a/src/tower/tower_api_client/models/update_secret_params.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="UpdateSecretParams") - - -@_attrs_define -class UpdateSecretParams: - """ - Attributes: - encrypted_value (str): - environment (str): - preview (str): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdateSecretParams.json. - """ - - encrypted_value: str - environment: str - preview: str - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - encrypted_value = self.encrypted_value - - environment = self.environment - - preview = self.preview - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "encrypted_value": encrypted_value, - "environment": environment, - "preview": preview, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - encrypted_value = d.pop("encrypted_value") - - environment = d.pop("environment") - - preview = d.pop("preview") - - schema = d.pop("$schema", UNSET) - - update_secret_params = cls( - encrypted_value=encrypted_value, - environment=environment, - preview=preview, - schema=schema, - ) - - return update_secret_params diff --git a/src/tower/tower_api_client/models/update_secret_response.py b/src/tower/tower_api_client/models/update_secret_response.py deleted file mode 100644 index 6fa42112..00000000 --- a/src/tower/tower_api_client/models/update_secret_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.secret import Secret - - -T = TypeVar("T", bound="UpdateSecretResponse") - - -@_attrs_define -class UpdateSecretResponse: - """ - Attributes: - secret (Secret): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdateSecretResponse.json. - """ - - secret: Secret - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - secret = self.secret.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "secret": secret, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.secret import Secret - - d = dict(src_dict) - secret = Secret.from_dict(d.pop("secret")) - - schema = d.pop("$schema", UNSET) - - update_secret_response = cls( - secret=secret, - schema=schema, - ) - - return update_secret_response diff --git a/src/tower/tower_api_client/models/update_team_member_params.py b/src/tower/tower_api_client/models/update_team_member_params.py deleted file mode 100644 index 626d50f1..00000000 --- a/src/tower/tower_api_client/models/update_team_member_params.py +++ /dev/null @@ -1,71 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..models.update_team_member_params_role import UpdateTeamMemberParamsRole -from ..types import UNSET, Unset - -T = TypeVar("T", bound="UpdateTeamMemberParams") - - -@_attrs_define -class UpdateTeamMemberParams: - """ - Attributes: - email (str): The email address of the team member to update - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdateTeamMemberParams.json. - role (UpdateTeamMemberParamsRole | Unset): The role to update the team member to - """ - - email: str - schema: str | Unset = UNSET - role: UpdateTeamMemberParamsRole | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - email = self.email - - schema = self.schema - - role: str | Unset = UNSET - if not isinstance(self.role, Unset): - role = self.role.value - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "email": email, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - if role is not UNSET: - field_dict["role"] = role - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - email = d.pop("email") - - schema = d.pop("$schema", UNSET) - - _role = d.pop("role", UNSET) - role: UpdateTeamMemberParamsRole | Unset - if isinstance(_role, Unset): - role = UNSET - else: - role = UpdateTeamMemberParamsRole(_role) - - update_team_member_params = cls( - email=email, - schema=schema, - role=role, - ) - - return update_team_member_params diff --git a/src/tower/tower_api_client/models/update_team_member_params_role.py b/src/tower/tower_api_client/models/update_team_member_params_role.py deleted file mode 100644 index f594165e..00000000 --- a/src/tower/tower_api_client/models/update_team_member_params_role.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class UpdateTeamMemberParamsRole(str, Enum): - ADMIN = "admin" - DEVELOPER = "developer" - - def __str__(self) -> str: - return str(self.value) diff --git a/src/tower/tower_api_client/models/update_team_member_response.py b/src/tower/tower_api_client/models/update_team_member_response.py deleted file mode 100644 index f736a542..00000000 --- a/src/tower/tower_api_client/models/update_team_member_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.team_membership import TeamMembership - - -T = TypeVar("T", bound="UpdateTeamMemberResponse") - - -@_attrs_define -class UpdateTeamMemberResponse: - """ - Attributes: - team_member (TeamMembership): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdateTeamMemberResponse.json. - """ - - team_member: TeamMembership - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - team_member = self.team_member.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "team_member": team_member, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.team_membership import TeamMembership - - d = dict(src_dict) - team_member = TeamMembership.from_dict(d.pop("team_member")) - - schema = d.pop("$schema", UNSET) - - update_team_member_response = cls( - team_member=team_member, - schema=schema, - ) - - return update_team_member_response diff --git a/src/tower/tower_api_client/models/update_team_params.py b/src/tower/tower_api_client/models/update_team_params.py deleted file mode 100644 index 83392ef6..00000000 --- a/src/tower/tower_api_client/models/update_team_params.py +++ /dev/null @@ -1,80 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define - -from ..models.update_team_params_execution_region import UpdateTeamParamsExecutionRegion -from ..types import UNSET, Unset - -T = TypeVar("T", bound="UpdateTeamParams") - - -@_attrs_define -class UpdateTeamParams: - """ - Attributes: - name (None | str): The name of the team to update. This is optional, if you supply null it will not update the - team name. - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdateTeamParams.json. - execution_region (UpdateTeamParamsExecutionRegion | Unset): The execution region for runs (eu-central-1 or us- - east-1) - """ - - name: None | str - schema: str | Unset = UNSET - execution_region: UpdateTeamParamsExecutionRegion | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - name: None | str - name = self.name - - schema = self.schema - - execution_region: str | Unset = UNSET - if not isinstance(self.execution_region, Unset): - execution_region = self.execution_region.value - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "name": name, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - if execution_region is not UNSET: - field_dict["execution_region"] = execution_region - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_name(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - name = _parse_name(d.pop("name")) - - schema = d.pop("$schema", UNSET) - - _execution_region = d.pop("execution_region", UNSET) - execution_region: UpdateTeamParamsExecutionRegion | Unset - if isinstance(_execution_region, Unset): - execution_region = UNSET - else: - execution_region = UpdateTeamParamsExecutionRegion(_execution_region) - - update_team_params = cls( - name=name, - schema=schema, - execution_region=execution_region, - ) - - return update_team_params diff --git a/src/tower/tower_api_client/models/update_team_params_execution_region.py b/src/tower/tower_api_client/models/update_team_params_execution_region.py deleted file mode 100644 index 8d3f524d..00000000 --- a/src/tower/tower_api_client/models/update_team_params_execution_region.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class UpdateTeamParamsExecutionRegion(str, Enum): - EU_CENTRAL_1 = "eu-central-1" - US_EAST_1 = "us-east-1" - - def __str__(self) -> str: - return str(self.value) diff --git a/src/tower/tower_api_client/models/update_team_response.py b/src/tower/tower_api_client/models/update_team_response.py deleted file mode 100644 index fe2bc66b..00000000 --- a/src/tower/tower_api_client/models/update_team_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.team import Team - - -T = TypeVar("T", bound="UpdateTeamResponse") - - -@_attrs_define -class UpdateTeamResponse: - """ - Attributes: - team (Team): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdateTeamResponse.json. - """ - - team: Team - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - team = self.team.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "team": team, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.team import Team - - d = dict(src_dict) - team = Team.from_dict(d.pop("team")) - - schema = d.pop("$schema", UNSET) - - update_team_response = cls( - team=team, - schema=schema, - ) - - return update_team_response diff --git a/src/tower/tower_api_client/models/update_user_params.py b/src/tower/tower_api_client/models/update_user_params.py deleted file mode 100644 index 79efdc87..00000000 --- a/src/tower/tower_api_client/models/update_user_params.py +++ /dev/null @@ -1,254 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="UpdateUserParams") - - -@_attrs_define -class UpdateUserParams: - """ - Attributes: - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdateUserParams.json. - company (None | str | Unset): - country (None | str | Unset): - first_name (None | str | Unset): - is_alerts_enabled (bool | None | Unset): - is_subscribed_to_changelog (bool | None | Unset): If true, the user will receive changelog updates via email. - is_subscribed_to_marketing_emails (bool | None | Unset): If true, the user will receive marketing emails from - Tower. - is_subscribed_to_newsletter (bool | None | Unset): If true, the user will receive the Tower newsletter. - last_name (None | str | Unset): - password (None | str | Unset): - promo_code (None | str | Unset): - """ - - schema: str | Unset = UNSET - company: None | str | Unset = UNSET - country: None | str | Unset = UNSET - first_name: None | str | Unset = UNSET - is_alerts_enabled: bool | None | Unset = UNSET - is_subscribed_to_changelog: bool | None | Unset = UNSET - is_subscribed_to_marketing_emails: bool | None | Unset = UNSET - is_subscribed_to_newsletter: bool | None | Unset = UNSET - last_name: None | str | Unset = UNSET - password: None | str | Unset = UNSET - promo_code: None | str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - schema = self.schema - - company: None | str | Unset - if isinstance(self.company, Unset): - company = UNSET - else: - company = self.company - - country: None | str | Unset - if isinstance(self.country, Unset): - country = UNSET - else: - country = self.country - - first_name: None | str | Unset - if isinstance(self.first_name, Unset): - first_name = UNSET - else: - first_name = self.first_name - - is_alerts_enabled: bool | None | Unset - if isinstance(self.is_alerts_enabled, Unset): - is_alerts_enabled = UNSET - else: - is_alerts_enabled = self.is_alerts_enabled - - is_subscribed_to_changelog: bool | None | Unset - if isinstance(self.is_subscribed_to_changelog, Unset): - is_subscribed_to_changelog = UNSET - else: - is_subscribed_to_changelog = self.is_subscribed_to_changelog - - is_subscribed_to_marketing_emails: bool | None | Unset - if isinstance(self.is_subscribed_to_marketing_emails, Unset): - is_subscribed_to_marketing_emails = UNSET - else: - is_subscribed_to_marketing_emails = self.is_subscribed_to_marketing_emails - - is_subscribed_to_newsletter: bool | None | Unset - if isinstance(self.is_subscribed_to_newsletter, Unset): - is_subscribed_to_newsletter = UNSET - else: - is_subscribed_to_newsletter = self.is_subscribed_to_newsletter - - last_name: None | str | Unset - if isinstance(self.last_name, Unset): - last_name = UNSET - else: - last_name = self.last_name - - password: None | str | Unset - if isinstance(self.password, Unset): - password = UNSET - else: - password = self.password - - promo_code: None | str | Unset - if isinstance(self.promo_code, Unset): - promo_code = UNSET - else: - promo_code = self.promo_code - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if schema is not UNSET: - field_dict["$schema"] = schema - if company is not UNSET: - field_dict["company"] = company - if country is not UNSET: - field_dict["country"] = country - if first_name is not UNSET: - field_dict["first_name"] = first_name - if is_alerts_enabled is not UNSET: - field_dict["is_alerts_enabled"] = is_alerts_enabled - if is_subscribed_to_changelog is not UNSET: - field_dict["is_subscribed_to_changelog"] = is_subscribed_to_changelog - if is_subscribed_to_marketing_emails is not UNSET: - field_dict["is_subscribed_to_marketing_emails"] = ( - is_subscribed_to_marketing_emails - ) - if is_subscribed_to_newsletter is not UNSET: - field_dict["is_subscribed_to_newsletter"] = is_subscribed_to_newsletter - if last_name is not UNSET: - field_dict["last_name"] = last_name - if password is not UNSET: - field_dict["password"] = password - if promo_code is not UNSET: - field_dict["promo_code"] = promo_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - schema = d.pop("$schema", UNSET) - - def _parse_company(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - company = _parse_company(d.pop("company", UNSET)) - - def _parse_country(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - country = _parse_country(d.pop("country", UNSET)) - - def _parse_first_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - first_name = _parse_first_name(d.pop("first_name", UNSET)) - - def _parse_is_alerts_enabled(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - is_alerts_enabled = _parse_is_alerts_enabled(d.pop("is_alerts_enabled", UNSET)) - - def _parse_is_subscribed_to_changelog(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - is_subscribed_to_changelog = _parse_is_subscribed_to_changelog( - d.pop("is_subscribed_to_changelog", UNSET) - ) - - def _parse_is_subscribed_to_marketing_emails( - data: object, - ) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - is_subscribed_to_marketing_emails = _parse_is_subscribed_to_marketing_emails( - d.pop("is_subscribed_to_marketing_emails", UNSET) - ) - - def _parse_is_subscribed_to_newsletter(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - is_subscribed_to_newsletter = _parse_is_subscribed_to_newsletter( - d.pop("is_subscribed_to_newsletter", UNSET) - ) - - def _parse_last_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - last_name = _parse_last_name(d.pop("last_name", UNSET)) - - def _parse_password(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - password = _parse_password(d.pop("password", UNSET)) - - def _parse_promo_code(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - promo_code = _parse_promo_code(d.pop("promo_code", UNSET)) - - update_user_params = cls( - schema=schema, - company=company, - country=country, - first_name=first_name, - is_alerts_enabled=is_alerts_enabled, - is_subscribed_to_changelog=is_subscribed_to_changelog, - is_subscribed_to_marketing_emails=is_subscribed_to_marketing_emails, - is_subscribed_to_newsletter=is_subscribed_to_newsletter, - last_name=last_name, - password=password, - promo_code=promo_code, - ) - - return update_user_params diff --git a/src/tower/tower_api_client/models/update_user_response.py b/src/tower/tower_api_client/models/update_user_response.py deleted file mode 100644 index 38069893..00000000 --- a/src/tower/tower_api_client/models/update_user_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.user import User - - -T = TypeVar("T", bound="UpdateUserResponse") - - -@_attrs_define -class UpdateUserResponse: - """ - Attributes: - user (User): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdateUserResponse.json. - """ - - user: User - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - user = self.user.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "user": user, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.user import User - - d = dict(src_dict) - user = User.from_dict(d.pop("user")) - - schema = d.pop("$schema", UNSET) - - update_user_response = cls( - user=user, - schema=schema, - ) - - return update_user_response diff --git a/src/tower/tower_api_client/models/update_webhook_params.py b/src/tower/tower_api_client/models/update_webhook_params.py deleted file mode 100644 index f286e619..00000000 --- a/src/tower/tower_api_client/models/update_webhook_params.py +++ /dev/null @@ -1,54 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="UpdateWebhookParams") - - -@_attrs_define -class UpdateWebhookParams: - """ - Attributes: - name (str): The new name of the webhook. - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdateWebhookParams.json. - """ - - name: str - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - name = self.name - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "name": name, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - name = d.pop("name") - - schema = d.pop("$schema", UNSET) - - update_webhook_params = cls( - name=name, - schema=schema, - ) - - return update_webhook_params diff --git a/src/tower/tower_api_client/models/update_webhook_response.py b/src/tower/tower_api_client/models/update_webhook_response.py deleted file mode 100644 index fe698626..00000000 --- a/src/tower/tower_api_client/models/update_webhook_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.webhook import Webhook - - -T = TypeVar("T", bound="UpdateWebhookResponse") - - -@_attrs_define -class UpdateWebhookResponse: - """ - Attributes: - webhook (Webhook): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/UpdateWebhookResponse.json. - """ - - webhook: Webhook - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - webhook = self.webhook.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "webhook": webhook, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.webhook import Webhook - - d = dict(src_dict) - webhook = Webhook.from_dict(d.pop("webhook")) - - schema = d.pop("$schema", UNSET) - - update_webhook_response = cls( - webhook=webhook, - schema=schema, - ) - - return update_webhook_response diff --git a/src/tower/tower_api_client/models/usage_limit.py b/src/tower/tower_api_client/models/usage_limit.py deleted file mode 100644 index e3503dcf..00000000 --- a/src/tower/tower_api_client/models/usage_limit.py +++ /dev/null @@ -1,51 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -T = TypeVar("T", bound="UsageLimit") - - -@_attrs_define -class UsageLimit: - """ - Attributes: - limit (int): For numeric quotas: the maximum number of units allowed (-1 means unlimited). For boolean - entitlements (e.g. self_hosted_runners): 0 = disabled, 1 = enabled. - used (int): The number of units used for this resource. - """ - - limit: int - used: int - - def to_dict(self) -> dict[str, Any]: - limit = self.limit - - used = self.used - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "limit": limit, - "used": used, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - limit = d.pop("limit") - - used = d.pop("used") - - usage_limit = cls( - limit=limit, - used=used, - ) - - return usage_limit diff --git a/src/tower/tower_api_client/models/user.py b/src/tower/tower_api_client/models/user.py deleted file mode 100644 index 0ef65262..00000000 --- a/src/tower/tower_api_client/models/user.py +++ /dev/null @@ -1,135 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from dateutil.parser import isoparse - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="User") - - -@_attrs_define -class User: - """ - Attributes: - company (str): - country (str): - created_at (datetime.datetime): - email (str): - first_name (str): - is_alerts_enabled (bool): - is_confirmed (bool): - is_subscribed_to_changelog (bool): - last_name (str): - profile_photo_url (str): - promo_code (str): - is_invitation_claimed (bool | Unset): This property is deprecated. It will be removed in a future version. - """ - - company: str - country: str - created_at: datetime.datetime - email: str - first_name: str - is_alerts_enabled: bool - is_confirmed: bool - is_subscribed_to_changelog: bool - last_name: str - profile_photo_url: str - promo_code: str - is_invitation_claimed: bool | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - company = self.company - - country = self.country - - created_at = self.created_at.isoformat() - - email = self.email - - first_name = self.first_name - - is_alerts_enabled = self.is_alerts_enabled - - is_confirmed = self.is_confirmed - - is_subscribed_to_changelog = self.is_subscribed_to_changelog - - last_name = self.last_name - - profile_photo_url = self.profile_photo_url - - promo_code = self.promo_code - - is_invitation_claimed = self.is_invitation_claimed - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "company": company, - "country": country, - "created_at": created_at, - "email": email, - "first_name": first_name, - "is_alerts_enabled": is_alerts_enabled, - "is_confirmed": is_confirmed, - "is_subscribed_to_changelog": is_subscribed_to_changelog, - "last_name": last_name, - "profile_photo_url": profile_photo_url, - "promo_code": promo_code, - } - ) - if is_invitation_claimed is not UNSET: - field_dict["is_invitation_claimed"] = is_invitation_claimed - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - company = d.pop("company") - - country = d.pop("country") - - created_at = isoparse(d.pop("created_at")) - - email = d.pop("email") - - first_name = d.pop("first_name") - - is_alerts_enabled = d.pop("is_alerts_enabled") - - is_confirmed = d.pop("is_confirmed") - - is_subscribed_to_changelog = d.pop("is_subscribed_to_changelog") - - last_name = d.pop("last_name") - - profile_photo_url = d.pop("profile_photo_url") - - promo_code = d.pop("promo_code") - - is_invitation_claimed = d.pop("is_invitation_claimed", UNSET) - - user = cls( - company=company, - country=country, - created_at=created_at, - email=email, - first_name=first_name, - is_alerts_enabled=is_alerts_enabled, - is_confirmed=is_confirmed, - is_subscribed_to_changelog=is_subscribed_to_changelog, - last_name=last_name, - profile_photo_url=profile_photo_url, - promo_code=promo_code, - is_invitation_claimed=is_invitation_claimed, - ) - - return user diff --git a/src/tower/tower_api_client/models/verified_authenticator.py b/src/tower/tower_api_client/models/verified_authenticator.py deleted file mode 100644 index d9ee4201..00000000 --- a/src/tower/tower_api_client/models/verified_authenticator.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from dateutil.parser import isoparse - -T = TypeVar("T", bound="VerifiedAuthenticator") - - -@_attrs_define -class VerifiedAuthenticator: - """ - Attributes: - created_at (datetime.datetime): The ISO8601 timestamp indicating when this authenticator was created - id (str): The ID of this authenticator - issuer (str): The issuer of the unverified authenticator. - label (str): The label that is used for this unverified authenticator. - """ - - created_at: datetime.datetime - id: str - issuer: str - label: str - - def to_dict(self) -> dict[str, Any]: - created_at = self.created_at.isoformat() - - id = self.id - - issuer = self.issuer - - label = self.label - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "created_at": created_at, - "id": id, - "issuer": issuer, - "label": label, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - created_at = isoparse(d.pop("created_at")) - - id = d.pop("id") - - issuer = d.pop("issuer") - - label = d.pop("label") - - verified_authenticator = cls( - created_at=created_at, - id=id, - issuer=issuer, - label=label, - ) - - return verified_authenticator diff --git a/src/tower/tower_api_client/models/verify_email_params.py b/src/tower/tower_api_client/models/verify_email_params.py deleted file mode 100644 index 32e1b394..00000000 --- a/src/tower/tower_api_client/models/verify_email_params.py +++ /dev/null @@ -1,54 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="VerifyEmailParams") - - -@_attrs_define -class VerifyEmailParams: - """ - Attributes: - code (str): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/VerifyEmailParams.json. - """ - - code: str - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - code = self.code - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "code": code, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - code = d.pop("code") - - schema = d.pop("$schema", UNSET) - - verify_email_params = cls( - code=code, - schema=schema, - ) - - return verify_email_params diff --git a/src/tower/tower_api_client/models/verify_email_response.py b/src/tower/tower_api_client/models/verify_email_response.py deleted file mode 100644 index 40f4135d..00000000 --- a/src/tower/tower_api_client/models/verify_email_response.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.user import User - - -T = TypeVar("T", bound="VerifyEmailResponse") - - -@_attrs_define -class VerifyEmailResponse: - """ - Attributes: - user (User): - schema (str | Unset): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/VerifyEmailResponse.json. - """ - - user: User - schema: str | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - user = self.user.to_dict() - - schema = self.schema - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "user": user, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.user import User - - d = dict(src_dict) - user = User.from_dict(d.pop("user")) - - schema = d.pop("$schema", UNSET) - - verify_email_response = cls( - user=user, - schema=schema, - ) - - return verify_email_response diff --git a/src/tower/tower_api_client/models/webhook.py b/src/tower/tower_api_client/models/webhook.py deleted file mode 100644 index 023f8948..00000000 --- a/src/tower/tower_api_client/models/webhook.py +++ /dev/null @@ -1,128 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from dateutil.parser import isoparse - -from ..models.webhook_state import WebhookState -from ..types import UNSET, Unset - -T = TypeVar("T", bound="Webhook") - - -@_attrs_define -class Webhook: - """ - Attributes: - account_id (str): - created_at (datetime.datetime): - created_by_id (str): - last_checked_at (datetime.datetime | None): - name (str): - state (WebhookState): - url (str): - deleted_at (datetime.datetime | Unset): - """ - - account_id: str - created_at: datetime.datetime - created_by_id: str - last_checked_at: datetime.datetime | None - name: str - state: WebhookState - url: str - deleted_at: datetime.datetime | Unset = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - created_at = self.created_at.isoformat() - - created_by_id = self.created_by_id - - last_checked_at: None | str - if isinstance(self.last_checked_at, datetime.datetime): - last_checked_at = self.last_checked_at.isoformat() - else: - last_checked_at = self.last_checked_at - - name = self.name - - state = self.state.value - - url = self.url - - deleted_at: str | Unset = UNSET - if not isinstance(self.deleted_at, Unset): - deleted_at = self.deleted_at.isoformat() - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "account_id": account_id, - "created_at": created_at, - "created_by_id": created_by_id, - "last_checked_at": last_checked_at, - "name": name, - "state": state, - "url": url, - } - ) - if deleted_at is not UNSET: - field_dict["deleted_at"] = deleted_at - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = d.pop("account_id") - - created_at = isoparse(d.pop("created_at")) - - created_by_id = d.pop("created_by_id") - - def _parse_last_checked_at(data: object) -> datetime.datetime | None: - if data is None: - return data - try: - if not isinstance(data, str): - raise TypeError() - last_checked_at_type_0 = isoparse(data) - - return last_checked_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(datetime.datetime | None, data) - - last_checked_at = _parse_last_checked_at(d.pop("last_checked_at")) - - name = d.pop("name") - - state = WebhookState(d.pop("state")) - - url = d.pop("url") - - _deleted_at = d.pop("deleted_at", UNSET) - deleted_at: datetime.datetime | Unset - if isinstance(_deleted_at, Unset): - deleted_at = UNSET - else: - deleted_at = isoparse(_deleted_at) - - webhook = cls( - account_id=account_id, - created_at=created_at, - created_by_id=created_by_id, - last_checked_at=last_checked_at, - name=name, - state=state, - url=url, - deleted_at=deleted_at, - ) - - return webhook diff --git a/src/tower/tower_api_client/models/webhook_state.py b/src/tower/tower_api_client/models/webhook_state.py deleted file mode 100644 index b302e807..00000000 --- a/src/tower/tower_api_client/models/webhook_state.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class WebhookState(str, Enum): - HEALTHY = "healthy" - UNHEALTHY = "unhealthy" - UNKNOWN = "unknown" - - def __str__(self) -> str: - return str(self.value) diff --git a/src/tower/tower_api_client/types.py b/src/tower/tower_api_client/types.py deleted file mode 100644 index b64af095..00000000 --- a/src/tower/tower_api_client/types.py +++ /dev/null @@ -1,54 +0,0 @@ -"""Contains some shared types for properties""" - -from collections.abc import Mapping, MutableMapping -from http import HTTPStatus -from typing import IO, BinaryIO, Generic, Literal, TypeVar - -from attrs import define - - -class Unset: - def __bool__(self) -> Literal[False]: - return False - - -UNSET: Unset = Unset() - -# The types that `httpx.Client(files=)` can accept, copied from that library. -FileContent = IO[bytes] | bytes | str -FileTypes = ( - # (filename, file (or bytes), content_type) - tuple[str | None, FileContent, str | None] - # (filename, file (or bytes), content_type, headers) - | tuple[str | None, FileContent, str | None, Mapping[str, str]] -) -RequestFiles = list[tuple[str, FileTypes]] - - -@define -class File: - """Contains information for file uploads""" - - payload: BinaryIO - file_name: str | None = None - mime_type: str | None = None - - def to_tuple(self) -> FileTypes: - """Return a tuple representation that httpx will accept for multipart/form-data""" - return self.file_name, self.payload, self.mime_type - - -T = TypeVar("T") - - -@define -class Response(Generic[T]): - """A response from an endpoint""" - - status_code: HTTPStatus - content: bytes - headers: MutableMapping[str, str] - parsed: T | None - - -__all__ = ["UNSET", "File", "FileTypes", "RequestFiles", "Response", "Unset"] From c99c4e31a7de604721e0d604d20505b1519f9e82 Mon Sep 17 00:00:00 2001 From: Brad Heller Date: Thu, 23 Apr 2026 08:52:09 +0100 Subject: [PATCH 2/9] chore: RunParameter becomes RunParameterInput --- crates/tower-cmd/src/api.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/tower-cmd/src/api.rs b/crates/tower-cmd/src/api.rs index 0297bf11..ab5c6b35 100644 --- a/crates/tower-cmd/src/api.rs +++ b/crates/tower-cmd/src/api.rs @@ -7,7 +7,7 @@ use tokio::sync::mpsc; use tower_api::apis::configuration; use tower_api::apis::Error; use tower_api::apis::ResponseContent; -use tower_api::models::RunParameter; +use tower_api::models::RunParameterInput; use tower_telemetry::debug; /// Helper trait to extract the successful response data from API responses @@ -934,7 +934,7 @@ pub async fn create_schedule( let run_parameters = parameters.map(|params| { params .into_iter() - .map(|(key, value)| RunParameter { + .map(|(key, value)| RunParameterInput { name: key, value, hidden: None, @@ -972,7 +972,7 @@ pub async fn update_schedule( let run_parameters = parameters.map(|params| { params .into_iter() - .map(|(key, value)| RunParameter { + .map(|(key, value)| RunParameterInput { name: key, value, hidden: None, From d7167ce7c9ee48f9d0a4da964fb8e7e0e911b6bd Mon Sep 17 00:00:00 2001 From: Brad Heller Date: Thu, 23 Apr 2026 09:01:19 +0100 Subject: [PATCH 3/9] chore: Build failure prevented python client generation --- src/tower/tower_api_client/__init__.py | 8 + src/tower/tower_api_client/api/__init__.py | 1 + .../tower_api_client/api/default/__init__.py | 1 + .../api/default/acknowledge_alert.py | 161 ++++++ .../api/default/acknowledge_all_alerts.py | 134 +++++ .../api/default/activate_schedules.py | 167 +++++++ .../api/default/cancel_run.py | 175 +++++++ .../api/default/check_webhook.py | 153 ++++++ .../api/default/claim_device_login_ticket.py | 167 +++++++ .../api/default/create_account.py | 167 +++++++ .../api/default/create_api_key.py | 159 ++++++ .../api/default/create_app.py | 167 +++++++ .../api/default/create_catalog.py | 167 +++++++ .../api/default/create_device_login_ticket.py | 136 +++++ .../api/default/create_environment.py | 167 +++++++ .../api/default/create_guest.py | 171 +++++++ .../api/default/create_sandbox_secrets.py | 167 +++++++ .../api/default/create_schedule.py | 167 +++++++ .../api/default/create_secret.py | 189 +++++++ .../api/default/create_session.py | 167 +++++++ .../api/default/create_team.py | 167 +++++++ .../api/default/create_webhook.py | 159 ++++++ .../api/default/deactivate_schedules.py | 167 +++++++ .../api/default/delete_alert.py | 159 ++++++ .../api/default/delete_api_key.py | 159 ++++++ .../api/default/delete_app.py | 161 ++++++ .../api/default/delete_catalog.py | 182 +++++++ .../api/default/delete_guest.py | 161 ++++++ .../api/default/delete_schedule.py | 167 +++++++ .../api/default/delete_secret.py | 182 +++++++ .../api/default/delete_session.py | 168 +++++++ .../api/default/delete_team.py | 167 +++++++ .../api/default/delete_team_invitation.py | 183 +++++++ .../api/default/delete_webhook.py | 153 ++++++ .../api/default/deploy_app.py | 295 +++++++++++ .../api/default/describe_account.py | 161 ++++++ .../api/default/describe_app.py | 246 +++++++++ .../api/default/describe_app_version.py | 175 +++++++ .../describe_authentication_context.py | 140 ++++++ .../api/default/describe_catalog.py | 182 +++++++ .../default/describe_device_login_session.py | 163 ++++++ .../api/default/describe_email_preferences.py | 134 +++++ .../default/describe_organization_usage.py | 134 +++++ .../api/default/describe_plan.py | 181 +++++++ .../api/default/describe_run.py | 187 +++++++ .../api/default/describe_run_graph.py | 187 +++++++ .../api/default/describe_run_logs.py | 200 ++++++++ .../api/default/describe_secrets_key.py | 166 +++++++ .../api/default/describe_session.py | 134 +++++ .../api/default/describe_team.py | 161 ++++++ .../api/default/describe_webhook.py | 153 ++++++ .../api/default/export_catalogs.py | 167 +++++++ .../api/default/export_secrets.py | 167 +++++++ .../api/default/generate_app_statistics.py | 170 +++++++ ...generate_organization_usage_time_series.py | 138 ++++++ .../api/default/generate_run_statistics.py | 251 ++++++++++ .../default/generate_runner_credentials.py | 140 ++++++ .../api/default/invite_team_member.py | 183 +++++++ .../api/default/leave_team.py | 165 ++++++ .../api/default/list_alerts.py | 271 ++++++++++ .../api/default/list_api_keys.py | 181 +++++++ .../api/default/list_app_environments.py | 161 ++++++ .../api/default/list_app_versions.py | 161 ++++++ .../tower_api_client/api/default/list_apps.py | 274 ++++++++++ .../api/default/list_catalogs.py | 215 ++++++++ .../api/default/list_environments.py | 181 +++++++ .../api/default/list_guests.py | 166 +++++++ .../api/default/list_my_team_invitations.py | 134 +++++ .../api/default/list_runners.py | 181 +++++++ .../tower_api_client/api/default/list_runs.py | 292 +++++++++++ .../api/default/list_schedules.py | 200 ++++++++ .../api/default/list_secret_environments.py | 134 +++++ .../api/default/list_secrets.py | 215 ++++++++ .../api/default/list_team_invitations.py | 161 ++++++ .../api/default/list_team_members.py | 161 ++++++ .../api/default/list_teams.py | 181 +++++++ .../api/default/list_webhooks.py | 173 +++++++ .../api/default/refresh_session.py | 175 +++++++ .../api/default/regenerate_guest_login_url.py | 189 +++++++ .../api/default/remove_team_member.py | 175 +++++++ .../api/default/resend_team_invitation.py | 183 +++++++ .../tower_api_client/api/default/run_app.py | 190 +++++++ .../api/default/search_runs.py | 272 ++++++++++ .../api/default/stream_alerts.py | 160 ++++++ .../api/default/stream_run_logs.py | 201 ++++++++ .../api/default/stream_shouldertaps.py | 184 +++++++ .../api/default/update_account.py | 183 +++++++ .../api/default/update_app.py | 183 +++++++ .../api/default/update_app_environment.py | 197 ++++++++ .../api/default/update_catalog.py | 183 +++++++ .../api/default/update_email_preferences.py | 170 +++++++ .../api/default/update_environment.py | 183 +++++++ .../api/default/update_my_team_invitation.py | 184 +++++++ .../api/default/update_organization.py | 210 ++++++++ .../api/default/update_plan.py | 159 ++++++ .../api/default/update_schedule.py | 183 +++++++ .../api/default/update_secret.py | 183 +++++++ .../api/default/update_team.py | 187 +++++++ .../api/default/update_team_member.py | 175 +++++++ .../api/default/update_user.py | 167 +++++++ .../api/default/update_webhook.py | 187 +++++++ .../api/feature_flags/__init__.py | 1 + .../feature_flags/get_feature_flag_value.py | 165 ++++++ src/tower/tower_api_client/client.py | 282 +++++++++++ src/tower/tower_api_client/errors.py | 16 + src/tower/tower_api_client/models/__init__.py | 469 ++++++++++++++++++ src/tower/tower_api_client/models/account.py | 69 +++ .../models/acknowledge_alert_response.py | 54 ++ .../models/acknowledge_all_alerts_response.py | 62 +++ src/tower/tower_api_client/models/alert.py | 90 ++++ src/tower/tower_api_client/models/api_key.py | 112 +++++ src/tower/tower_api_client/models/app.py | 251 ++++++++++ .../models/app_health_status.py | 9 + .../tower_api_client/models/app_statistics.py | 66 +++ .../tower_api_client/models/app_status.py | 9 + .../tower_api_client/models/app_summary.py | 66 +++ .../tower_api_client/models/app_version.py | 82 +++ .../models/authentication_context.py | 42 ++ .../models/batch_schedule_params.py | 54 ++ .../models/batch_schedule_response.py | 68 +++ .../models/cancel_run_response.py | 60 +++ src/tower/tower_api_client/models/catalog.py | 101 ++++ .../models/catalog_property.py | 61 +++ .../claim_device_login_ticket_params.py | 62 +++ .../claim_device_login_ticket_response.py | 54 ++ .../models/create_account_params.py | 62 +++ .../create_account_params_flags_struct.py | 42 ++ .../models/create_account_response.py | 60 +++ .../models/create_api_key_params.py | 128 +++++ .../models/create_api_key_response.py | 60 +++ .../models/create_app_params.py | 103 ++++ .../models/create_app_response.py | 60 +++ .../models/create_catalog_params.py | 93 ++++ .../models/create_catalog_params_type.py | 13 + .../models/create_catalog_response.py | 60 +++ .../create_device_login_ticket_response.py | 104 ++++ .../models/create_environment_params.py | 54 ++ .../models/create_environment_response.py | 60 +++ .../models/create_guest_params.py | 82 +++ .../models/create_guest_response.py | 78 +++ .../models/create_sandbox_secrets_params.py | 62 +++ .../models/create_sandbox_secrets_response.py | 54 ++ .../models/create_schedule_params.py | 200 ++++++++ .../create_schedule_params_overlap_policy.py | 9 + .../models/create_schedule_params_status.py | 9 + .../models/create_schedule_response.py | 60 +++ .../models/create_secret_params.py | 78 +++ .../models/create_secret_response.py | 60 +++ .../models/create_session_params.py | 72 +++ .../models/create_session_response.py | 60 +++ .../models/create_team_params.py | 54 ++ .../models/create_team_response.py | 60 +++ .../models/create_webhook_params.py | 62 +++ .../models/create_webhook_response.py | 68 +++ .../models/delete_api_key_params.py | 54 ++ .../models/delete_api_key_response.py | 60 +++ .../models/delete_app_response.py | 60 +++ .../models/delete_catalog_response.py | 60 +++ .../models/delete_guest_output_body.py | 43 ++ .../models/delete_schedule_params.py | 54 ++ .../models/delete_schedule_response.py | 68 +++ .../models/delete_secret_response.py | 60 +++ .../models/delete_session_params.py | 52 ++ .../models/delete_session_response.py | 60 +++ .../models/delete_team_invitation_params.py | 54 ++ .../models/delete_team_invitation_response.py | 60 +++ .../models/delete_team_params.py | 54 ++ .../models/delete_team_response.py | 60 +++ .../models/delete_webhook_response.py | 60 +++ .../models/deploy_app_json_body.py | 64 +++ .../models/deploy_app_response.py | 60 +++ .../models/describe_account_body.py | 60 +++ .../models/describe_app_response.py | 78 +++ .../models/describe_app_version_response.py | 60 +++ .../describe_authentication_context_body.py | 62 +++ .../models/describe_catalog_response.py | 60 +++ .../describe_device_login_session_response.py | 60 +++ .../models/describe_email_preferences_body.py | 60 +++ .../models/describe_plan_response.py | 60 +++ .../models/describe_run_graph_response.py | 68 +++ .../models/describe_run_links.py | 99 ++++ .../models/describe_run_logs_response.py | 68 +++ .../models/describe_run_response.py | 70 +++ .../models/describe_secrets_key_response.py | 54 ++ .../models/describe_session_response.py | 60 +++ .../models/describe_team_response.py | 96 ++++ .../models/describe_webhook_response.py | 60 +++ .../models/email_subscriptions.py | 60 +++ .../models/encrypted_catalog_property.py | 58 +++ .../tower_api_client/models/environment.py | 42 ++ .../tower_api_client/models/error_detail.py | 60 +++ .../tower_api_client/models/error_model.py | 119 +++++ .../models/export_catalogs_params.py | 86 ++++ .../models/export_catalogs_response.py | 78 +++ .../models/export_secrets_params.py | 86 ++++ .../models/export_secrets_response.py | 78 +++ .../models/exported_catalog.py | 101 ++++ .../models/exported_catalog_property.py | 69 +++ .../models/exported_secret.py | 68 +++ src/tower/tower_api_client/models/feature.py | 66 +++ .../models/featurebase_identity.py | 50 ++ .../generate_app_statistics_response.py | 60 +++ ...organization_usage_time_series_response.py | 68 +++ .../generate_run_statistics_response.py | 88 ++++ .../generate_run_statistics_status_item.py | 15 + .../generate_runner_credentials_response.py | 60 +++ .../models/get_feature_flag_response_body.py | 81 +++ ...t_feature_flag_response_body_value_type.py | 11 + src/tower/tower_api_client/models/guest.py | 71 +++ .../models/invite_team_member_params.py | 74 +++ .../models/invite_team_member_params_role.py | 9 + .../models/invite_team_member_response.py | 68 +++ .../models/leave_team_response.py | 60 +++ .../models/list_alerts_response.py | 78 +++ .../models/list_api_keys_response.py | 78 +++ .../models/list_app_environments_response.py | 54 ++ .../models/list_app_versions_response.py | 68 +++ .../models/list_apps_filter.py | 12 + .../models/list_apps_response.py | 78 +++ .../tower_api_client/models/list_apps_sort.py | 11 + .../models/list_catalogs_response.py | 78 +++ .../models/list_environments_response.py | 78 +++ .../models/list_guests_response.py | 68 +++ .../list_my_team_invitations_response.py | 68 +++ .../models/list_runners_response.py | 78 +++ .../models/list_runs_response.py | 78 +++ .../models/list_runs_status_item.py | 15 + .../models/list_schedules_response.py | 78 +++ .../list_secret_environments_response.py | 54 ++ .../models/list_secrets_response.py | 78 +++ .../models/list_team_invitations_response.py | 68 +++ .../models/list_team_members_response.py | 68 +++ .../models/list_teams_response.py | 78 +++ .../models/list_webhooks_response.py | 78 +++ .../tower_api_client/models/organization.py | 56 +++ .../models/organization_usage.py | 108 ++++ .../tower_api_client/models/pagination.py | 66 +++ .../tower_api_client/models/parameter.py | 69 +++ src/tower/tower_api_client/models/plan.py | 129 +++++ .../models/refresh_session_params.py | 52 ++ .../models/refresh_session_response.py | 70 +++ .../regenerate_guest_login_url_params.py | 62 +++ .../regenerate_guest_login_url_response.py | 64 +++ .../models/remove_team_member_params.py | 54 ++ .../models/remove_team_member_response.py | 60 +++ .../models/resend_team_invitation_params.py | 63 +++ .../models/resend_team_invitation_response.py | 60 +++ src/tower/tower_api_client/models/run.py | 363 ++++++++++++++ .../models/run_app_initiator_data.py | 44 ++ .../models/run_app_initiator_data_type.py | 10 + .../tower_api_client/models/run_app_params.py | 125 +++++ .../models/run_app_params_parameters.py | 46 ++ .../models/run_app_response.py | 60 +++ .../tower_api_client/models/run_attempt.py | 142 ++++++ .../models/run_failure_alert.py | 66 +++ .../tower_api_client/models/run_graph_node.py | 56 +++ .../models/run_graph_run_id.py | 50 ++ .../tower_api_client/models/run_initiator.py | 89 ++++ .../tower_api_client/models/run_log_line.py | 113 +++++ .../models/run_log_line_channel.py | 9 + .../tower_api_client/models/run_parameter.py | 70 +++ .../models/run_parameter_input.py | 61 +++ .../tower_api_client/models/run_results.py | 98 ++++ .../models/run_retry_policy.py | 58 +++ .../models/run_run_initiator_details.py | 51 ++ .../tower_api_client/models/run_statistics.py | 82 +++ .../tower_api_client/models/run_status.py | 16 + .../models/run_status_group.py | 10 + .../models/run_timeseries_point.py | 116 +++++ src/tower/tower_api_client/models/runner.py | 116 +++++ .../models/runner_credentials.py | 74 +++ src/tower/tower_api_client/models/schedule.py | 167 +++++++ .../models/schedule_app_status.py | 9 + .../models/schedule_overlap_policy.py | 9 + .../models/schedule_run_initiator_details.py | 42 ++ .../models/schedule_status.py | 9 + .../models/search_runs_response.py | 78 +++ .../models/search_runs_status_item.py | 15 + src/tower/tower_api_client/models/secret.py | 68 +++ src/tower/tower_api_client/models/session.py | 88 ++++ .../tower_api_client/models/shoulder_tap.py | 76 +++ .../tower_api_client/models/sse_warning.py | 52 ++ .../models/statistics_settings.py | 78 +++ .../models/statistics_settings_interval.py | 9 + .../models/stream_alerts_event_alert.py | 103 ++++ .../models/stream_alerts_event_error.py | 103 ++++ .../models/stream_run_logs_event_log.py | 103 ++++ .../models/stream_run_logs_event_warning.py | 103 ++++ .../stream_shouldertaps_event_shouldertap.py | 103 ++++ .../stream_shouldertaps_event_warning.py | 103 ++++ src/tower/tower_api_client/models/team.py | 99 ++++ .../models/team_invitation.py | 74 +++ .../models/team_membership.py | 68 +++ .../models/team_membership_role.py | 9 + .../models/test_webhook_response.py | 60 +++ src/tower/tower_api_client/models/token.py | 63 +++ .../models/update_account_params.py | 81 +++ .../update_account_params_execution_region.py | 9 + .../models/update_account_response.py | 60 +++ .../models/update_app_environment_params.py | 54 ++ .../models/update_app_environment_response.py | 62 +++ .../models/update_app_params.py | 191 +++++++ .../models/update_app_response.py | 70 +++ .../models/update_catalog_params.py | 76 +++ .../models/update_catalog_response.py | 60 +++ .../models/update_email_preferences_body.py | 60 +++ .../models/update_environment_params.py | 54 ++ .../models/update_environment_response.py | 60 +++ .../update_my_team_invitation_params.py | 62 +++ .../update_my_team_invitation_response.py | 43 ++ .../models/update_organization_params.py | 53 ++ .../models/update_organization_response.py | 60 +++ .../models/update_plan_params.py | 54 ++ .../models/update_plan_response.py | 60 +++ .../models/update_schedule_params.py | 186 +++++++ .../update_schedule_params_overlap_policy.py | 9 + .../models/update_schedule_params_status.py | 9 + .../models/update_schedule_response.py | 60 +++ .../models/update_secret_params.py | 70 +++ .../models/update_secret_response.py | 60 +++ .../models/update_team_member_params.py | 71 +++ .../models/update_team_member_params_role.py | 9 + .../models/update_team_member_response.py | 60 +++ .../models/update_team_params.py | 80 +++ .../update_team_params_execution_region.py | 9 + .../models/update_team_response.py | 60 +++ .../models/update_user_params.py | 254 ++++++++++ .../models/update_user_response.py | 60 +++ .../models/update_webhook_params.py | 54 ++ .../models/update_webhook_response.py | 60 +++ .../tower_api_client/models/usage_limit.py | 51 ++ .../models/usage_metric_time_series_point.py | 62 +++ .../usage_metric_time_series_point_name.py | 8 + src/tower/tower_api_client/models/user.py | 135 +++++ src/tower/tower_api_client/models/webhook.py | 128 +++++ .../tower_api_client/models/webhook_state.py | 10 + src/tower/tower_api_client/types.py | 54 ++ 337 files changed, 34028 insertions(+) create mode 100644 src/tower/tower_api_client/__init__.py create mode 100644 src/tower/tower_api_client/api/__init__.py create mode 100644 src/tower/tower_api_client/api/default/__init__.py create mode 100644 src/tower/tower_api_client/api/default/acknowledge_alert.py create mode 100644 src/tower/tower_api_client/api/default/acknowledge_all_alerts.py create mode 100644 src/tower/tower_api_client/api/default/activate_schedules.py create mode 100644 src/tower/tower_api_client/api/default/cancel_run.py create mode 100644 src/tower/tower_api_client/api/default/check_webhook.py create mode 100644 src/tower/tower_api_client/api/default/claim_device_login_ticket.py create mode 100644 src/tower/tower_api_client/api/default/create_account.py create mode 100644 src/tower/tower_api_client/api/default/create_api_key.py create mode 100644 src/tower/tower_api_client/api/default/create_app.py create mode 100644 src/tower/tower_api_client/api/default/create_catalog.py create mode 100644 src/tower/tower_api_client/api/default/create_device_login_ticket.py create mode 100644 src/tower/tower_api_client/api/default/create_environment.py create mode 100644 src/tower/tower_api_client/api/default/create_guest.py create mode 100644 src/tower/tower_api_client/api/default/create_sandbox_secrets.py create mode 100644 src/tower/tower_api_client/api/default/create_schedule.py create mode 100644 src/tower/tower_api_client/api/default/create_secret.py create mode 100644 src/tower/tower_api_client/api/default/create_session.py create mode 100644 src/tower/tower_api_client/api/default/create_team.py create mode 100644 src/tower/tower_api_client/api/default/create_webhook.py create mode 100644 src/tower/tower_api_client/api/default/deactivate_schedules.py create mode 100644 src/tower/tower_api_client/api/default/delete_alert.py create mode 100644 src/tower/tower_api_client/api/default/delete_api_key.py create mode 100644 src/tower/tower_api_client/api/default/delete_app.py create mode 100644 src/tower/tower_api_client/api/default/delete_catalog.py create mode 100644 src/tower/tower_api_client/api/default/delete_guest.py create mode 100644 src/tower/tower_api_client/api/default/delete_schedule.py create mode 100644 src/tower/tower_api_client/api/default/delete_secret.py create mode 100644 src/tower/tower_api_client/api/default/delete_session.py create mode 100644 src/tower/tower_api_client/api/default/delete_team.py create mode 100644 src/tower/tower_api_client/api/default/delete_team_invitation.py create mode 100644 src/tower/tower_api_client/api/default/delete_webhook.py create mode 100644 src/tower/tower_api_client/api/default/deploy_app.py create mode 100644 src/tower/tower_api_client/api/default/describe_account.py create mode 100644 src/tower/tower_api_client/api/default/describe_app.py create mode 100644 src/tower/tower_api_client/api/default/describe_app_version.py create mode 100644 src/tower/tower_api_client/api/default/describe_authentication_context.py create mode 100644 src/tower/tower_api_client/api/default/describe_catalog.py create mode 100644 src/tower/tower_api_client/api/default/describe_device_login_session.py create mode 100644 src/tower/tower_api_client/api/default/describe_email_preferences.py create mode 100644 src/tower/tower_api_client/api/default/describe_organization_usage.py create mode 100644 src/tower/tower_api_client/api/default/describe_plan.py create mode 100644 src/tower/tower_api_client/api/default/describe_run.py create mode 100644 src/tower/tower_api_client/api/default/describe_run_graph.py create mode 100644 src/tower/tower_api_client/api/default/describe_run_logs.py create mode 100644 src/tower/tower_api_client/api/default/describe_secrets_key.py create mode 100644 src/tower/tower_api_client/api/default/describe_session.py create mode 100644 src/tower/tower_api_client/api/default/describe_team.py create mode 100644 src/tower/tower_api_client/api/default/describe_webhook.py create mode 100644 src/tower/tower_api_client/api/default/export_catalogs.py create mode 100644 src/tower/tower_api_client/api/default/export_secrets.py create mode 100644 src/tower/tower_api_client/api/default/generate_app_statistics.py create mode 100644 src/tower/tower_api_client/api/default/generate_organization_usage_time_series.py create mode 100644 src/tower/tower_api_client/api/default/generate_run_statistics.py create mode 100644 src/tower/tower_api_client/api/default/generate_runner_credentials.py create mode 100644 src/tower/tower_api_client/api/default/invite_team_member.py create mode 100644 src/tower/tower_api_client/api/default/leave_team.py create mode 100644 src/tower/tower_api_client/api/default/list_alerts.py create mode 100644 src/tower/tower_api_client/api/default/list_api_keys.py create mode 100644 src/tower/tower_api_client/api/default/list_app_environments.py create mode 100644 src/tower/tower_api_client/api/default/list_app_versions.py create mode 100644 src/tower/tower_api_client/api/default/list_apps.py create mode 100644 src/tower/tower_api_client/api/default/list_catalogs.py create mode 100644 src/tower/tower_api_client/api/default/list_environments.py create mode 100644 src/tower/tower_api_client/api/default/list_guests.py create mode 100644 src/tower/tower_api_client/api/default/list_my_team_invitations.py create mode 100644 src/tower/tower_api_client/api/default/list_runners.py create mode 100644 src/tower/tower_api_client/api/default/list_runs.py create mode 100644 src/tower/tower_api_client/api/default/list_schedules.py create mode 100644 src/tower/tower_api_client/api/default/list_secret_environments.py create mode 100644 src/tower/tower_api_client/api/default/list_secrets.py create mode 100644 src/tower/tower_api_client/api/default/list_team_invitations.py create mode 100644 src/tower/tower_api_client/api/default/list_team_members.py create mode 100644 src/tower/tower_api_client/api/default/list_teams.py create mode 100644 src/tower/tower_api_client/api/default/list_webhooks.py create mode 100644 src/tower/tower_api_client/api/default/refresh_session.py create mode 100644 src/tower/tower_api_client/api/default/regenerate_guest_login_url.py create mode 100644 src/tower/tower_api_client/api/default/remove_team_member.py create mode 100644 src/tower/tower_api_client/api/default/resend_team_invitation.py create mode 100644 src/tower/tower_api_client/api/default/run_app.py create mode 100644 src/tower/tower_api_client/api/default/search_runs.py create mode 100644 src/tower/tower_api_client/api/default/stream_alerts.py create mode 100644 src/tower/tower_api_client/api/default/stream_run_logs.py create mode 100644 src/tower/tower_api_client/api/default/stream_shouldertaps.py create mode 100644 src/tower/tower_api_client/api/default/update_account.py create mode 100644 src/tower/tower_api_client/api/default/update_app.py create mode 100644 src/tower/tower_api_client/api/default/update_app_environment.py create mode 100644 src/tower/tower_api_client/api/default/update_catalog.py create mode 100644 src/tower/tower_api_client/api/default/update_email_preferences.py create mode 100644 src/tower/tower_api_client/api/default/update_environment.py create mode 100644 src/tower/tower_api_client/api/default/update_my_team_invitation.py create mode 100644 src/tower/tower_api_client/api/default/update_organization.py create mode 100644 src/tower/tower_api_client/api/default/update_plan.py create mode 100644 src/tower/tower_api_client/api/default/update_schedule.py create mode 100644 src/tower/tower_api_client/api/default/update_secret.py create mode 100644 src/tower/tower_api_client/api/default/update_team.py create mode 100644 src/tower/tower_api_client/api/default/update_team_member.py create mode 100644 src/tower/tower_api_client/api/default/update_user.py create mode 100644 src/tower/tower_api_client/api/default/update_webhook.py create mode 100644 src/tower/tower_api_client/api/feature_flags/__init__.py create mode 100644 src/tower/tower_api_client/api/feature_flags/get_feature_flag_value.py create mode 100644 src/tower/tower_api_client/client.py create mode 100644 src/tower/tower_api_client/errors.py create mode 100644 src/tower/tower_api_client/models/__init__.py create mode 100644 src/tower/tower_api_client/models/account.py create mode 100644 src/tower/tower_api_client/models/acknowledge_alert_response.py create mode 100644 src/tower/tower_api_client/models/acknowledge_all_alerts_response.py create mode 100644 src/tower/tower_api_client/models/alert.py create mode 100644 src/tower/tower_api_client/models/api_key.py create mode 100644 src/tower/tower_api_client/models/app.py create mode 100644 src/tower/tower_api_client/models/app_health_status.py create mode 100644 src/tower/tower_api_client/models/app_statistics.py create mode 100644 src/tower/tower_api_client/models/app_status.py create mode 100644 src/tower/tower_api_client/models/app_summary.py create mode 100644 src/tower/tower_api_client/models/app_version.py create mode 100644 src/tower/tower_api_client/models/authentication_context.py create mode 100644 src/tower/tower_api_client/models/batch_schedule_params.py create mode 100644 src/tower/tower_api_client/models/batch_schedule_response.py create mode 100644 src/tower/tower_api_client/models/cancel_run_response.py create mode 100644 src/tower/tower_api_client/models/catalog.py create mode 100644 src/tower/tower_api_client/models/catalog_property.py create mode 100644 src/tower/tower_api_client/models/claim_device_login_ticket_params.py create mode 100644 src/tower/tower_api_client/models/claim_device_login_ticket_response.py create mode 100644 src/tower/tower_api_client/models/create_account_params.py create mode 100644 src/tower/tower_api_client/models/create_account_params_flags_struct.py create mode 100644 src/tower/tower_api_client/models/create_account_response.py create mode 100644 src/tower/tower_api_client/models/create_api_key_params.py create mode 100644 src/tower/tower_api_client/models/create_api_key_response.py create mode 100644 src/tower/tower_api_client/models/create_app_params.py create mode 100644 src/tower/tower_api_client/models/create_app_response.py create mode 100644 src/tower/tower_api_client/models/create_catalog_params.py create mode 100644 src/tower/tower_api_client/models/create_catalog_params_type.py create mode 100644 src/tower/tower_api_client/models/create_catalog_response.py create mode 100644 src/tower/tower_api_client/models/create_device_login_ticket_response.py create mode 100644 src/tower/tower_api_client/models/create_environment_params.py create mode 100644 src/tower/tower_api_client/models/create_environment_response.py create mode 100644 src/tower/tower_api_client/models/create_guest_params.py create mode 100644 src/tower/tower_api_client/models/create_guest_response.py create mode 100644 src/tower/tower_api_client/models/create_sandbox_secrets_params.py create mode 100644 src/tower/tower_api_client/models/create_sandbox_secrets_response.py create mode 100644 src/tower/tower_api_client/models/create_schedule_params.py create mode 100644 src/tower/tower_api_client/models/create_schedule_params_overlap_policy.py create mode 100644 src/tower/tower_api_client/models/create_schedule_params_status.py create mode 100644 src/tower/tower_api_client/models/create_schedule_response.py create mode 100644 src/tower/tower_api_client/models/create_secret_params.py create mode 100644 src/tower/tower_api_client/models/create_secret_response.py create mode 100644 src/tower/tower_api_client/models/create_session_params.py create mode 100644 src/tower/tower_api_client/models/create_session_response.py create mode 100644 src/tower/tower_api_client/models/create_team_params.py create mode 100644 src/tower/tower_api_client/models/create_team_response.py create mode 100644 src/tower/tower_api_client/models/create_webhook_params.py create mode 100644 src/tower/tower_api_client/models/create_webhook_response.py create mode 100644 src/tower/tower_api_client/models/delete_api_key_params.py create mode 100644 src/tower/tower_api_client/models/delete_api_key_response.py create mode 100644 src/tower/tower_api_client/models/delete_app_response.py create mode 100644 src/tower/tower_api_client/models/delete_catalog_response.py create mode 100644 src/tower/tower_api_client/models/delete_guest_output_body.py create mode 100644 src/tower/tower_api_client/models/delete_schedule_params.py create mode 100644 src/tower/tower_api_client/models/delete_schedule_response.py create mode 100644 src/tower/tower_api_client/models/delete_secret_response.py create mode 100644 src/tower/tower_api_client/models/delete_session_params.py create mode 100644 src/tower/tower_api_client/models/delete_session_response.py create mode 100644 src/tower/tower_api_client/models/delete_team_invitation_params.py create mode 100644 src/tower/tower_api_client/models/delete_team_invitation_response.py create mode 100644 src/tower/tower_api_client/models/delete_team_params.py create mode 100644 src/tower/tower_api_client/models/delete_team_response.py create mode 100644 src/tower/tower_api_client/models/delete_webhook_response.py create mode 100644 src/tower/tower_api_client/models/deploy_app_json_body.py create mode 100644 src/tower/tower_api_client/models/deploy_app_response.py create mode 100644 src/tower/tower_api_client/models/describe_account_body.py create mode 100644 src/tower/tower_api_client/models/describe_app_response.py create mode 100644 src/tower/tower_api_client/models/describe_app_version_response.py create mode 100644 src/tower/tower_api_client/models/describe_authentication_context_body.py create mode 100644 src/tower/tower_api_client/models/describe_catalog_response.py create mode 100644 src/tower/tower_api_client/models/describe_device_login_session_response.py create mode 100644 src/tower/tower_api_client/models/describe_email_preferences_body.py create mode 100644 src/tower/tower_api_client/models/describe_plan_response.py create mode 100644 src/tower/tower_api_client/models/describe_run_graph_response.py create mode 100644 src/tower/tower_api_client/models/describe_run_links.py create mode 100644 src/tower/tower_api_client/models/describe_run_logs_response.py create mode 100644 src/tower/tower_api_client/models/describe_run_response.py create mode 100644 src/tower/tower_api_client/models/describe_secrets_key_response.py create mode 100644 src/tower/tower_api_client/models/describe_session_response.py create mode 100644 src/tower/tower_api_client/models/describe_team_response.py create mode 100644 src/tower/tower_api_client/models/describe_webhook_response.py create mode 100644 src/tower/tower_api_client/models/email_subscriptions.py create mode 100644 src/tower/tower_api_client/models/encrypted_catalog_property.py create mode 100644 src/tower/tower_api_client/models/environment.py create mode 100644 src/tower/tower_api_client/models/error_detail.py create mode 100644 src/tower/tower_api_client/models/error_model.py create mode 100644 src/tower/tower_api_client/models/export_catalogs_params.py create mode 100644 src/tower/tower_api_client/models/export_catalogs_response.py create mode 100644 src/tower/tower_api_client/models/export_secrets_params.py create mode 100644 src/tower/tower_api_client/models/export_secrets_response.py create mode 100644 src/tower/tower_api_client/models/exported_catalog.py create mode 100644 src/tower/tower_api_client/models/exported_catalog_property.py create mode 100644 src/tower/tower_api_client/models/exported_secret.py create mode 100644 src/tower/tower_api_client/models/feature.py create mode 100644 src/tower/tower_api_client/models/featurebase_identity.py create mode 100644 src/tower/tower_api_client/models/generate_app_statistics_response.py create mode 100644 src/tower/tower_api_client/models/generate_organization_usage_time_series_response.py create mode 100644 src/tower/tower_api_client/models/generate_run_statistics_response.py create mode 100644 src/tower/tower_api_client/models/generate_run_statistics_status_item.py create mode 100644 src/tower/tower_api_client/models/generate_runner_credentials_response.py create mode 100644 src/tower/tower_api_client/models/get_feature_flag_response_body.py create mode 100644 src/tower/tower_api_client/models/get_feature_flag_response_body_value_type.py create mode 100644 src/tower/tower_api_client/models/guest.py create mode 100644 src/tower/tower_api_client/models/invite_team_member_params.py create mode 100644 src/tower/tower_api_client/models/invite_team_member_params_role.py create mode 100644 src/tower/tower_api_client/models/invite_team_member_response.py create mode 100644 src/tower/tower_api_client/models/leave_team_response.py create mode 100644 src/tower/tower_api_client/models/list_alerts_response.py create mode 100644 src/tower/tower_api_client/models/list_api_keys_response.py create mode 100644 src/tower/tower_api_client/models/list_app_environments_response.py create mode 100644 src/tower/tower_api_client/models/list_app_versions_response.py create mode 100644 src/tower/tower_api_client/models/list_apps_filter.py create mode 100644 src/tower/tower_api_client/models/list_apps_response.py create mode 100644 src/tower/tower_api_client/models/list_apps_sort.py create mode 100644 src/tower/tower_api_client/models/list_catalogs_response.py create mode 100644 src/tower/tower_api_client/models/list_environments_response.py create mode 100644 src/tower/tower_api_client/models/list_guests_response.py create mode 100644 src/tower/tower_api_client/models/list_my_team_invitations_response.py create mode 100644 src/tower/tower_api_client/models/list_runners_response.py create mode 100644 src/tower/tower_api_client/models/list_runs_response.py create mode 100644 src/tower/tower_api_client/models/list_runs_status_item.py create mode 100644 src/tower/tower_api_client/models/list_schedules_response.py create mode 100644 src/tower/tower_api_client/models/list_secret_environments_response.py create mode 100644 src/tower/tower_api_client/models/list_secrets_response.py create mode 100644 src/tower/tower_api_client/models/list_team_invitations_response.py create mode 100644 src/tower/tower_api_client/models/list_team_members_response.py create mode 100644 src/tower/tower_api_client/models/list_teams_response.py create mode 100644 src/tower/tower_api_client/models/list_webhooks_response.py create mode 100644 src/tower/tower_api_client/models/organization.py create mode 100644 src/tower/tower_api_client/models/organization_usage.py create mode 100644 src/tower/tower_api_client/models/pagination.py create mode 100644 src/tower/tower_api_client/models/parameter.py create mode 100644 src/tower/tower_api_client/models/plan.py create mode 100644 src/tower/tower_api_client/models/refresh_session_params.py create mode 100644 src/tower/tower_api_client/models/refresh_session_response.py create mode 100644 src/tower/tower_api_client/models/regenerate_guest_login_url_params.py create mode 100644 src/tower/tower_api_client/models/regenerate_guest_login_url_response.py create mode 100644 src/tower/tower_api_client/models/remove_team_member_params.py create mode 100644 src/tower/tower_api_client/models/remove_team_member_response.py create mode 100644 src/tower/tower_api_client/models/resend_team_invitation_params.py create mode 100644 src/tower/tower_api_client/models/resend_team_invitation_response.py create mode 100644 src/tower/tower_api_client/models/run.py create mode 100644 src/tower/tower_api_client/models/run_app_initiator_data.py create mode 100644 src/tower/tower_api_client/models/run_app_initiator_data_type.py create mode 100644 src/tower/tower_api_client/models/run_app_params.py create mode 100644 src/tower/tower_api_client/models/run_app_params_parameters.py create mode 100644 src/tower/tower_api_client/models/run_app_response.py create mode 100644 src/tower/tower_api_client/models/run_attempt.py create mode 100644 src/tower/tower_api_client/models/run_failure_alert.py create mode 100644 src/tower/tower_api_client/models/run_graph_node.py create mode 100644 src/tower/tower_api_client/models/run_graph_run_id.py create mode 100644 src/tower/tower_api_client/models/run_initiator.py create mode 100644 src/tower/tower_api_client/models/run_log_line.py create mode 100644 src/tower/tower_api_client/models/run_log_line_channel.py create mode 100644 src/tower/tower_api_client/models/run_parameter.py create mode 100644 src/tower/tower_api_client/models/run_parameter_input.py create mode 100644 src/tower/tower_api_client/models/run_results.py create mode 100644 src/tower/tower_api_client/models/run_retry_policy.py create mode 100644 src/tower/tower_api_client/models/run_run_initiator_details.py create mode 100644 src/tower/tower_api_client/models/run_statistics.py create mode 100644 src/tower/tower_api_client/models/run_status.py create mode 100644 src/tower/tower_api_client/models/run_status_group.py create mode 100644 src/tower/tower_api_client/models/run_timeseries_point.py create mode 100644 src/tower/tower_api_client/models/runner.py create mode 100644 src/tower/tower_api_client/models/runner_credentials.py create mode 100644 src/tower/tower_api_client/models/schedule.py create mode 100644 src/tower/tower_api_client/models/schedule_app_status.py create mode 100644 src/tower/tower_api_client/models/schedule_overlap_policy.py create mode 100644 src/tower/tower_api_client/models/schedule_run_initiator_details.py create mode 100644 src/tower/tower_api_client/models/schedule_status.py create mode 100644 src/tower/tower_api_client/models/search_runs_response.py create mode 100644 src/tower/tower_api_client/models/search_runs_status_item.py create mode 100644 src/tower/tower_api_client/models/secret.py create mode 100644 src/tower/tower_api_client/models/session.py create mode 100644 src/tower/tower_api_client/models/shoulder_tap.py create mode 100644 src/tower/tower_api_client/models/sse_warning.py create mode 100644 src/tower/tower_api_client/models/statistics_settings.py create mode 100644 src/tower/tower_api_client/models/statistics_settings_interval.py create mode 100644 src/tower/tower_api_client/models/stream_alerts_event_alert.py create mode 100644 src/tower/tower_api_client/models/stream_alerts_event_error.py create mode 100644 src/tower/tower_api_client/models/stream_run_logs_event_log.py create mode 100644 src/tower/tower_api_client/models/stream_run_logs_event_warning.py create mode 100644 src/tower/tower_api_client/models/stream_shouldertaps_event_shouldertap.py create mode 100644 src/tower/tower_api_client/models/stream_shouldertaps_event_warning.py create mode 100644 src/tower/tower_api_client/models/team.py create mode 100644 src/tower/tower_api_client/models/team_invitation.py create mode 100644 src/tower/tower_api_client/models/team_membership.py create mode 100644 src/tower/tower_api_client/models/team_membership_role.py create mode 100644 src/tower/tower_api_client/models/test_webhook_response.py create mode 100644 src/tower/tower_api_client/models/token.py create mode 100644 src/tower/tower_api_client/models/update_account_params.py create mode 100644 src/tower/tower_api_client/models/update_account_params_execution_region.py create mode 100644 src/tower/tower_api_client/models/update_account_response.py create mode 100644 src/tower/tower_api_client/models/update_app_environment_params.py create mode 100644 src/tower/tower_api_client/models/update_app_environment_response.py create mode 100644 src/tower/tower_api_client/models/update_app_params.py create mode 100644 src/tower/tower_api_client/models/update_app_response.py create mode 100644 src/tower/tower_api_client/models/update_catalog_params.py create mode 100644 src/tower/tower_api_client/models/update_catalog_response.py create mode 100644 src/tower/tower_api_client/models/update_email_preferences_body.py create mode 100644 src/tower/tower_api_client/models/update_environment_params.py create mode 100644 src/tower/tower_api_client/models/update_environment_response.py create mode 100644 src/tower/tower_api_client/models/update_my_team_invitation_params.py create mode 100644 src/tower/tower_api_client/models/update_my_team_invitation_response.py create mode 100644 src/tower/tower_api_client/models/update_organization_params.py create mode 100644 src/tower/tower_api_client/models/update_organization_response.py create mode 100644 src/tower/tower_api_client/models/update_plan_params.py create mode 100644 src/tower/tower_api_client/models/update_plan_response.py create mode 100644 src/tower/tower_api_client/models/update_schedule_params.py create mode 100644 src/tower/tower_api_client/models/update_schedule_params_overlap_policy.py create mode 100644 src/tower/tower_api_client/models/update_schedule_params_status.py create mode 100644 src/tower/tower_api_client/models/update_schedule_response.py create mode 100644 src/tower/tower_api_client/models/update_secret_params.py create mode 100644 src/tower/tower_api_client/models/update_secret_response.py create mode 100644 src/tower/tower_api_client/models/update_team_member_params.py create mode 100644 src/tower/tower_api_client/models/update_team_member_params_role.py create mode 100644 src/tower/tower_api_client/models/update_team_member_response.py create mode 100644 src/tower/tower_api_client/models/update_team_params.py create mode 100644 src/tower/tower_api_client/models/update_team_params_execution_region.py create mode 100644 src/tower/tower_api_client/models/update_team_response.py create mode 100644 src/tower/tower_api_client/models/update_user_params.py create mode 100644 src/tower/tower_api_client/models/update_user_response.py create mode 100644 src/tower/tower_api_client/models/update_webhook_params.py create mode 100644 src/tower/tower_api_client/models/update_webhook_response.py create mode 100644 src/tower/tower_api_client/models/usage_limit.py create mode 100644 src/tower/tower_api_client/models/usage_metric_time_series_point.py create mode 100644 src/tower/tower_api_client/models/usage_metric_time_series_point_name.py create mode 100644 src/tower/tower_api_client/models/user.py create mode 100644 src/tower/tower_api_client/models/webhook.py create mode 100644 src/tower/tower_api_client/models/webhook_state.py create mode 100644 src/tower/tower_api_client/types.py diff --git a/src/tower/tower_api_client/__init__.py b/src/tower/tower_api_client/__init__.py new file mode 100644 index 00000000..47e2a4d2 --- /dev/null +++ b/src/tower/tower_api_client/__init__.py @@ -0,0 +1,8 @@ +"""A client library for accessing Tower API""" + +from .client import AuthenticatedClient, Client + +__all__ = ( + "AuthenticatedClient", + "Client", +) diff --git a/src/tower/tower_api_client/api/__init__.py b/src/tower/tower_api_client/api/__init__.py new file mode 100644 index 00000000..81f9fa24 --- /dev/null +++ b/src/tower/tower_api_client/api/__init__.py @@ -0,0 +1 @@ +"""Contains methods for accessing the API""" diff --git a/src/tower/tower_api_client/api/default/__init__.py b/src/tower/tower_api_client/api/default/__init__.py new file mode 100644 index 00000000..2d7c0b23 --- /dev/null +++ b/src/tower/tower_api_client/api/default/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/src/tower/tower_api_client/api/default/acknowledge_alert.py b/src/tower/tower_api_client/api/default/acknowledge_alert.py new file mode 100644 index 00000000..299a4494 --- /dev/null +++ b/src/tower/tower_api_client/api/default/acknowledge_alert.py @@ -0,0 +1,161 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.acknowledge_alert_response import AcknowledgeAlertResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + alert_seq: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/alerts/{alert_seq}/acknowledge".format( + alert_seq=quote(str(alert_seq), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AcknowledgeAlertResponse | ErrorModel: + if response.status_code == 200: + response_200 = AcknowledgeAlertResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AcknowledgeAlertResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + alert_seq: int, + *, + client: AuthenticatedClient, +) -> Response[AcknowledgeAlertResponse | ErrorModel]: + """Acknowledge alert + + Mark an alert as acknowledged + + Args: + alert_seq (int): Seq of the alert to acknowledge + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AcknowledgeAlertResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + alert_seq=alert_seq, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + alert_seq: int, + *, + client: AuthenticatedClient, +) -> AcknowledgeAlertResponse | ErrorModel | None: + """Acknowledge alert + + Mark an alert as acknowledged + + Args: + alert_seq (int): Seq of the alert to acknowledge + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AcknowledgeAlertResponse | ErrorModel + """ + + return sync_detailed( + alert_seq=alert_seq, + client=client, + ).parsed + + +async def asyncio_detailed( + alert_seq: int, + *, + client: AuthenticatedClient, +) -> Response[AcknowledgeAlertResponse | ErrorModel]: + """Acknowledge alert + + Mark an alert as acknowledged + + Args: + alert_seq (int): Seq of the alert to acknowledge + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AcknowledgeAlertResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + alert_seq=alert_seq, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + alert_seq: int, + *, + client: AuthenticatedClient, +) -> AcknowledgeAlertResponse | ErrorModel | None: + """Acknowledge alert + + Mark an alert as acknowledged + + Args: + alert_seq (int): Seq of the alert to acknowledge + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AcknowledgeAlertResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + alert_seq=alert_seq, + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/acknowledge_all_alerts.py b/src/tower/tower_api_client/api/default/acknowledge_all_alerts.py new file mode 100644 index 00000000..e1ea26bf --- /dev/null +++ b/src/tower/tower_api_client/api/default/acknowledge_all_alerts.py @@ -0,0 +1,134 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.acknowledge_all_alerts_response import AcknowledgeAllAlertsResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/alerts/acknowledge-all", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AcknowledgeAllAlertsResponse | ErrorModel: + if response.status_code == 200: + response_200 = AcknowledgeAllAlertsResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AcknowledgeAllAlertsResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[AcknowledgeAllAlertsResponse | ErrorModel]: + """Acknowledge all alerts + + Mark all unacknowledged alerts as acknowledged for the current user in the current account + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AcknowledgeAllAlertsResponse | ErrorModel] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> AcknowledgeAllAlertsResponse | ErrorModel | None: + """Acknowledge all alerts + + Mark all unacknowledged alerts as acknowledged for the current user in the current account + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AcknowledgeAllAlertsResponse | ErrorModel + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[AcknowledgeAllAlertsResponse | ErrorModel]: + """Acknowledge all alerts + + Mark all unacknowledged alerts as acknowledged for the current user in the current account + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AcknowledgeAllAlertsResponse | ErrorModel] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> AcknowledgeAllAlertsResponse | ErrorModel | None: + """Acknowledge all alerts + + Mark all unacknowledged alerts as acknowledged for the current user in the current account + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AcknowledgeAllAlertsResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/activate_schedules.py b/src/tower/tower_api_client/api/default/activate_schedules.py new file mode 100644 index 00000000..d082e662 --- /dev/null +++ b/src/tower/tower_api_client/api/default/activate_schedules.py @@ -0,0 +1,167 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.batch_schedule_params import BatchScheduleParams +from ...models.batch_schedule_response import BatchScheduleResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + *, + body: BatchScheduleParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/schedules/activate", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> BatchScheduleResponse | ErrorModel: + if response.status_code == 200: + response_200 = BatchScheduleResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[BatchScheduleResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: BatchScheduleParams, +) -> Response[BatchScheduleResponse | ErrorModel]: + """Activate multiple schedules + + Activate multiple schedules to enable their execution. + + Args: + body (BatchScheduleParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[BatchScheduleResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: BatchScheduleParams, +) -> BatchScheduleResponse | ErrorModel | None: + """Activate multiple schedules + + Activate multiple schedules to enable their execution. + + Args: + body (BatchScheduleParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + BatchScheduleResponse | ErrorModel + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: BatchScheduleParams, +) -> Response[BatchScheduleResponse | ErrorModel]: + """Activate multiple schedules + + Activate multiple schedules to enable their execution. + + Args: + body (BatchScheduleParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[BatchScheduleResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: BatchScheduleParams, +) -> BatchScheduleResponse | ErrorModel | None: + """Activate multiple schedules + + Activate multiple schedules to enable their execution. + + Args: + body (BatchScheduleParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + BatchScheduleResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/cancel_run.py b/src/tower/tower_api_client/api/default/cancel_run.py new file mode 100644 index 00000000..b36d2245 --- /dev/null +++ b/src/tower/tower_api_client/api/default/cancel_run.py @@ -0,0 +1,175 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.cancel_run_response import CancelRunResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + name: str, + seq: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/apps/{name}/runs/{seq}".format( + name=quote(str(name), safe=""), + seq=quote(str(seq), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CancelRunResponse | ErrorModel: + if response.status_code == 200: + response_200 = CancelRunResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CancelRunResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + seq: int, + *, + client: AuthenticatedClient, +) -> Response[CancelRunResponse | ErrorModel]: + """Cancel run + + Cancel a run + + Args: + name (str): The name of the app to fetch runs for. + seq (int): The number of the run to fetch. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CancelRunResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + seq=seq, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + seq: int, + *, + client: AuthenticatedClient, +) -> CancelRunResponse | ErrorModel | None: + """Cancel run + + Cancel a run + + Args: + name (str): The name of the app to fetch runs for. + seq (int): The number of the run to fetch. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CancelRunResponse | ErrorModel + """ + + return sync_detailed( + name=name, + seq=seq, + client=client, + ).parsed + + +async def asyncio_detailed( + name: str, + seq: int, + *, + client: AuthenticatedClient, +) -> Response[CancelRunResponse | ErrorModel]: + """Cancel run + + Cancel a run + + Args: + name (str): The name of the app to fetch runs for. + seq (int): The number of the run to fetch. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CancelRunResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + seq=seq, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + seq: int, + *, + client: AuthenticatedClient, +) -> CancelRunResponse | ErrorModel | None: + """Cancel run + + Cancel a run + + Args: + name (str): The name of the app to fetch runs for. + seq (int): The number of the run to fetch. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CancelRunResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + name=name, + seq=seq, + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/check_webhook.py b/src/tower/tower_api_client/api/default/check_webhook.py new file mode 100644 index 00000000..147bbb13 --- /dev/null +++ b/src/tower/tower_api_client/api/default/check_webhook.py @@ -0,0 +1,153 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.test_webhook_response import TestWebhookResponse +from ...types import Response + + +def _get_kwargs( + name: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/webhooks/{name}/test".format( + name=quote(str(name), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | TestWebhookResponse: + if response.status_code == 200: + response_200 = TestWebhookResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | TestWebhookResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[ErrorModel | TestWebhookResponse]: + """Check webhook + + Args: + name (str): The name of the webhook. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | TestWebhookResponse] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, +) -> ErrorModel | TestWebhookResponse | None: + """Check webhook + + Args: + name (str): The name of the webhook. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | TestWebhookResponse + """ + + return sync_detailed( + name=name, + client=client, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[ErrorModel | TestWebhookResponse]: + """Check webhook + + Args: + name (str): The name of the webhook. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | TestWebhookResponse] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, +) -> ErrorModel | TestWebhookResponse | None: + """Check webhook + + Args: + name (str): The name of the webhook. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | TestWebhookResponse + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/claim_device_login_ticket.py b/src/tower/tower_api_client/api/default/claim_device_login_ticket.py new file mode 100644 index 00000000..24909112 --- /dev/null +++ b/src/tower/tower_api_client/api/default/claim_device_login_ticket.py @@ -0,0 +1,167 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.claim_device_login_ticket_params import ClaimDeviceLoginTicketParams +from ...models.claim_device_login_ticket_response import ClaimDeviceLoginTicketResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + *, + body: ClaimDeviceLoginTicketParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/login/device/claim", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ClaimDeviceLoginTicketResponse | ErrorModel: + if response.status_code == 200: + response_200 = ClaimDeviceLoginTicketResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ClaimDeviceLoginTicketResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: ClaimDeviceLoginTicketParams, +) -> Response[ClaimDeviceLoginTicketResponse | ErrorModel]: + """Claim a device login ticket + + Claims a device login ticket code for the authenticated user. + + Args: + body (ClaimDeviceLoginTicketParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ClaimDeviceLoginTicketResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: ClaimDeviceLoginTicketParams, +) -> ClaimDeviceLoginTicketResponse | ErrorModel | None: + """Claim a device login ticket + + Claims a device login ticket code for the authenticated user. + + Args: + body (ClaimDeviceLoginTicketParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ClaimDeviceLoginTicketResponse | ErrorModel + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: ClaimDeviceLoginTicketParams, +) -> Response[ClaimDeviceLoginTicketResponse | ErrorModel]: + """Claim a device login ticket + + Claims a device login ticket code for the authenticated user. + + Args: + body (ClaimDeviceLoginTicketParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ClaimDeviceLoginTicketResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: ClaimDeviceLoginTicketParams, +) -> ClaimDeviceLoginTicketResponse | ErrorModel | None: + """Claim a device login ticket + + Claims a device login ticket code for the authenticated user. + + Args: + body (ClaimDeviceLoginTicketParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ClaimDeviceLoginTicketResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/create_account.py b/src/tower/tower_api_client/api/default/create_account.py new file mode 100644 index 00000000..8a9af191 --- /dev/null +++ b/src/tower/tower_api_client/api/default/create_account.py @@ -0,0 +1,167 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.create_account_params import CreateAccountParams +from ...models.create_account_response import CreateAccountResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + *, + body: CreateAccountParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/accounts", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateAccountResponse | ErrorModel: + if response.status_code == 200: + response_200 = CreateAccountResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateAccountResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateAccountParams, +) -> Response[CreateAccountResponse | ErrorModel]: + """Create account + + This is the primary way that users register new accounts with Tower. + + Args: + body (CreateAccountParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateAccountResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CreateAccountParams, +) -> CreateAccountResponse | ErrorModel | None: + """Create account + + This is the primary way that users register new accounts with Tower. + + Args: + body (CreateAccountParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateAccountResponse | ErrorModel + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateAccountParams, +) -> Response[CreateAccountResponse | ErrorModel]: + """Create account + + This is the primary way that users register new accounts with Tower. + + Args: + body (CreateAccountParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateAccountResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CreateAccountParams, +) -> CreateAccountResponse | ErrorModel | None: + """Create account + + This is the primary way that users register new accounts with Tower. + + Args: + body (CreateAccountParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateAccountResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/create_api_key.py b/src/tower/tower_api_client/api/default/create_api_key.py new file mode 100644 index 00000000..aed81bf8 --- /dev/null +++ b/src/tower/tower_api_client/api/default/create_api_key.py @@ -0,0 +1,159 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.create_api_key_params import CreateAPIKeyParams +from ...models.create_api_key_response import CreateAPIKeyResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + *, + body: CreateAPIKeyParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api-keys", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateAPIKeyResponse | ErrorModel: + if response.status_code == 201: + response_201 = CreateAPIKeyResponse.from_dict(response.json()) + + return response_201 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateAPIKeyResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: CreateAPIKeyParams, +) -> Response[CreateAPIKeyResponse | ErrorModel]: + """Create API Key + + Args: + body (CreateAPIKeyParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateAPIKeyResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: CreateAPIKeyParams, +) -> CreateAPIKeyResponse | ErrorModel | None: + """Create API Key + + Args: + body (CreateAPIKeyParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateAPIKeyResponse | ErrorModel + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: CreateAPIKeyParams, +) -> Response[CreateAPIKeyResponse | ErrorModel]: + """Create API Key + + Args: + body (CreateAPIKeyParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateAPIKeyResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: CreateAPIKeyParams, +) -> CreateAPIKeyResponse | ErrorModel | None: + """Create API Key + + Args: + body (CreateAPIKeyParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateAPIKeyResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/create_app.py b/src/tower/tower_api_client/api/default/create_app.py new file mode 100644 index 00000000..8c9dc4ed --- /dev/null +++ b/src/tower/tower_api_client/api/default/create_app.py @@ -0,0 +1,167 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.create_app_params import CreateAppParams +from ...models.create_app_response import CreateAppResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + *, + body: CreateAppParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/apps", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateAppResponse | ErrorModel: + if response.status_code == 201: + response_201 = CreateAppResponse.from_dict(response.json()) + + return response_201 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateAppResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: CreateAppParams, +) -> Response[CreateAppResponse | ErrorModel]: + """Create app + + Create a new app in the current account. + + Args: + body (CreateAppParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateAppResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: CreateAppParams, +) -> CreateAppResponse | ErrorModel | None: + """Create app + + Create a new app in the current account. + + Args: + body (CreateAppParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateAppResponse | ErrorModel + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: CreateAppParams, +) -> Response[CreateAppResponse | ErrorModel]: + """Create app + + Create a new app in the current account. + + Args: + body (CreateAppParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateAppResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: CreateAppParams, +) -> CreateAppResponse | ErrorModel | None: + """Create app + + Create a new app in the current account. + + Args: + body (CreateAppParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateAppResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/create_catalog.py b/src/tower/tower_api_client/api/default/create_catalog.py new file mode 100644 index 00000000..37914243 --- /dev/null +++ b/src/tower/tower_api_client/api/default/create_catalog.py @@ -0,0 +1,167 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.create_catalog_params import CreateCatalogParams +from ...models.create_catalog_response import CreateCatalogResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + *, + body: CreateCatalogParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/catalogs", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateCatalogResponse | ErrorModel: + if response.status_code == 200: + response_200 = CreateCatalogResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateCatalogResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: CreateCatalogParams, +) -> Response[CreateCatalogResponse | ErrorModel]: + """Create catalog + + Create a new catalog object in the currently authenticated account. + + Args: + body (CreateCatalogParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateCatalogResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: CreateCatalogParams, +) -> CreateCatalogResponse | ErrorModel | None: + """Create catalog + + Create a new catalog object in the currently authenticated account. + + Args: + body (CreateCatalogParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateCatalogResponse | ErrorModel + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: CreateCatalogParams, +) -> Response[CreateCatalogResponse | ErrorModel]: + """Create catalog + + Create a new catalog object in the currently authenticated account. + + Args: + body (CreateCatalogParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateCatalogResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: CreateCatalogParams, +) -> CreateCatalogResponse | ErrorModel | None: + """Create catalog + + Create a new catalog object in the currently authenticated account. + + Args: + body (CreateCatalogParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateCatalogResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/create_device_login_ticket.py b/src/tower/tower_api_client/api/default/create_device_login_ticket.py new file mode 100644 index 00000000..bb067340 --- /dev/null +++ b/src/tower/tower_api_client/api/default/create_device_login_ticket.py @@ -0,0 +1,136 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.create_device_login_ticket_response import ( + CreateDeviceLoginTicketResponse, +) +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/login/device", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateDeviceLoginTicketResponse | ErrorModel: + if response.status_code == 200: + response_200 = CreateDeviceLoginTicketResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateDeviceLoginTicketResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[CreateDeviceLoginTicketResponse | ErrorModel]: + """Create device login ticket + + Creates a new device login ticket and returns the codes and urls needed for authentication. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateDeviceLoginTicketResponse | ErrorModel] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> CreateDeviceLoginTicketResponse | ErrorModel | None: + """Create device login ticket + + Creates a new device login ticket and returns the codes and urls needed for authentication. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateDeviceLoginTicketResponse | ErrorModel + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[CreateDeviceLoginTicketResponse | ErrorModel]: + """Create device login ticket + + Creates a new device login ticket and returns the codes and urls needed for authentication. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateDeviceLoginTicketResponse | ErrorModel] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> CreateDeviceLoginTicketResponse | ErrorModel | None: + """Create device login ticket + + Creates a new device login ticket and returns the codes and urls needed for authentication. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateDeviceLoginTicketResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/create_environment.py b/src/tower/tower_api_client/api/default/create_environment.py new file mode 100644 index 00000000..b4328f20 --- /dev/null +++ b/src/tower/tower_api_client/api/default/create_environment.py @@ -0,0 +1,167 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.create_environment_params import CreateEnvironmentParams +from ...models.create_environment_response import CreateEnvironmentResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + *, + body: CreateEnvironmentParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/environments", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateEnvironmentResponse | ErrorModel: + if response.status_code == 201: + response_201 = CreateEnvironmentResponse.from_dict(response.json()) + + return response_201 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateEnvironmentResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: CreateEnvironmentParams, +) -> Response[CreateEnvironmentResponse | ErrorModel]: + """Create environment + + Create a new environment for an app. + + Args: + body (CreateEnvironmentParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateEnvironmentResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: CreateEnvironmentParams, +) -> CreateEnvironmentResponse | ErrorModel | None: + """Create environment + + Create a new environment for an app. + + Args: + body (CreateEnvironmentParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateEnvironmentResponse | ErrorModel + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: CreateEnvironmentParams, +) -> Response[CreateEnvironmentResponse | ErrorModel]: + """Create environment + + Create a new environment for an app. + + Args: + body (CreateEnvironmentParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateEnvironmentResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: CreateEnvironmentParams, +) -> CreateEnvironmentResponse | ErrorModel | None: + """Create environment + + Create a new environment for an app. + + Args: + body (CreateEnvironmentParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateEnvironmentResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/create_guest.py b/src/tower/tower_api_client/api/default/create_guest.py new file mode 100644 index 00000000..31e8fa61 --- /dev/null +++ b/src/tower/tower_api_client/api/default/create_guest.py @@ -0,0 +1,171 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.create_guest_params import CreateGuestParams +from ...models.create_guest_response import CreateGuestResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + *, + body: CreateGuestParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/guests", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateGuestResponse | ErrorModel: + if response.status_code == 200: + response_200 = CreateGuestResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateGuestResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: CreateGuestParams, +) -> Response[CreateGuestResponse | ErrorModel]: + """Create guest + + Creates a new guest with access to a specific externally accessible app and returns a login URL to + share with them. + + Args: + body (CreateGuestParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateGuestResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: CreateGuestParams, +) -> CreateGuestResponse | ErrorModel | None: + """Create guest + + Creates a new guest with access to a specific externally accessible app and returns a login URL to + share with them. + + Args: + body (CreateGuestParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateGuestResponse | ErrorModel + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: CreateGuestParams, +) -> Response[CreateGuestResponse | ErrorModel]: + """Create guest + + Creates a new guest with access to a specific externally accessible app and returns a login URL to + share with them. + + Args: + body (CreateGuestParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateGuestResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: CreateGuestParams, +) -> CreateGuestResponse | ErrorModel | None: + """Create guest + + Creates a new guest with access to a specific externally accessible app and returns a login URL to + share with them. + + Args: + body (CreateGuestParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateGuestResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/create_sandbox_secrets.py b/src/tower/tower_api_client/api/default/create_sandbox_secrets.py new file mode 100644 index 00000000..9bb07efb --- /dev/null +++ b/src/tower/tower_api_client/api/default/create_sandbox_secrets.py @@ -0,0 +1,167 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.create_sandbox_secrets_params import CreateSandboxSecretsParams +from ...models.create_sandbox_secrets_response import CreateSandboxSecretsResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + *, + body: CreateSandboxSecretsParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/sandbox/secrets", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateSandboxSecretsResponse | ErrorModel: + if response.status_code == 200: + response_200 = CreateSandboxSecretsResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateSandboxSecretsResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: CreateSandboxSecretsParams, +) -> Response[CreateSandboxSecretsResponse | ErrorModel]: + """Create Tower-provided sandbox secrets + + Creates secrets with Tower-provided default values for the specified keys in the given environment. + + Args: + body (CreateSandboxSecretsParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateSandboxSecretsResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: CreateSandboxSecretsParams, +) -> CreateSandboxSecretsResponse | ErrorModel | None: + """Create Tower-provided sandbox secrets + + Creates secrets with Tower-provided default values for the specified keys in the given environment. + + Args: + body (CreateSandboxSecretsParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateSandboxSecretsResponse | ErrorModel + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: CreateSandboxSecretsParams, +) -> Response[CreateSandboxSecretsResponse | ErrorModel]: + """Create Tower-provided sandbox secrets + + Creates secrets with Tower-provided default values for the specified keys in the given environment. + + Args: + body (CreateSandboxSecretsParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateSandboxSecretsResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: CreateSandboxSecretsParams, +) -> CreateSandboxSecretsResponse | ErrorModel | None: + """Create Tower-provided sandbox secrets + + Creates secrets with Tower-provided default values for the specified keys in the given environment. + + Args: + body (CreateSandboxSecretsParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateSandboxSecretsResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/create_schedule.py b/src/tower/tower_api_client/api/default/create_schedule.py new file mode 100644 index 00000000..6d78e1ac --- /dev/null +++ b/src/tower/tower_api_client/api/default/create_schedule.py @@ -0,0 +1,167 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.create_schedule_params import CreateScheduleParams +from ...models.create_schedule_response import CreateScheduleResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + *, + body: CreateScheduleParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/schedules", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateScheduleResponse | ErrorModel: + if response.status_code == 201: + response_201 = CreateScheduleResponse.from_dict(response.json()) + + return response_201 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateScheduleResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: CreateScheduleParams, +) -> Response[CreateScheduleResponse | ErrorModel]: + """Create schedule + + Create a new schedule for an app. + + Args: + body (CreateScheduleParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateScheduleResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: CreateScheduleParams, +) -> CreateScheduleResponse | ErrorModel | None: + """Create schedule + + Create a new schedule for an app. + + Args: + body (CreateScheduleParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateScheduleResponse | ErrorModel + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: CreateScheduleParams, +) -> Response[CreateScheduleResponse | ErrorModel]: + """Create schedule + + Create a new schedule for an app. + + Args: + body (CreateScheduleParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateScheduleResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: CreateScheduleParams, +) -> CreateScheduleResponse | ErrorModel | None: + """Create schedule + + Create a new schedule for an app. + + Args: + body (CreateScheduleParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateScheduleResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/create_secret.py b/src/tower/tower_api_client/api/default/create_secret.py new file mode 100644 index 00000000..9b4975ad --- /dev/null +++ b/src/tower/tower_api_client/api/default/create_secret.py @@ -0,0 +1,189 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.create_secret_params import CreateSecretParams +from ...models.create_secret_response import CreateSecretResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + *, + body: CreateSecretParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/secrets", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateSecretResponse | ErrorModel | None: + if response.status_code == 201: + response_201 = CreateSecretResponse.from_dict(response.json()) + + return response_201 + + if response.status_code == 401: + response_401 = ErrorModel.from_dict(response.json()) + + return response_401 + + if response.status_code == 409: + response_409 = ErrorModel.from_dict(response.json()) + + return response_409 + + if response.status_code == 412: + response_412 = ErrorModel.from_dict(response.json()) + + return response_412 + + if response.status_code == 500: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateSecretResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: CreateSecretParams, +) -> Response[CreateSecretResponse | ErrorModel]: + """Create secret + + Creates a new secret and associates it with the current account. + + Args: + body (CreateSecretParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateSecretResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: CreateSecretParams, +) -> CreateSecretResponse | ErrorModel | None: + """Create secret + + Creates a new secret and associates it with the current account. + + Args: + body (CreateSecretParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateSecretResponse | ErrorModel + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: CreateSecretParams, +) -> Response[CreateSecretResponse | ErrorModel]: + """Create secret + + Creates a new secret and associates it with the current account. + + Args: + body (CreateSecretParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateSecretResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: CreateSecretParams, +) -> CreateSecretResponse | ErrorModel | None: + """Create secret + + Creates a new secret and associates it with the current account. + + Args: + body (CreateSecretParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateSecretResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/create_session.py b/src/tower/tower_api_client/api/default/create_session.py new file mode 100644 index 00000000..e7d74a0c --- /dev/null +++ b/src/tower/tower_api_client/api/default/create_session.py @@ -0,0 +1,167 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.create_session_params import CreateSessionParams +from ...models.create_session_response import CreateSessionResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + *, + body: CreateSessionParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/session", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateSessionResponse | ErrorModel: + if response.status_code == 200: + response_200 = CreateSessionResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateSessionResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateSessionParams, +) -> Response[CreateSessionResponse | ErrorModel]: + """Create session + + Create a new session and return it. + + Args: + body (CreateSessionParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateSessionResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CreateSessionParams, +) -> CreateSessionResponse | ErrorModel | None: + """Create session + + Create a new session and return it. + + Args: + body (CreateSessionParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateSessionResponse | ErrorModel + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateSessionParams, +) -> Response[CreateSessionResponse | ErrorModel]: + """Create session + + Create a new session and return it. + + Args: + body (CreateSessionParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateSessionResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CreateSessionParams, +) -> CreateSessionResponse | ErrorModel | None: + """Create session + + Create a new session and return it. + + Args: + body (CreateSessionParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateSessionResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/create_team.py b/src/tower/tower_api_client/api/default/create_team.py new file mode 100644 index 00000000..84ecd3d1 --- /dev/null +++ b/src/tower/tower_api_client/api/default/create_team.py @@ -0,0 +1,167 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.create_team_params import CreateTeamParams +from ...models.create_team_response import CreateTeamResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + *, + body: CreateTeamParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/teams", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateTeamResponse | ErrorModel: + if response.status_code == 200: + response_200 = CreateTeamResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateTeamResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: CreateTeamParams, +) -> Response[CreateTeamResponse | ErrorModel]: + """Create team + + Create a new team + + Args: + body (CreateTeamParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateTeamResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: CreateTeamParams, +) -> CreateTeamResponse | ErrorModel | None: + """Create team + + Create a new team + + Args: + body (CreateTeamParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateTeamResponse | ErrorModel + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: CreateTeamParams, +) -> Response[CreateTeamResponse | ErrorModel]: + """Create team + + Create a new team + + Args: + body (CreateTeamParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateTeamResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: CreateTeamParams, +) -> CreateTeamResponse | ErrorModel | None: + """Create team + + Create a new team + + Args: + body (CreateTeamParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateTeamResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/create_webhook.py b/src/tower/tower_api_client/api/default/create_webhook.py new file mode 100644 index 00000000..d6b875d7 --- /dev/null +++ b/src/tower/tower_api_client/api/default/create_webhook.py @@ -0,0 +1,159 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.create_webhook_params import CreateWebhookParams +from ...models.create_webhook_response import CreateWebhookResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + *, + body: CreateWebhookParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/webhooks", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateWebhookResponse | ErrorModel: + if response.status_code == 201: + response_201 = CreateWebhookResponse.from_dict(response.json()) + + return response_201 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateWebhookResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: CreateWebhookParams, +) -> Response[CreateWebhookResponse | ErrorModel]: + """Create webhook + + Args: + body (CreateWebhookParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateWebhookResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: CreateWebhookParams, +) -> CreateWebhookResponse | ErrorModel | None: + """Create webhook + + Args: + body (CreateWebhookParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateWebhookResponse | ErrorModel + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: CreateWebhookParams, +) -> Response[CreateWebhookResponse | ErrorModel]: + """Create webhook + + Args: + body (CreateWebhookParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateWebhookResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: CreateWebhookParams, +) -> CreateWebhookResponse | ErrorModel | None: + """Create webhook + + Args: + body (CreateWebhookParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateWebhookResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/deactivate_schedules.py b/src/tower/tower_api_client/api/default/deactivate_schedules.py new file mode 100644 index 00000000..bddd15ad --- /dev/null +++ b/src/tower/tower_api_client/api/default/deactivate_schedules.py @@ -0,0 +1,167 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.batch_schedule_params import BatchScheduleParams +from ...models.batch_schedule_response import BatchScheduleResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + *, + body: BatchScheduleParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/schedules/deactivate", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> BatchScheduleResponse | ErrorModel: + if response.status_code == 200: + response_200 = BatchScheduleResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[BatchScheduleResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: BatchScheduleParams, +) -> Response[BatchScheduleResponse | ErrorModel]: + """Deactivate multiple schedules + + Deactivate multiple schedules to disable their execution. + + Args: + body (BatchScheduleParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[BatchScheduleResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: BatchScheduleParams, +) -> BatchScheduleResponse | ErrorModel | None: + """Deactivate multiple schedules + + Deactivate multiple schedules to disable their execution. + + Args: + body (BatchScheduleParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + BatchScheduleResponse | ErrorModel + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: BatchScheduleParams, +) -> Response[BatchScheduleResponse | ErrorModel]: + """Deactivate multiple schedules + + Deactivate multiple schedules to disable their execution. + + Args: + body (BatchScheduleParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[BatchScheduleResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: BatchScheduleParams, +) -> BatchScheduleResponse | ErrorModel | None: + """Deactivate multiple schedules + + Deactivate multiple schedules to disable their execution. + + Args: + body (BatchScheduleParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + BatchScheduleResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/delete_alert.py b/src/tower/tower_api_client/api/default/delete_alert.py new file mode 100644 index 00000000..0bc6152a --- /dev/null +++ b/src/tower/tower_api_client/api/default/delete_alert.py @@ -0,0 +1,159 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + alert_id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/alerts/{alert_id}".format( + alert_id=quote(str(alert_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | ErrorModel: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + alert_id: str, + *, + client: AuthenticatedClient, +) -> Response[Any | ErrorModel]: + """Delete alert + + Permanently delete an alert + + Args: + alert_id (str): ID of the alert to delete + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | ErrorModel] + """ + + kwargs = _get_kwargs( + alert_id=alert_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + alert_id: str, + *, + client: AuthenticatedClient, +) -> Any | ErrorModel | None: + """Delete alert + + Permanently delete an alert + + Args: + alert_id (str): ID of the alert to delete + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | ErrorModel + """ + + return sync_detailed( + alert_id=alert_id, + client=client, + ).parsed + + +async def asyncio_detailed( + alert_id: str, + *, + client: AuthenticatedClient, +) -> Response[Any | ErrorModel]: + """Delete alert + + Permanently delete an alert + + Args: + alert_id (str): ID of the alert to delete + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | ErrorModel] + """ + + kwargs = _get_kwargs( + alert_id=alert_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + alert_id: str, + *, + client: AuthenticatedClient, +) -> Any | ErrorModel | None: + """Delete alert + + Permanently delete an alert + + Args: + alert_id (str): ID of the alert to delete + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | ErrorModel + """ + + return ( + await asyncio_detailed( + alert_id=alert_id, + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/delete_api_key.py b/src/tower/tower_api_client/api/default/delete_api_key.py new file mode 100644 index 00000000..b7670cf7 --- /dev/null +++ b/src/tower/tower_api_client/api/default/delete_api_key.py @@ -0,0 +1,159 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.delete_api_key_params import DeleteAPIKeyParams +from ...models.delete_api_key_response import DeleteAPIKeyResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + *, + body: DeleteAPIKeyParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api-keys", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DeleteAPIKeyResponse | ErrorModel: + if response.status_code == 200: + response_200 = DeleteAPIKeyResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DeleteAPIKeyResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: DeleteAPIKeyParams, +) -> Response[DeleteAPIKeyResponse | ErrorModel]: + """Delete API key + + Args: + body (DeleteAPIKeyParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeleteAPIKeyResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: DeleteAPIKeyParams, +) -> DeleteAPIKeyResponse | ErrorModel | None: + """Delete API key + + Args: + body (DeleteAPIKeyParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeleteAPIKeyResponse | ErrorModel + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: DeleteAPIKeyParams, +) -> Response[DeleteAPIKeyResponse | ErrorModel]: + """Delete API key + + Args: + body (DeleteAPIKeyParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeleteAPIKeyResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: DeleteAPIKeyParams, +) -> DeleteAPIKeyResponse | ErrorModel | None: + """Delete API key + + Args: + body (DeleteAPIKeyParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeleteAPIKeyResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/delete_app.py b/src/tower/tower_api_client/api/default/delete_app.py new file mode 100644 index 00000000..6fcd2184 --- /dev/null +++ b/src/tower/tower_api_client/api/default/delete_app.py @@ -0,0 +1,161 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.delete_app_response import DeleteAppResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + name: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/apps/{name}".format( + name=quote(str(name), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DeleteAppResponse | ErrorModel: + if response.status_code == 200: + response_200 = DeleteAppResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DeleteAppResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[DeleteAppResponse | ErrorModel]: + """Delete app + + Delete one of your apps, the associated code, and all the runs as well. + + Args: + name (str): The name of the app to delete. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeleteAppResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, +) -> DeleteAppResponse | ErrorModel | None: + """Delete app + + Delete one of your apps, the associated code, and all the runs as well. + + Args: + name (str): The name of the app to delete. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeleteAppResponse | ErrorModel + """ + + return sync_detailed( + name=name, + client=client, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[DeleteAppResponse | ErrorModel]: + """Delete app + + Delete one of your apps, the associated code, and all the runs as well. + + Args: + name (str): The name of the app to delete. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeleteAppResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, +) -> DeleteAppResponse | ErrorModel | None: + """Delete app + + Delete one of your apps, the associated code, and all the runs as well. + + Args: + name (str): The name of the app to delete. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeleteAppResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/delete_catalog.py b/src/tower/tower_api_client/api/default/delete_catalog.py new file mode 100644 index 00000000..3a967033 --- /dev/null +++ b/src/tower/tower_api_client/api/default/delete_catalog.py @@ -0,0 +1,182 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.delete_catalog_response import DeleteCatalogResponse +from ...models.error_model import ErrorModel +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + name: str, + *, + environment: str | Unset = "default", +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["environment"] = environment + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/catalogs/{name}".format( + name=quote(str(name), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DeleteCatalogResponse | ErrorModel: + if response.status_code == 204: + response_204 = DeleteCatalogResponse.from_dict(response.json()) + + return response_204 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DeleteCatalogResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, + environment: str | Unset = "default", +) -> Response[DeleteCatalogResponse | ErrorModel]: + """Delete catalog + + Delete a new catalog object in the currently authenticated account. + + Args: + name (str): The name of the catalog to update. + environment (str | Unset): The environment of the catalog to delete. Default: 'default'. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeleteCatalogResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + environment=environment, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, + environment: str | Unset = "default", +) -> DeleteCatalogResponse | ErrorModel | None: + """Delete catalog + + Delete a new catalog object in the currently authenticated account. + + Args: + name (str): The name of the catalog to update. + environment (str | Unset): The environment of the catalog to delete. Default: 'default'. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeleteCatalogResponse | ErrorModel + """ + + return sync_detailed( + name=name, + client=client, + environment=environment, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, + environment: str | Unset = "default", +) -> Response[DeleteCatalogResponse | ErrorModel]: + """Delete catalog + + Delete a new catalog object in the currently authenticated account. + + Args: + name (str): The name of the catalog to update. + environment (str | Unset): The environment of the catalog to delete. Default: 'default'. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeleteCatalogResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + environment=environment, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, + environment: str | Unset = "default", +) -> DeleteCatalogResponse | ErrorModel | None: + """Delete catalog + + Delete a new catalog object in the currently authenticated account. + + Args: + name (str): The name of the catalog to update. + environment (str | Unset): The environment of the catalog to delete. Default: 'default'. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeleteCatalogResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + environment=environment, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/delete_guest.py b/src/tower/tower_api_client/api/default/delete_guest.py new file mode 100644 index 00000000..36ae7014 --- /dev/null +++ b/src/tower/tower_api_client/api/default/delete_guest.py @@ -0,0 +1,161 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.delete_guest_output_body import DeleteGuestOutputBody +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + guest_id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/guests/{guest_id}".format( + guest_id=quote(str(guest_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DeleteGuestOutputBody | ErrorModel: + if response.status_code == 204: + response_204 = DeleteGuestOutputBody.from_dict(response.json()) + + return response_204 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DeleteGuestOutputBody | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + guest_id: str, + *, + client: AuthenticatedClient, +) -> Response[DeleteGuestOutputBody | ErrorModel]: + """Delete guest + + Deletes a guest and revokes their access. Any active sessions will be invalidated. + + Args: + guest_id (str): The ID of the guest to delete. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeleteGuestOutputBody | ErrorModel] + """ + + kwargs = _get_kwargs( + guest_id=guest_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + guest_id: str, + *, + client: AuthenticatedClient, +) -> DeleteGuestOutputBody | ErrorModel | None: + """Delete guest + + Deletes a guest and revokes their access. Any active sessions will be invalidated. + + Args: + guest_id (str): The ID of the guest to delete. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeleteGuestOutputBody | ErrorModel + """ + + return sync_detailed( + guest_id=guest_id, + client=client, + ).parsed + + +async def asyncio_detailed( + guest_id: str, + *, + client: AuthenticatedClient, +) -> Response[DeleteGuestOutputBody | ErrorModel]: + """Delete guest + + Deletes a guest and revokes their access. Any active sessions will be invalidated. + + Args: + guest_id (str): The ID of the guest to delete. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeleteGuestOutputBody | ErrorModel] + """ + + kwargs = _get_kwargs( + guest_id=guest_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + guest_id: str, + *, + client: AuthenticatedClient, +) -> DeleteGuestOutputBody | ErrorModel | None: + """Delete guest + + Deletes a guest and revokes their access. Any active sessions will be invalidated. + + Args: + guest_id (str): The ID of the guest to delete. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeleteGuestOutputBody | ErrorModel + """ + + return ( + await asyncio_detailed( + guest_id=guest_id, + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/delete_schedule.py b/src/tower/tower_api_client/api/default/delete_schedule.py new file mode 100644 index 00000000..a1b0e9d2 --- /dev/null +++ b/src/tower/tower_api_client/api/default/delete_schedule.py @@ -0,0 +1,167 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.delete_schedule_params import DeleteScheduleParams +from ...models.delete_schedule_response import DeleteScheduleResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + *, + body: DeleteScheduleParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/schedules", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DeleteScheduleResponse | ErrorModel: + if response.status_code == 200: + response_200 = DeleteScheduleResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DeleteScheduleResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: DeleteScheduleParams, +) -> Response[DeleteScheduleResponse | ErrorModel]: + """Delete schedule + + Delete an existing schedule for an app. + + Args: + body (DeleteScheduleParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeleteScheduleResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: DeleteScheduleParams, +) -> DeleteScheduleResponse | ErrorModel | None: + """Delete schedule + + Delete an existing schedule for an app. + + Args: + body (DeleteScheduleParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeleteScheduleResponse | ErrorModel + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: DeleteScheduleParams, +) -> Response[DeleteScheduleResponse | ErrorModel]: + """Delete schedule + + Delete an existing schedule for an app. + + Args: + body (DeleteScheduleParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeleteScheduleResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: DeleteScheduleParams, +) -> DeleteScheduleResponse | ErrorModel | None: + """Delete schedule + + Delete an existing schedule for an app. + + Args: + body (DeleteScheduleParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeleteScheduleResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/delete_secret.py b/src/tower/tower_api_client/api/default/delete_secret.py new file mode 100644 index 00000000..3e0228f0 --- /dev/null +++ b/src/tower/tower_api_client/api/default/delete_secret.py @@ -0,0 +1,182 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.delete_secret_response import DeleteSecretResponse +from ...models.error_model import ErrorModel +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + name: str, + *, + environment: str | Unset = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["environment"] = environment + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/secrets/{name}".format( + name=quote(str(name), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DeleteSecretResponse | ErrorModel: + if response.status_code == 200: + response_200 = DeleteSecretResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DeleteSecretResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, + environment: str | Unset = UNSET, +) -> Response[DeleteSecretResponse | ErrorModel]: + """Delete secret + + Delete a secret by name. + + Args: + name (str): The name of the secret to delete. + environment (str | Unset): The environment of the secret to delete. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeleteSecretResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + environment=environment, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, + environment: str | Unset = UNSET, +) -> DeleteSecretResponse | ErrorModel | None: + """Delete secret + + Delete a secret by name. + + Args: + name (str): The name of the secret to delete. + environment (str | Unset): The environment of the secret to delete. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeleteSecretResponse | ErrorModel + """ + + return sync_detailed( + name=name, + client=client, + environment=environment, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, + environment: str | Unset = UNSET, +) -> Response[DeleteSecretResponse | ErrorModel]: + """Delete secret + + Delete a secret by name. + + Args: + name (str): The name of the secret to delete. + environment (str | Unset): The environment of the secret to delete. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeleteSecretResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + environment=environment, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, + environment: str | Unset = UNSET, +) -> DeleteSecretResponse | ErrorModel | None: + """Delete secret + + Delete a secret by name. + + Args: + name (str): The name of the secret to delete. + environment (str | Unset): The environment of the secret to delete. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeleteSecretResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + environment=environment, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/delete_session.py b/src/tower/tower_api_client/api/default/delete_session.py new file mode 100644 index 00000000..388eb413 --- /dev/null +++ b/src/tower/tower_api_client/api/default/delete_session.py @@ -0,0 +1,168 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.delete_session_params import DeleteSessionParams +from ...models.delete_session_response import DeleteSessionResponse +from ...models.error_model import ErrorModel +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + body: DeleteSessionParams | Unset = UNSET, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/session", + } + + if not isinstance(body, Unset): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DeleteSessionResponse | ErrorModel: + if response.status_code == 200: + response_200 = DeleteSessionResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DeleteSessionResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: DeleteSessionParams | Unset = UNSET, +) -> Response[DeleteSessionResponse | ErrorModel]: + """Delete session + + Terminate a session and revoke the access keys associated with it. + + Args: + body (DeleteSessionParams | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeleteSessionResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: DeleteSessionParams | Unset = UNSET, +) -> DeleteSessionResponse | ErrorModel | None: + """Delete session + + Terminate a session and revoke the access keys associated with it. + + Args: + body (DeleteSessionParams | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeleteSessionResponse | ErrorModel + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: DeleteSessionParams | Unset = UNSET, +) -> Response[DeleteSessionResponse | ErrorModel]: + """Delete session + + Terminate a session and revoke the access keys associated with it. + + Args: + body (DeleteSessionParams | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeleteSessionResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: DeleteSessionParams | Unset = UNSET, +) -> DeleteSessionResponse | ErrorModel | None: + """Delete session + + Terminate a session and revoke the access keys associated with it. + + Args: + body (DeleteSessionParams | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeleteSessionResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/delete_team.py b/src/tower/tower_api_client/api/default/delete_team.py new file mode 100644 index 00000000..e3602c40 --- /dev/null +++ b/src/tower/tower_api_client/api/default/delete_team.py @@ -0,0 +1,167 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.delete_team_params import DeleteTeamParams +from ...models.delete_team_response import DeleteTeamResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + *, + body: DeleteTeamParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/teams", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DeleteTeamResponse | ErrorModel: + if response.status_code == 200: + response_200 = DeleteTeamResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DeleteTeamResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: DeleteTeamParams, +) -> Response[DeleteTeamResponse | ErrorModel]: + """Delete team + + Delete a new team + + Args: + body (DeleteTeamParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeleteTeamResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: DeleteTeamParams, +) -> DeleteTeamResponse | ErrorModel | None: + """Delete team + + Delete a new team + + Args: + body (DeleteTeamParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeleteTeamResponse | ErrorModel + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: DeleteTeamParams, +) -> Response[DeleteTeamResponse | ErrorModel]: + """Delete team + + Delete a new team + + Args: + body (DeleteTeamParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeleteTeamResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: DeleteTeamParams, +) -> DeleteTeamResponse | ErrorModel | None: + """Delete team + + Delete a new team + + Args: + body (DeleteTeamParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeleteTeamResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/delete_team_invitation.py b/src/tower/tower_api_client/api/default/delete_team_invitation.py new file mode 100644 index 00000000..82868305 --- /dev/null +++ b/src/tower/tower_api_client/api/default/delete_team_invitation.py @@ -0,0 +1,183 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.delete_team_invitation_params import DeleteTeamInvitationParams +from ...models.delete_team_invitation_response import DeleteTeamInvitationResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + name: str, + *, + body: DeleteTeamInvitationParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/teams/{name}/invites".format( + name=quote(str(name), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DeleteTeamInvitationResponse | ErrorModel: + if response.status_code == 200: + response_200 = DeleteTeamInvitationResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DeleteTeamInvitationResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, + body: DeleteTeamInvitationParams, +) -> Response[DeleteTeamInvitationResponse | ErrorModel]: + """Delete team invitation + + Delete a pending team invitation that you have previously sent + + Args: + name (str): The name of the team to remove someone from + body (DeleteTeamInvitationParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeleteTeamInvitationResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, + body: DeleteTeamInvitationParams, +) -> DeleteTeamInvitationResponse | ErrorModel | None: + """Delete team invitation + + Delete a pending team invitation that you have previously sent + + Args: + name (str): The name of the team to remove someone from + body (DeleteTeamInvitationParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeleteTeamInvitationResponse | ErrorModel + """ + + return sync_detailed( + name=name, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, + body: DeleteTeamInvitationParams, +) -> Response[DeleteTeamInvitationResponse | ErrorModel]: + """Delete team invitation + + Delete a pending team invitation that you have previously sent + + Args: + name (str): The name of the team to remove someone from + body (DeleteTeamInvitationParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeleteTeamInvitationResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, + body: DeleteTeamInvitationParams, +) -> DeleteTeamInvitationResponse | ErrorModel | None: + """Delete team invitation + + Delete a pending team invitation that you have previously sent + + Args: + name (str): The name of the team to remove someone from + body (DeleteTeamInvitationParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeleteTeamInvitationResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/delete_webhook.py b/src/tower/tower_api_client/api/default/delete_webhook.py new file mode 100644 index 00000000..5d5ca282 --- /dev/null +++ b/src/tower/tower_api_client/api/default/delete_webhook.py @@ -0,0 +1,153 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.delete_webhook_response import DeleteWebhookResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + name: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/webhooks/{name}".format( + name=quote(str(name), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DeleteWebhookResponse | ErrorModel: + if response.status_code == 200: + response_200 = DeleteWebhookResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DeleteWebhookResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[DeleteWebhookResponse | ErrorModel]: + """Delete webhook + + Args: + name (str): The name of the webhook. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeleteWebhookResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, +) -> DeleteWebhookResponse | ErrorModel | None: + """Delete webhook + + Args: + name (str): The name of the webhook. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeleteWebhookResponse | ErrorModel + """ + + return sync_detailed( + name=name, + client=client, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[DeleteWebhookResponse | ErrorModel]: + """Delete webhook + + Args: + name (str): The name of the webhook. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeleteWebhookResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, +) -> DeleteWebhookResponse | ErrorModel | None: + """Delete webhook + + Args: + name (str): The name of the webhook. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeleteWebhookResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/deploy_app.py b/src/tower/tower_api_client/api/default/deploy_app.py new file mode 100644 index 00000000..3e822ae0 --- /dev/null +++ b/src/tower/tower_api_client/api/default/deploy_app.py @@ -0,0 +1,295 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.deploy_app_json_body import DeployAppJsonBody +from ...models.deploy_app_response import DeployAppResponse +from ...models.error_model import ErrorModel +from ...types import UNSET, File, Response, Unset + + +def _get_kwargs( + name: str, + *, + body: DeployAppJsonBody | File | Unset = UNSET, + environment: str | Unset = UNSET, + all_environments: bool | Unset = False, + x_tower_checksum_sha256: str | Unset = UNSET, + content_length: int | Unset = UNSET, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + if not isinstance(x_tower_checksum_sha256, Unset): + headers["X-Tower-Checksum-SHA256"] = x_tower_checksum_sha256 + + if not isinstance(content_length, Unset): + headers["Content-Length"] = str(content_length) + + params: dict[str, Any] = {} + + params["environment"] = environment + + params["all_environments"] = all_environments + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/apps/{name}/deploy".format( + name=quote(str(name), safe=""), + ), + "params": params, + } + + if isinstance(body, DeployAppJsonBody): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, File): + _kwargs["content"] = body.payload + + headers["Content-Type"] = "application/octet-stream" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DeployAppResponse | ErrorModel | None: + if response.status_code == 201: + response_201 = DeployAppResponse.from_dict(response.json()) + + return response_201 + + if response.status_code == 400: + response_400 = ErrorModel.from_dict(response.json()) + + return response_400 + + if response.status_code == 422: + response_422 = ErrorModel.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DeployAppResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, + body: DeployAppJsonBody | File | Unset = UNSET, + environment: str | Unset = UNSET, + all_environments: bool | Unset = False, + x_tower_checksum_sha256: str | Unset = UNSET, + content_length: int | Unset = UNSET, +) -> Response[DeployAppResponse | ErrorModel]: + """Deploy app + + Deploy a new version of an app. Accepts either a TAR file upload (application/tar) or a JSON body + with source_uri (application/json) for deploying from a GitHub repository. + + Args: + name (str): The name of the app to deploy. + environment (str | Unset): The environment to deploy to. + all_environments (bool | Unset): Whether to deploy to all environments for this app. If + true, the 'environment' query parameter is ignored. Default: False. + x_tower_checksum_sha256 (str | Unset): The SHA256 hash of the content, used to verify + integrity. + content_length (int | Unset): Size of the uploaded bundle in bytes. + body (DeployAppJsonBody): Example: {'source_uri': 'https://github.com/tower/tower- + examples/tree/main/01-hello-world'}. + body (File): A .tar or .tar.gz file containing the code to deploy and MANIFEST Example: + . + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeployAppResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + environment=environment, + all_environments=all_environments, + x_tower_checksum_sha256=x_tower_checksum_sha256, + content_length=content_length, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, + body: DeployAppJsonBody | File | Unset = UNSET, + environment: str | Unset = UNSET, + all_environments: bool | Unset = False, + x_tower_checksum_sha256: str | Unset = UNSET, + content_length: int | Unset = UNSET, +) -> DeployAppResponse | ErrorModel | None: + """Deploy app + + Deploy a new version of an app. Accepts either a TAR file upload (application/tar) or a JSON body + with source_uri (application/json) for deploying from a GitHub repository. + + Args: + name (str): The name of the app to deploy. + environment (str | Unset): The environment to deploy to. + all_environments (bool | Unset): Whether to deploy to all environments for this app. If + true, the 'environment' query parameter is ignored. Default: False. + x_tower_checksum_sha256 (str | Unset): The SHA256 hash of the content, used to verify + integrity. + content_length (int | Unset): Size of the uploaded bundle in bytes. + body (DeployAppJsonBody): Example: {'source_uri': 'https://github.com/tower/tower- + examples/tree/main/01-hello-world'}. + body (File): A .tar or .tar.gz file containing the code to deploy and MANIFEST Example: + . + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeployAppResponse | ErrorModel + """ + + return sync_detailed( + name=name, + client=client, + body=body, + environment=environment, + all_environments=all_environments, + x_tower_checksum_sha256=x_tower_checksum_sha256, + content_length=content_length, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, + body: DeployAppJsonBody | File | Unset = UNSET, + environment: str | Unset = UNSET, + all_environments: bool | Unset = False, + x_tower_checksum_sha256: str | Unset = UNSET, + content_length: int | Unset = UNSET, +) -> Response[DeployAppResponse | ErrorModel]: + """Deploy app + + Deploy a new version of an app. Accepts either a TAR file upload (application/tar) or a JSON body + with source_uri (application/json) for deploying from a GitHub repository. + + Args: + name (str): The name of the app to deploy. + environment (str | Unset): The environment to deploy to. + all_environments (bool | Unset): Whether to deploy to all environments for this app. If + true, the 'environment' query parameter is ignored. Default: False. + x_tower_checksum_sha256 (str | Unset): The SHA256 hash of the content, used to verify + integrity. + content_length (int | Unset): Size of the uploaded bundle in bytes. + body (DeployAppJsonBody): Example: {'source_uri': 'https://github.com/tower/tower- + examples/tree/main/01-hello-world'}. + body (File): A .tar or .tar.gz file containing the code to deploy and MANIFEST Example: + . + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeployAppResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + environment=environment, + all_environments=all_environments, + x_tower_checksum_sha256=x_tower_checksum_sha256, + content_length=content_length, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, + body: DeployAppJsonBody | File | Unset = UNSET, + environment: str | Unset = UNSET, + all_environments: bool | Unset = False, + x_tower_checksum_sha256: str | Unset = UNSET, + content_length: int | Unset = UNSET, +) -> DeployAppResponse | ErrorModel | None: + """Deploy app + + Deploy a new version of an app. Accepts either a TAR file upload (application/tar) or a JSON body + with source_uri (application/json) for deploying from a GitHub repository. + + Args: + name (str): The name of the app to deploy. + environment (str | Unset): The environment to deploy to. + all_environments (bool | Unset): Whether to deploy to all environments for this app. If + true, the 'environment' query parameter is ignored. Default: False. + x_tower_checksum_sha256 (str | Unset): The SHA256 hash of the content, used to verify + integrity. + content_length (int | Unset): Size of the uploaded bundle in bytes. + body (DeployAppJsonBody): Example: {'source_uri': 'https://github.com/tower/tower- + examples/tree/main/01-hello-world'}. + body (File): A .tar or .tar.gz file containing the code to deploy and MANIFEST Example: + . + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeployAppResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + body=body, + environment=environment, + all_environments=all_environments, + x_tower_checksum_sha256=x_tower_checksum_sha256, + content_length=content_length, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_account.py b/src/tower/tower_api_client/api/default/describe_account.py new file mode 100644 index 00000000..67354661 --- /dev/null +++ b/src/tower/tower_api_client/api/default/describe_account.py @@ -0,0 +1,161 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.describe_account_body import DescribeAccountBody +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + name: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/accounts/{name}".format( + name=quote(str(name), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DescribeAccountBody | ErrorModel: + if response.status_code == 200: + response_200 = DescribeAccountBody.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DescribeAccountBody | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[DescribeAccountBody | ErrorModel]: + """Describe account + + Get information about a specific account by name. + + Args: + name (str): The name of the account to describe + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DescribeAccountBody | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, +) -> DescribeAccountBody | ErrorModel | None: + """Describe account + + Get information about a specific account by name. + + Args: + name (str): The name of the account to describe + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DescribeAccountBody | ErrorModel + """ + + return sync_detailed( + name=name, + client=client, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[DescribeAccountBody | ErrorModel]: + """Describe account + + Get information about a specific account by name. + + Args: + name (str): The name of the account to describe + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DescribeAccountBody | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, +) -> DescribeAccountBody | ErrorModel | None: + """Describe account + + Get information about a specific account by name. + + Args: + name (str): The name of the account to describe + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DescribeAccountBody | ErrorModel + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_app.py b/src/tower/tower_api_client/api/default/describe_app.py new file mode 100644 index 00000000..c9561e96 --- /dev/null +++ b/src/tower/tower_api_client/api/default/describe_app.py @@ -0,0 +1,246 @@ +import datetime +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.describe_app_response import DescribeAppResponse +from ...models.error_model import ErrorModel +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + name: str, + *, + runs: int | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + timezone: str | Unset = "UTC", +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["runs"] = runs + + json_start_at: str | Unset = UNSET + if not isinstance(start_at, Unset): + json_start_at = start_at.isoformat() + params["start_at"] = json_start_at + + json_end_at: str | Unset = UNSET + if not isinstance(end_at, Unset): + json_end_at = end_at.isoformat() + params["end_at"] = json_end_at + + params["timezone"] = timezone + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/apps/{name}".format( + name=quote(str(name), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DescribeAppResponse | ErrorModel: + if response.status_code == 200: + response_200 = DescribeAppResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DescribeAppResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, + runs: int | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + timezone: str | Unset = "UTC", +) -> Response[DescribeAppResponse | ErrorModel]: + """Describe app + + Get all the runs for the current account. + + Args: + name (str): The name of the app to fetch. + runs (int | Unset): The number of recent runs to fetch for the app. + start_at (datetime.datetime | Unset): Filter runs scheduled after this datetime + (inclusive). Provide timestamps in ISO-8601 format. + end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime + (inclusive). Provide timestamps in ISO-8601 format. + timezone (str | Unset): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to + UTC. Default: 'UTC'. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DescribeAppResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + runs=runs, + start_at=start_at, + end_at=end_at, + timezone=timezone, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, + runs: int | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + timezone: str | Unset = "UTC", +) -> DescribeAppResponse | ErrorModel | None: + """Describe app + + Get all the runs for the current account. + + Args: + name (str): The name of the app to fetch. + runs (int | Unset): The number of recent runs to fetch for the app. + start_at (datetime.datetime | Unset): Filter runs scheduled after this datetime + (inclusive). Provide timestamps in ISO-8601 format. + end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime + (inclusive). Provide timestamps in ISO-8601 format. + timezone (str | Unset): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to + UTC. Default: 'UTC'. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DescribeAppResponse | ErrorModel + """ + + return sync_detailed( + name=name, + client=client, + runs=runs, + start_at=start_at, + end_at=end_at, + timezone=timezone, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, + runs: int | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + timezone: str | Unset = "UTC", +) -> Response[DescribeAppResponse | ErrorModel]: + """Describe app + + Get all the runs for the current account. + + Args: + name (str): The name of the app to fetch. + runs (int | Unset): The number of recent runs to fetch for the app. + start_at (datetime.datetime | Unset): Filter runs scheduled after this datetime + (inclusive). Provide timestamps in ISO-8601 format. + end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime + (inclusive). Provide timestamps in ISO-8601 format. + timezone (str | Unset): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to + UTC. Default: 'UTC'. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DescribeAppResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + runs=runs, + start_at=start_at, + end_at=end_at, + timezone=timezone, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, + runs: int | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + timezone: str | Unset = "UTC", +) -> DescribeAppResponse | ErrorModel | None: + """Describe app + + Get all the runs for the current account. + + Args: + name (str): The name of the app to fetch. + runs (int | Unset): The number of recent runs to fetch for the app. + start_at (datetime.datetime | Unset): Filter runs scheduled after this datetime + (inclusive). Provide timestamps in ISO-8601 format. + end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime + (inclusive). Provide timestamps in ISO-8601 format. + timezone (str | Unset): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to + UTC. Default: 'UTC'. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DescribeAppResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + runs=runs, + start_at=start_at, + end_at=end_at, + timezone=timezone, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_app_version.py b/src/tower/tower_api_client/api/default/describe_app_version.py new file mode 100644 index 00000000..88d8c45e --- /dev/null +++ b/src/tower/tower_api_client/api/default/describe_app_version.py @@ -0,0 +1,175 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.describe_app_version_response import DescribeAppVersionResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + name: str, + num: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/apps/{name}/versions/{num}".format( + name=quote(str(name), safe=""), + num=quote(str(num), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DescribeAppVersionResponse | ErrorModel: + if response.status_code == 200: + response_200 = DescribeAppVersionResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DescribeAppVersionResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + num: str, + *, + client: AuthenticatedClient, +) -> Response[DescribeAppVersionResponse | ErrorModel]: + """Describe app version + + Describe an app version for an app in the current account. + + Args: + name (str): The name of the app to get the version for. + num (str): The version string to get the version for. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DescribeAppVersionResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + num=num, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + num: str, + *, + client: AuthenticatedClient, +) -> DescribeAppVersionResponse | ErrorModel | None: + """Describe app version + + Describe an app version for an app in the current account. + + Args: + name (str): The name of the app to get the version for. + num (str): The version string to get the version for. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DescribeAppVersionResponse | ErrorModel + """ + + return sync_detailed( + name=name, + num=num, + client=client, + ).parsed + + +async def asyncio_detailed( + name: str, + num: str, + *, + client: AuthenticatedClient, +) -> Response[DescribeAppVersionResponse | ErrorModel]: + """Describe app version + + Describe an app version for an app in the current account. + + Args: + name (str): The name of the app to get the version for. + num (str): The version string to get the version for. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DescribeAppVersionResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + num=num, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + num: str, + *, + client: AuthenticatedClient, +) -> DescribeAppVersionResponse | ErrorModel | None: + """Describe app version + + Describe an app version for an app in the current account. + + Args: + name (str): The name of the app to get the version for. + num (str): The version string to get the version for. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DescribeAppVersionResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + name=name, + num=num, + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_authentication_context.py b/src/tower/tower_api_client/api/default/describe_authentication_context.py new file mode 100644 index 00000000..be67bb9b --- /dev/null +++ b/src/tower/tower_api_client/api/default/describe_authentication_context.py @@ -0,0 +1,140 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.describe_authentication_context_body import ( + DescribeAuthenticationContextBody, +) +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/user/auth-context", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DescribeAuthenticationContextBody | ErrorModel: + if response.status_code == 200: + response_200 = DescribeAuthenticationContextBody.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DescribeAuthenticationContextBody | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[DescribeAuthenticationContextBody | ErrorModel]: + """Describe authentication context + + This API endpoint returns information about the current authentication context for the user that's + used for various internal processes in Tower UI. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DescribeAuthenticationContextBody | ErrorModel] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> DescribeAuthenticationContextBody | ErrorModel | None: + """Describe authentication context + + This API endpoint returns information about the current authentication context for the user that's + used for various internal processes in Tower UI. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DescribeAuthenticationContextBody | ErrorModel + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[DescribeAuthenticationContextBody | ErrorModel]: + """Describe authentication context + + This API endpoint returns information about the current authentication context for the user that's + used for various internal processes in Tower UI. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DescribeAuthenticationContextBody | ErrorModel] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> DescribeAuthenticationContextBody | ErrorModel | None: + """Describe authentication context + + This API endpoint returns information about the current authentication context for the user that's + used for various internal processes in Tower UI. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DescribeAuthenticationContextBody | ErrorModel + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_catalog.py b/src/tower/tower_api_client/api/default/describe_catalog.py new file mode 100644 index 00000000..9f990bb3 --- /dev/null +++ b/src/tower/tower_api_client/api/default/describe_catalog.py @@ -0,0 +1,182 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.describe_catalog_response import DescribeCatalogResponse +from ...models.error_model import ErrorModel +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + name: str, + *, + environment: str | Unset = "default", +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["environment"] = environment + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/catalogs/{name}".format( + name=quote(str(name), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DescribeCatalogResponse | ErrorModel: + if response.status_code == 200: + response_200 = DescribeCatalogResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DescribeCatalogResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, + environment: str | Unset = "default", +) -> Response[DescribeCatalogResponse | ErrorModel]: + """Describe catalog + + Returns details for a specific catalog, including its property names and previews. + + Args: + name (str): The name of the catalog. + environment (str | Unset): The environment of the catalog. Default: 'default'. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DescribeCatalogResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + environment=environment, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, + environment: str | Unset = "default", +) -> DescribeCatalogResponse | ErrorModel | None: + """Describe catalog + + Returns details for a specific catalog, including its property names and previews. + + Args: + name (str): The name of the catalog. + environment (str | Unset): The environment of the catalog. Default: 'default'. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DescribeCatalogResponse | ErrorModel + """ + + return sync_detailed( + name=name, + client=client, + environment=environment, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, + environment: str | Unset = "default", +) -> Response[DescribeCatalogResponse | ErrorModel]: + """Describe catalog + + Returns details for a specific catalog, including its property names and previews. + + Args: + name (str): The name of the catalog. + environment (str | Unset): The environment of the catalog. Default: 'default'. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DescribeCatalogResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + environment=environment, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, + environment: str | Unset = "default", +) -> DescribeCatalogResponse | ErrorModel | None: + """Describe catalog + + Returns details for a specific catalog, including its property names and previews. + + Args: + name (str): The name of the catalog. + environment (str | Unset): The environment of the catalog. Default: 'default'. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DescribeCatalogResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + environment=environment, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_device_login_session.py b/src/tower/tower_api_client/api/default/describe_device_login_session.py new file mode 100644 index 00000000..500b35d1 --- /dev/null +++ b/src/tower/tower_api_client/api/default/describe_device_login_session.py @@ -0,0 +1,163 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.describe_device_login_session_response import ( + DescribeDeviceLoginSessionResponse, +) +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + device_code: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/login/device/{device_code}".format( + device_code=quote(str(device_code), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DescribeDeviceLoginSessionResponse | ErrorModel: + if response.status_code == 200: + response_200 = DescribeDeviceLoginSessionResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DescribeDeviceLoginSessionResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + device_code: str, + *, + client: AuthenticatedClient | Client, +) -> Response[DescribeDeviceLoginSessionResponse | ErrorModel]: + """Describe device login session + + Checks if a device login code has been claimed and returns the user session if so. + + Args: + device_code (str): The device code to check. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DescribeDeviceLoginSessionResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + device_code=device_code, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + device_code: str, + *, + client: AuthenticatedClient | Client, +) -> DescribeDeviceLoginSessionResponse | ErrorModel | None: + """Describe device login session + + Checks if a device login code has been claimed and returns the user session if so. + + Args: + device_code (str): The device code to check. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DescribeDeviceLoginSessionResponse | ErrorModel + """ + + return sync_detailed( + device_code=device_code, + client=client, + ).parsed + + +async def asyncio_detailed( + device_code: str, + *, + client: AuthenticatedClient | Client, +) -> Response[DescribeDeviceLoginSessionResponse | ErrorModel]: + """Describe device login session + + Checks if a device login code has been claimed and returns the user session if so. + + Args: + device_code (str): The device code to check. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DescribeDeviceLoginSessionResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + device_code=device_code, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + device_code: str, + *, + client: AuthenticatedClient | Client, +) -> DescribeDeviceLoginSessionResponse | ErrorModel | None: + """Describe device login session + + Checks if a device login code has been claimed and returns the user session if so. + + Args: + device_code (str): The device code to check. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DescribeDeviceLoginSessionResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + device_code=device_code, + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_email_preferences.py b/src/tower/tower_api_client/api/default/describe_email_preferences.py new file mode 100644 index 00000000..aa842aac --- /dev/null +++ b/src/tower/tower_api_client/api/default/describe_email_preferences.py @@ -0,0 +1,134 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.describe_email_preferences_body import DescribeEmailPreferencesBody +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/user/email-preferences", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DescribeEmailPreferencesBody | ErrorModel: + if response.status_code == 200: + response_200 = DescribeEmailPreferencesBody.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DescribeEmailPreferencesBody | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[DescribeEmailPreferencesBody | ErrorModel]: + """Describe email preferences + + Describes the current user's email preferences. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DescribeEmailPreferencesBody | ErrorModel] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> DescribeEmailPreferencesBody | ErrorModel | None: + """Describe email preferences + + Describes the current user's email preferences. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DescribeEmailPreferencesBody | ErrorModel + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[DescribeEmailPreferencesBody | ErrorModel]: + """Describe email preferences + + Describes the current user's email preferences. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DescribeEmailPreferencesBody | ErrorModel] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> DescribeEmailPreferencesBody | ErrorModel | None: + """Describe email preferences + + Describes the current user's email preferences. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DescribeEmailPreferencesBody | ErrorModel + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_organization_usage.py b/src/tower/tower_api_client/api/default/describe_organization_usage.py new file mode 100644 index 00000000..ca1759a5 --- /dev/null +++ b/src/tower/tower_api_client/api/default/describe_organization_usage.py @@ -0,0 +1,134 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.organization_usage import OrganizationUsage +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/usage", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | OrganizationUsage: + if response.status_code == 200: + response_200 = OrganizationUsage.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | OrganizationUsage]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[ErrorModel | OrganizationUsage]: + """Describe organization usage + + Describe usage statistics for the user's organization for the current billing cycle. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | OrganizationUsage] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> ErrorModel | OrganizationUsage | None: + """Describe organization usage + + Describe usage statistics for the user's organization for the current billing cycle. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | OrganizationUsage + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[ErrorModel | OrganizationUsage]: + """Describe organization usage + + Describe usage statistics for the user's organization for the current billing cycle. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | OrganizationUsage] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> ErrorModel | OrganizationUsage | None: + """Describe organization usage + + Describe usage statistics for the user's organization for the current billing cycle. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | OrganizationUsage + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_plan.py b/src/tower/tower_api_client/api/default/describe_plan.py new file mode 100644 index 00000000..1648caad --- /dev/null +++ b/src/tower/tower_api_client/api/default/describe_plan.py @@ -0,0 +1,181 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.describe_plan_response import DescribePlanResponse +from ...models.error_model import ErrorModel +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["page"] = page + + params["page_size"] = page_size + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/plan", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DescribePlanResponse | ErrorModel: + if response.status_code == 200: + response_200 = DescribePlanResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DescribePlanResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> Response[DescribePlanResponse | ErrorModel]: + """Describe plan + + Get the current plan for the account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DescribePlanResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> DescribePlanResponse | ErrorModel | None: + """Describe plan + + Get the current plan for the account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DescribePlanResponse | ErrorModel + """ + + return sync_detailed( + client=client, + page=page, + page_size=page_size, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> Response[DescribePlanResponse | ErrorModel]: + """Describe plan + + Get the current plan for the account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DescribePlanResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> DescribePlanResponse | ErrorModel | None: + """Describe plan + + Get the current plan for the account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DescribePlanResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + page_size=page_size, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_run.py b/src/tower/tower_api_client/api/default/describe_run.py new file mode 100644 index 00000000..7b8ef617 --- /dev/null +++ b/src/tower/tower_api_client/api/default/describe_run.py @@ -0,0 +1,187 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.describe_run_response import DescribeRunResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + name: str, + seq: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/apps/{name}/runs/{seq}".format( + name=quote(str(name), safe=""), + seq=quote(str(seq), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DescribeRunResponse | ErrorModel | None: + if response.status_code == 200: + response_200 = DescribeRunResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 401: + response_401 = ErrorModel.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = ErrorModel.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DescribeRunResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + seq: int, + *, + client: AuthenticatedClient, +) -> Response[DescribeRunResponse | ErrorModel]: + """Describe run + + Describe a run of an app. + + Args: + name (str): The name of the app to fetch runs for. + seq (int): The number of the run to fetch. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DescribeRunResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + seq=seq, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + seq: int, + *, + client: AuthenticatedClient, +) -> DescribeRunResponse | ErrorModel | None: + """Describe run + + Describe a run of an app. + + Args: + name (str): The name of the app to fetch runs for. + seq (int): The number of the run to fetch. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DescribeRunResponse | ErrorModel + """ + + return sync_detailed( + name=name, + seq=seq, + client=client, + ).parsed + + +async def asyncio_detailed( + name: str, + seq: int, + *, + client: AuthenticatedClient, +) -> Response[DescribeRunResponse | ErrorModel]: + """Describe run + + Describe a run of an app. + + Args: + name (str): The name of the app to fetch runs for. + seq (int): The number of the run to fetch. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DescribeRunResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + seq=seq, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + seq: int, + *, + client: AuthenticatedClient, +) -> DescribeRunResponse | ErrorModel | None: + """Describe run + + Describe a run of an app. + + Args: + name (str): The name of the app to fetch runs for. + seq (int): The number of the run to fetch. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DescribeRunResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + name=name, + seq=seq, + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_run_graph.py b/src/tower/tower_api_client/api/default/describe_run_graph.py new file mode 100644 index 00000000..f12583be --- /dev/null +++ b/src/tower/tower_api_client/api/default/describe_run_graph.py @@ -0,0 +1,187 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.describe_run_graph_response import DescribeRunGraphResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + name: str, + seq: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/apps/{name}/runs/{seq}/graph".format( + name=quote(str(name), safe=""), + seq=quote(str(seq), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DescribeRunGraphResponse | ErrorModel | None: + if response.status_code == 200: + response_200 = DescribeRunGraphResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 401: + response_401 = ErrorModel.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = ErrorModel.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DescribeRunGraphResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + seq: int, + *, + client: AuthenticatedClient, +) -> Response[DescribeRunGraphResponse | ErrorModel]: + """Describe run graph + + Describe the graph that a run belongs to. + + Args: + name (str): The name of the app. + seq (int): The number of the run to fetch. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DescribeRunGraphResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + seq=seq, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + seq: int, + *, + client: AuthenticatedClient, +) -> DescribeRunGraphResponse | ErrorModel | None: + """Describe run graph + + Describe the graph that a run belongs to. + + Args: + name (str): The name of the app. + seq (int): The number of the run to fetch. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DescribeRunGraphResponse | ErrorModel + """ + + return sync_detailed( + name=name, + seq=seq, + client=client, + ).parsed + + +async def asyncio_detailed( + name: str, + seq: int, + *, + client: AuthenticatedClient, +) -> Response[DescribeRunGraphResponse | ErrorModel]: + """Describe run graph + + Describe the graph that a run belongs to. + + Args: + name (str): The name of the app. + seq (int): The number of the run to fetch. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DescribeRunGraphResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + seq=seq, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + seq: int, + *, + client: AuthenticatedClient, +) -> DescribeRunGraphResponse | ErrorModel | None: + """Describe run graph + + Describe the graph that a run belongs to. + + Args: + name (str): The name of the app. + seq (int): The number of the run to fetch. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DescribeRunGraphResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + name=name, + seq=seq, + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_run_logs.py b/src/tower/tower_api_client/api/default/describe_run_logs.py new file mode 100644 index 00000000..0d205fdf --- /dev/null +++ b/src/tower/tower_api_client/api/default/describe_run_logs.py @@ -0,0 +1,200 @@ +import datetime +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.describe_run_logs_response import DescribeRunLogsResponse +from ...models.error_model import ErrorModel +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + name: str, + seq: int, + *, + start_at: datetime.datetime | Unset = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + json_start_at: str | Unset = UNSET + if not isinstance(start_at, Unset): + json_start_at = start_at.isoformat() + params["start_at"] = json_start_at + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/apps/{name}/runs/{seq}/logs".format( + name=quote(str(name), safe=""), + seq=quote(str(seq), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DescribeRunLogsResponse | ErrorModel: + if response.status_code == 200: + response_200 = DescribeRunLogsResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DescribeRunLogsResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + seq: int, + *, + client: AuthenticatedClient, + start_at: datetime.datetime | Unset = UNSET, +) -> Response[DescribeRunLogsResponse | ErrorModel]: + """Describe run logs + + Retrieves the logs associated with a particular run of an app. + + Args: + name (str): The name of the app to get logs for. + seq (int): The sequence number of the run to get logs for. + start_at (datetime.datetime | Unset): Fetch logs from this timestamp onwards (inclusive). + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DescribeRunLogsResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + seq=seq, + start_at=start_at, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + seq: int, + *, + client: AuthenticatedClient, + start_at: datetime.datetime | Unset = UNSET, +) -> DescribeRunLogsResponse | ErrorModel | None: + """Describe run logs + + Retrieves the logs associated with a particular run of an app. + + Args: + name (str): The name of the app to get logs for. + seq (int): The sequence number of the run to get logs for. + start_at (datetime.datetime | Unset): Fetch logs from this timestamp onwards (inclusive). + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DescribeRunLogsResponse | ErrorModel + """ + + return sync_detailed( + name=name, + seq=seq, + client=client, + start_at=start_at, + ).parsed + + +async def asyncio_detailed( + name: str, + seq: int, + *, + client: AuthenticatedClient, + start_at: datetime.datetime | Unset = UNSET, +) -> Response[DescribeRunLogsResponse | ErrorModel]: + """Describe run logs + + Retrieves the logs associated with a particular run of an app. + + Args: + name (str): The name of the app to get logs for. + seq (int): The sequence number of the run to get logs for. + start_at (datetime.datetime | Unset): Fetch logs from this timestamp onwards (inclusive). + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DescribeRunLogsResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + seq=seq, + start_at=start_at, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + seq: int, + *, + client: AuthenticatedClient, + start_at: datetime.datetime | Unset = UNSET, +) -> DescribeRunLogsResponse | ErrorModel | None: + """Describe run logs + + Retrieves the logs associated with a particular run of an app. + + Args: + name (str): The name of the app to get logs for. + seq (int): The sequence number of the run to get logs for. + start_at (datetime.datetime | Unset): Fetch logs from this timestamp onwards (inclusive). + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DescribeRunLogsResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + name=name, + seq=seq, + client=client, + start_at=start_at, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_secrets_key.py b/src/tower/tower_api_client/api/default/describe_secrets_key.py new file mode 100644 index 00000000..cf2a3e8e --- /dev/null +++ b/src/tower/tower_api_client/api/default/describe_secrets_key.py @@ -0,0 +1,166 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.describe_secrets_key_response import DescribeSecretsKeyResponse +from ...models.error_model import ErrorModel +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + format_: str | Unset = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["format"] = format_ + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/secrets/key", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DescribeSecretsKeyResponse | ErrorModel: + if response.status_code == 200: + response_200 = DescribeSecretsKeyResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DescribeSecretsKeyResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + format_: str | Unset = UNSET, +) -> Response[DescribeSecretsKeyResponse | ErrorModel]: + """Describe encryption key + + Gets the encryption key used for encrypting secrets that you want to create in Tower. + + Args: + format_ (str | Unset): The format to return the key in. Options are 'pkcs1' and 'spki'. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DescribeSecretsKeyResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + format_=format_, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + format_: str | Unset = UNSET, +) -> DescribeSecretsKeyResponse | ErrorModel | None: + """Describe encryption key + + Gets the encryption key used for encrypting secrets that you want to create in Tower. + + Args: + format_ (str | Unset): The format to return the key in. Options are 'pkcs1' and 'spki'. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DescribeSecretsKeyResponse | ErrorModel + """ + + return sync_detailed( + client=client, + format_=format_, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + format_: str | Unset = UNSET, +) -> Response[DescribeSecretsKeyResponse | ErrorModel]: + """Describe encryption key + + Gets the encryption key used for encrypting secrets that you want to create in Tower. + + Args: + format_ (str | Unset): The format to return the key in. Options are 'pkcs1' and 'spki'. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DescribeSecretsKeyResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + format_=format_, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + format_: str | Unset = UNSET, +) -> DescribeSecretsKeyResponse | ErrorModel | None: + """Describe encryption key + + Gets the encryption key used for encrypting secrets that you want to create in Tower. + + Args: + format_ (str | Unset): The format to return the key in. Options are 'pkcs1' and 'spki'. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DescribeSecretsKeyResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + client=client, + format_=format_, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_session.py b/src/tower/tower_api_client/api/default/describe_session.py new file mode 100644 index 00000000..c050a314 --- /dev/null +++ b/src/tower/tower_api_client/api/default/describe_session.py @@ -0,0 +1,134 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.describe_session_response import DescribeSessionResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/session", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DescribeSessionResponse | ErrorModel: + if response.status_code == 200: + response_200 = DescribeSessionResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DescribeSessionResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[DescribeSessionResponse | ErrorModel]: + """Describe session + + Validate your current session and return the user information associated with the session. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DescribeSessionResponse | ErrorModel] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> DescribeSessionResponse | ErrorModel | None: + """Describe session + + Validate your current session and return the user information associated with the session. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DescribeSessionResponse | ErrorModel + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[DescribeSessionResponse | ErrorModel]: + """Describe session + + Validate your current session and return the user information associated with the session. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DescribeSessionResponse | ErrorModel] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> DescribeSessionResponse | ErrorModel | None: + """Describe session + + Validate your current session and return the user information associated with the session. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DescribeSessionResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_team.py b/src/tower/tower_api_client/api/default/describe_team.py new file mode 100644 index 00000000..83ae525c --- /dev/null +++ b/src/tower/tower_api_client/api/default/describe_team.py @@ -0,0 +1,161 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.describe_team_response import DescribeTeamResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + name: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/teams/{name}".format( + name=quote(str(name), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DescribeTeamResponse | ErrorModel: + if response.status_code == 200: + response_200 = DescribeTeamResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DescribeTeamResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[DescribeTeamResponse | ErrorModel]: + """Describe team + + Get details about a team, including its members and invitations. + + Args: + name (str): The name of the team to fetch. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DescribeTeamResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, +) -> DescribeTeamResponse | ErrorModel | None: + """Describe team + + Get details about a team, including its members and invitations. + + Args: + name (str): The name of the team to fetch. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DescribeTeamResponse | ErrorModel + """ + + return sync_detailed( + name=name, + client=client, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[DescribeTeamResponse | ErrorModel]: + """Describe team + + Get details about a team, including its members and invitations. + + Args: + name (str): The name of the team to fetch. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DescribeTeamResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, +) -> DescribeTeamResponse | ErrorModel | None: + """Describe team + + Get details about a team, including its members and invitations. + + Args: + name (str): The name of the team to fetch. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DescribeTeamResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_webhook.py b/src/tower/tower_api_client/api/default/describe_webhook.py new file mode 100644 index 00000000..43ec17a1 --- /dev/null +++ b/src/tower/tower_api_client/api/default/describe_webhook.py @@ -0,0 +1,153 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.describe_webhook_response import DescribeWebhookResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + name: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/webhooks/{name}".format( + name=quote(str(name), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DescribeWebhookResponse | ErrorModel: + if response.status_code == 200: + response_200 = DescribeWebhookResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DescribeWebhookResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[DescribeWebhookResponse | ErrorModel]: + """Describe webhook + + Args: + name (str): The name of the webhook. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DescribeWebhookResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, +) -> DescribeWebhookResponse | ErrorModel | None: + """Describe webhook + + Args: + name (str): The name of the webhook. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DescribeWebhookResponse | ErrorModel + """ + + return sync_detailed( + name=name, + client=client, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[DescribeWebhookResponse | ErrorModel]: + """Describe webhook + + Args: + name (str): The name of the webhook. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DescribeWebhookResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, +) -> DescribeWebhookResponse | ErrorModel | None: + """Describe webhook + + Args: + name (str): The name of the webhook. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DescribeWebhookResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/export_catalogs.py b/src/tower/tower_api_client/api/default/export_catalogs.py new file mode 100644 index 00000000..093e5f30 --- /dev/null +++ b/src/tower/tower_api_client/api/default/export_catalogs.py @@ -0,0 +1,167 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.export_catalogs_params import ExportCatalogsParams +from ...models.export_catalogs_response import ExportCatalogsResponse +from ...types import Response + + +def _get_kwargs( + *, + body: ExportCatalogsParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/catalogs/export", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ExportCatalogsResponse: + if response.status_code == 200: + response_200 = ExportCatalogsResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ExportCatalogsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: ExportCatalogsParams, +) -> Response[ErrorModel | ExportCatalogsResponse]: + """Export catalogs + + Lists all the catalogs in your current account and re-encrypt them with the public key you supplied. + + Args: + body (ExportCatalogsParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ExportCatalogsResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: ExportCatalogsParams, +) -> ErrorModel | ExportCatalogsResponse | None: + """Export catalogs + + Lists all the catalogs in your current account and re-encrypt them with the public key you supplied. + + Args: + body (ExportCatalogsParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ExportCatalogsResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: ExportCatalogsParams, +) -> Response[ErrorModel | ExportCatalogsResponse]: + """Export catalogs + + Lists all the catalogs in your current account and re-encrypt them with the public key you supplied. + + Args: + body (ExportCatalogsParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ExportCatalogsResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: ExportCatalogsParams, +) -> ErrorModel | ExportCatalogsResponse | None: + """Export catalogs + + Lists all the catalogs in your current account and re-encrypt them with the public key you supplied. + + Args: + body (ExportCatalogsParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ExportCatalogsResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/export_secrets.py b/src/tower/tower_api_client/api/default/export_secrets.py new file mode 100644 index 00000000..3433482b --- /dev/null +++ b/src/tower/tower_api_client/api/default/export_secrets.py @@ -0,0 +1,167 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.export_secrets_params import ExportSecretsParams +from ...models.export_secrets_response import ExportSecretsResponse +from ...types import Response + + +def _get_kwargs( + *, + body: ExportSecretsParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/secrets/export", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ExportSecretsResponse: + if response.status_code == 200: + response_200 = ExportSecretsResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ExportSecretsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: ExportSecretsParams, +) -> Response[ErrorModel | ExportSecretsResponse]: + """Export secrets + + Lists all the secrets in your current account and re-encrypt them with the public key you supplied. + + Args: + body (ExportSecretsParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ExportSecretsResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: ExportSecretsParams, +) -> ErrorModel | ExportSecretsResponse | None: + """Export secrets + + Lists all the secrets in your current account and re-encrypt them with the public key you supplied. + + Args: + body (ExportSecretsParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ExportSecretsResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: ExportSecretsParams, +) -> Response[ErrorModel | ExportSecretsResponse]: + """Export secrets + + Lists all the secrets in your current account and re-encrypt them with the public key you supplied. + + Args: + body (ExportSecretsParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ExportSecretsResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: ExportSecretsParams, +) -> ErrorModel | ExportSecretsResponse | None: + """Export secrets + + Lists all the secrets in your current account and re-encrypt them with the public key you supplied. + + Args: + body (ExportSecretsParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ExportSecretsResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/generate_app_statistics.py b/src/tower/tower_api_client/api/default/generate_app_statistics.py new file mode 100644 index 00000000..3b9d7db4 --- /dev/null +++ b/src/tower/tower_api_client/api/default/generate_app_statistics.py @@ -0,0 +1,170 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.generate_app_statistics_response import GenerateAppStatisticsResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + environment: str | Unset = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["environment"] = environment + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/stats/apps", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | GenerateAppStatisticsResponse: + if response.status_code == 200: + response_200 = GenerateAppStatisticsResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | GenerateAppStatisticsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + environment: str | Unset = UNSET, +) -> Response[ErrorModel | GenerateAppStatisticsResponse]: + """Generate app statistics + + Generates current statistics about apps + + Args: + environment (str | Unset): The environment to filter the statistics by. If not provided, + statistics for all environments will be returned. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | GenerateAppStatisticsResponse] + """ + + kwargs = _get_kwargs( + environment=environment, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + environment: str | Unset = UNSET, +) -> ErrorModel | GenerateAppStatisticsResponse | None: + """Generate app statistics + + Generates current statistics about apps + + Args: + environment (str | Unset): The environment to filter the statistics by. If not provided, + statistics for all environments will be returned. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | GenerateAppStatisticsResponse + """ + + return sync_detailed( + client=client, + environment=environment, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + environment: str | Unset = UNSET, +) -> Response[ErrorModel | GenerateAppStatisticsResponse]: + """Generate app statistics + + Generates current statistics about apps + + Args: + environment (str | Unset): The environment to filter the statistics by. If not provided, + statistics for all environments will be returned. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | GenerateAppStatisticsResponse] + """ + + kwargs = _get_kwargs( + environment=environment, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + environment: str | Unset = UNSET, +) -> ErrorModel | GenerateAppStatisticsResponse | None: + """Generate app statistics + + Generates current statistics about apps + + Args: + environment (str | Unset): The environment to filter the statistics by. If not provided, + statistics for all environments will be returned. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | GenerateAppStatisticsResponse + """ + + return ( + await asyncio_detailed( + client=client, + environment=environment, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/generate_organization_usage_time_series.py b/src/tower/tower_api_client/api/default/generate_organization_usage_time_series.py new file mode 100644 index 00000000..c866ff4c --- /dev/null +++ b/src/tower/tower_api_client/api/default/generate_organization_usage_time_series.py @@ -0,0 +1,138 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.generate_organization_usage_time_series_response import ( + GenerateOrganizationUsageTimeSeriesResponse, +) +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/usage/time-series", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | GenerateOrganizationUsageTimeSeriesResponse: + if response.status_code == 200: + response_200 = GenerateOrganizationUsageTimeSeriesResponse.from_dict( + response.json() + ) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | GenerateOrganizationUsageTimeSeriesResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[ErrorModel | GenerateOrganizationUsageTimeSeriesResponse]: + """Get organization usage as time series + + Get the current billing cycle usage as a time series. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | GenerateOrganizationUsageTimeSeriesResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> ErrorModel | GenerateOrganizationUsageTimeSeriesResponse | None: + """Get organization usage as time series + + Get the current billing cycle usage as a time series. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | GenerateOrganizationUsageTimeSeriesResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[ErrorModel | GenerateOrganizationUsageTimeSeriesResponse]: + """Get organization usage as time series + + Get the current billing cycle usage as a time series. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | GenerateOrganizationUsageTimeSeriesResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> ErrorModel | GenerateOrganizationUsageTimeSeriesResponse | None: + """Get organization usage as time series + + Get the current billing cycle usage as a time series. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | GenerateOrganizationUsageTimeSeriesResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/generate_run_statistics.py b/src/tower/tower_api_client/api/default/generate_run_statistics.py new file mode 100644 index 00000000..7f73b450 --- /dev/null +++ b/src/tower/tower_api_client/api/default/generate_run_statistics.py @@ -0,0 +1,251 @@ +import datetime +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.generate_run_statistics_response import GenerateRunStatisticsResponse +from ...models.generate_run_statistics_status_item import ( + GenerateRunStatisticsStatusItem, +) +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + status: list[GenerateRunStatisticsStatusItem] | Unset = UNSET, + start_at: datetime.datetime, + end_at: datetime.datetime, + timezone: str | Unset = "UTC", + environment: str | Unset = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + json_status: list[str] | Unset = UNSET + if not isinstance(status, Unset): + json_status = [] + for status_item_data in status: + status_item = status_item_data.value + json_status.append(status_item) + + params["status"] = json_status + + json_start_at = start_at.isoformat() + params["start_at"] = json_start_at + + json_end_at = end_at.isoformat() + params["end_at"] = json_end_at + + params["timezone"] = timezone + + params["environment"] = environment + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/stats/runs", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | GenerateRunStatisticsResponse: + if response.status_code == 200: + response_200 = GenerateRunStatisticsResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | GenerateRunStatisticsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + status: list[GenerateRunStatisticsStatusItem] | Unset = UNSET, + start_at: datetime.datetime, + end_at: datetime.datetime, + timezone: str | Unset = "UTC", + environment: str | Unset = UNSET, +) -> Response[ErrorModel | GenerateRunStatisticsResponse]: + """Generate run statistics + + Generates statistics about runs over a specified time period. + + Args: + status (list[GenerateRunStatisticsStatusItem] | Unset): Filter runs by status(es). Define + multiple with a comma-separated list. Supplying none will return all statuses. + start_at (datetime.datetime): Start date and time for statistics (inclusive) + end_at (datetime.datetime): End date and time for statistics (inclusive) + timezone (str | Unset): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to + UTC. Default: 'UTC'. + environment (str | Unset): Filter runs by environment. If not provided, all environments + will be included. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | GenerateRunStatisticsResponse] + """ + + kwargs = _get_kwargs( + status=status, + start_at=start_at, + end_at=end_at, + timezone=timezone, + environment=environment, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + status: list[GenerateRunStatisticsStatusItem] | Unset = UNSET, + start_at: datetime.datetime, + end_at: datetime.datetime, + timezone: str | Unset = "UTC", + environment: str | Unset = UNSET, +) -> ErrorModel | GenerateRunStatisticsResponse | None: + """Generate run statistics + + Generates statistics about runs over a specified time period. + + Args: + status (list[GenerateRunStatisticsStatusItem] | Unset): Filter runs by status(es). Define + multiple with a comma-separated list. Supplying none will return all statuses. + start_at (datetime.datetime): Start date and time for statistics (inclusive) + end_at (datetime.datetime): End date and time for statistics (inclusive) + timezone (str | Unset): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to + UTC. Default: 'UTC'. + environment (str | Unset): Filter runs by environment. If not provided, all environments + will be included. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | GenerateRunStatisticsResponse + """ + + return sync_detailed( + client=client, + status=status, + start_at=start_at, + end_at=end_at, + timezone=timezone, + environment=environment, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + status: list[GenerateRunStatisticsStatusItem] | Unset = UNSET, + start_at: datetime.datetime, + end_at: datetime.datetime, + timezone: str | Unset = "UTC", + environment: str | Unset = UNSET, +) -> Response[ErrorModel | GenerateRunStatisticsResponse]: + """Generate run statistics + + Generates statistics about runs over a specified time period. + + Args: + status (list[GenerateRunStatisticsStatusItem] | Unset): Filter runs by status(es). Define + multiple with a comma-separated list. Supplying none will return all statuses. + start_at (datetime.datetime): Start date and time for statistics (inclusive) + end_at (datetime.datetime): End date and time for statistics (inclusive) + timezone (str | Unset): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to + UTC. Default: 'UTC'. + environment (str | Unset): Filter runs by environment. If not provided, all environments + will be included. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | GenerateRunStatisticsResponse] + """ + + kwargs = _get_kwargs( + status=status, + start_at=start_at, + end_at=end_at, + timezone=timezone, + environment=environment, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + status: list[GenerateRunStatisticsStatusItem] | Unset = UNSET, + start_at: datetime.datetime, + end_at: datetime.datetime, + timezone: str | Unset = "UTC", + environment: str | Unset = UNSET, +) -> ErrorModel | GenerateRunStatisticsResponse | None: + """Generate run statistics + + Generates statistics about runs over a specified time period. + + Args: + status (list[GenerateRunStatisticsStatusItem] | Unset): Filter runs by status(es). Define + multiple with a comma-separated list. Supplying none will return all statuses. + start_at (datetime.datetime): Start date and time for statistics (inclusive) + end_at (datetime.datetime): End date and time for statistics (inclusive) + timezone (str | Unset): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to + UTC. Default: 'UTC'. + environment (str | Unset): Filter runs by environment. If not provided, all environments + will be included. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | GenerateRunStatisticsResponse + """ + + return ( + await asyncio_detailed( + client=client, + status=status, + start_at=start_at, + end_at=end_at, + timezone=timezone, + environment=environment, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/generate_runner_credentials.py b/src/tower/tower_api_client/api/default/generate_runner_credentials.py new file mode 100644 index 00000000..818f8ee8 --- /dev/null +++ b/src/tower/tower_api_client/api/default/generate_runner_credentials.py @@ -0,0 +1,140 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.generate_runner_credentials_response import ( + GenerateRunnerCredentialsResponse, +) +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/runners/credentials", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | GenerateRunnerCredentialsResponse: + if response.status_code == 200: + response_200 = GenerateRunnerCredentialsResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | GenerateRunnerCredentialsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[ErrorModel | GenerateRunnerCredentialsResponse]: + """Generate runner credentials + + Uses your current authentication context to generate runner credentials that are used for + authenticating runner requests + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | GenerateRunnerCredentialsResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> ErrorModel | GenerateRunnerCredentialsResponse | None: + """Generate runner credentials + + Uses your current authentication context to generate runner credentials that are used for + authenticating runner requests + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | GenerateRunnerCredentialsResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[ErrorModel | GenerateRunnerCredentialsResponse]: + """Generate runner credentials + + Uses your current authentication context to generate runner credentials that are used for + authenticating runner requests + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | GenerateRunnerCredentialsResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> ErrorModel | GenerateRunnerCredentialsResponse | None: + """Generate runner credentials + + Uses your current authentication context to generate runner credentials that are used for + authenticating runner requests + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | GenerateRunnerCredentialsResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/invite_team_member.py b/src/tower/tower_api_client/api/default/invite_team_member.py new file mode 100644 index 00000000..272fe5b8 --- /dev/null +++ b/src/tower/tower_api_client/api/default/invite_team_member.py @@ -0,0 +1,183 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.invite_team_member_params import InviteTeamMemberParams +from ...models.invite_team_member_response import InviteTeamMemberResponse +from ...types import Response + + +def _get_kwargs( + name: str, + *, + body: InviteTeamMemberParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/teams/{name}/invites".format( + name=quote(str(name), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | InviteTeamMemberResponse: + if response.status_code == 200: + response_200 = InviteTeamMemberResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | InviteTeamMemberResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, + body: InviteTeamMemberParams, +) -> Response[ErrorModel | InviteTeamMemberResponse]: + """Invite team member + + Invite a new team + + Args: + name (str): The name of the team to invite someone to + body (InviteTeamMemberParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | InviteTeamMemberResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, + body: InviteTeamMemberParams, +) -> ErrorModel | InviteTeamMemberResponse | None: + """Invite team member + + Invite a new team + + Args: + name (str): The name of the team to invite someone to + body (InviteTeamMemberParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | InviteTeamMemberResponse + """ + + return sync_detailed( + name=name, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, + body: InviteTeamMemberParams, +) -> Response[ErrorModel | InviteTeamMemberResponse]: + """Invite team member + + Invite a new team + + Args: + name (str): The name of the team to invite someone to + body (InviteTeamMemberParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | InviteTeamMemberResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, + body: InviteTeamMemberParams, +) -> ErrorModel | InviteTeamMemberResponse | None: + """Invite team member + + Invite a new team + + Args: + name (str): The name of the team to invite someone to + body (InviteTeamMemberParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | InviteTeamMemberResponse + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/leave_team.py b/src/tower/tower_api_client/api/default/leave_team.py new file mode 100644 index 00000000..b9fc369c --- /dev/null +++ b/src/tower/tower_api_client/api/default/leave_team.py @@ -0,0 +1,165 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.leave_team_response import LeaveTeamResponse +from ...types import Response + + +def _get_kwargs( + name: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/teams/{name}/leave".format( + name=quote(str(name), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | LeaveTeamResponse: + if response.status_code == 200: + response_200 = LeaveTeamResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | LeaveTeamResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[ErrorModel | LeaveTeamResponse]: + """Leave team + + Remove yourself from a team. If you're the last member of a team, you cannot remove yourself. You + should delete the team instead. + + Args: + name (str): The name of the team to leave + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | LeaveTeamResponse] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, +) -> ErrorModel | LeaveTeamResponse | None: + """Leave team + + Remove yourself from a team. If you're the last member of a team, you cannot remove yourself. You + should delete the team instead. + + Args: + name (str): The name of the team to leave + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | LeaveTeamResponse + """ + + return sync_detailed( + name=name, + client=client, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[ErrorModel | LeaveTeamResponse]: + """Leave team + + Remove yourself from a team. If you're the last member of a team, you cannot remove yourself. You + should delete the team instead. + + Args: + name (str): The name of the team to leave + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | LeaveTeamResponse] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, +) -> ErrorModel | LeaveTeamResponse | None: + """Leave team + + Remove yourself from a team. If you're the last member of a team, you cannot remove yourself. You + should delete the team instead. + + Args: + name (str): The name of the team to leave + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | LeaveTeamResponse + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/list_alerts.py b/src/tower/tower_api_client/api/default/list_alerts.py new file mode 100644 index 00000000..2011c877 --- /dev/null +++ b/src/tower/tower_api_client/api/default/list_alerts.py @@ -0,0 +1,271 @@ +import datetime +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.list_alerts_response import ListAlertsResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + page: int | Unset = 1, + page_size: int | Unset = 20, + alert_type: str | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + acked: str | Unset = UNSET, + environment: str | Unset = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["page"] = page + + params["page_size"] = page_size + + params["alert_type"] = alert_type + + json_start_at: str | Unset = UNSET + if not isinstance(start_at, Unset): + json_start_at = start_at.isoformat() + params["start_at"] = json_start_at + + json_end_at: str | Unset = UNSET + if not isinstance(end_at, Unset): + json_end_at = end_at.isoformat() + params["end_at"] = json_end_at + + params["acked"] = acked + + params["environment"] = environment + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/alerts", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListAlertsResponse: + if response.status_code == 200: + response_200 = ListAlertsResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListAlertsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, + alert_type: str | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + acked: str | Unset = UNSET, + environment: str | Unset = UNSET, +) -> Response[ErrorModel | ListAlertsResponse]: + """List alerts + + List alerts for the current account with optional filtering + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + alert_type (str | Unset): Filter alerts by alert type + start_at (datetime.datetime | Unset): Filter alerts created after or at this datetime + (inclusive) + end_at (datetime.datetime | Unset): Filter alerts created before or at this datetime + (inclusive) + acked (str | Unset): Filter alerts by acknowledged status. + environment (str | Unset): Filter alerts by environment (e.g., production, staging) + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListAlertsResponse] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + alert_type=alert_type, + start_at=start_at, + end_at=end_at, + acked=acked, + environment=environment, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, + alert_type: str | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + acked: str | Unset = UNSET, + environment: str | Unset = UNSET, +) -> ErrorModel | ListAlertsResponse | None: + """List alerts + + List alerts for the current account with optional filtering + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + alert_type (str | Unset): Filter alerts by alert type + start_at (datetime.datetime | Unset): Filter alerts created after or at this datetime + (inclusive) + end_at (datetime.datetime | Unset): Filter alerts created before or at this datetime + (inclusive) + acked (str | Unset): Filter alerts by acknowledged status. + environment (str | Unset): Filter alerts by environment (e.g., production, staging) + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListAlertsResponse + """ + + return sync_detailed( + client=client, + page=page, + page_size=page_size, + alert_type=alert_type, + start_at=start_at, + end_at=end_at, + acked=acked, + environment=environment, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, + alert_type: str | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + acked: str | Unset = UNSET, + environment: str | Unset = UNSET, +) -> Response[ErrorModel | ListAlertsResponse]: + """List alerts + + List alerts for the current account with optional filtering + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + alert_type (str | Unset): Filter alerts by alert type + start_at (datetime.datetime | Unset): Filter alerts created after or at this datetime + (inclusive) + end_at (datetime.datetime | Unset): Filter alerts created before or at this datetime + (inclusive) + acked (str | Unset): Filter alerts by acknowledged status. + environment (str | Unset): Filter alerts by environment (e.g., production, staging) + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListAlertsResponse] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + alert_type=alert_type, + start_at=start_at, + end_at=end_at, + acked=acked, + environment=environment, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, + alert_type: str | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + acked: str | Unset = UNSET, + environment: str | Unset = UNSET, +) -> ErrorModel | ListAlertsResponse | None: + """List alerts + + List alerts for the current account with optional filtering + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + alert_type (str | Unset): Filter alerts by alert type + start_at (datetime.datetime | Unset): Filter alerts created after or at this datetime + (inclusive) + end_at (datetime.datetime | Unset): Filter alerts created before or at this datetime + (inclusive) + acked (str | Unset): Filter alerts by acknowledged status. + environment (str | Unset): Filter alerts by environment (e.g., production, staging) + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListAlertsResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + page_size=page_size, + alert_type=alert_type, + start_at=start_at, + end_at=end_at, + acked=acked, + environment=environment, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/list_api_keys.py b/src/tower/tower_api_client/api/default/list_api_keys.py new file mode 100644 index 00000000..27df54b3 --- /dev/null +++ b/src/tower/tower_api_client/api/default/list_api_keys.py @@ -0,0 +1,181 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.list_api_keys_response import ListAPIKeysResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["page"] = page + + params["page_size"] = page_size + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api-keys", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListAPIKeysResponse: + if response.status_code == 200: + response_200 = ListAPIKeysResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListAPIKeysResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> Response[ErrorModel | ListAPIKeysResponse]: + """List API keys + + List all the API keys associated with your current account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListAPIKeysResponse] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> ErrorModel | ListAPIKeysResponse | None: + """List API keys + + List all the API keys associated with your current account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListAPIKeysResponse + """ + + return sync_detailed( + client=client, + page=page, + page_size=page_size, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> Response[ErrorModel | ListAPIKeysResponse]: + """List API keys + + List all the API keys associated with your current account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListAPIKeysResponse] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> ErrorModel | ListAPIKeysResponse | None: + """List API keys + + List all the API keys associated with your current account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListAPIKeysResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + page_size=page_size, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/list_app_environments.py b/src/tower/tower_api_client/api/default/list_app_environments.py new file mode 100644 index 00000000..61bb3790 --- /dev/null +++ b/src/tower/tower_api_client/api/default/list_app_environments.py @@ -0,0 +1,161 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.list_app_environments_response import ListAppEnvironmentsResponse +from ...types import Response + + +def _get_kwargs( + name: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/apps/{name}/environments".format( + name=quote(str(name), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListAppEnvironmentsResponse: + if response.status_code == 200: + response_200 = ListAppEnvironmentsResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListAppEnvironmentsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[ErrorModel | ListAppEnvironmentsResponse]: + """List app environments + + Generates a list of all the known environments for a given app in the current account. + + Args: + name (str): The name of the app to get the version for. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListAppEnvironmentsResponse] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, +) -> ErrorModel | ListAppEnvironmentsResponse | None: + """List app environments + + Generates a list of all the known environments for a given app in the current account. + + Args: + name (str): The name of the app to get the version for. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListAppEnvironmentsResponse + """ + + return sync_detailed( + name=name, + client=client, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[ErrorModel | ListAppEnvironmentsResponse]: + """List app environments + + Generates a list of all the known environments for a given app in the current account. + + Args: + name (str): The name of the app to get the version for. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListAppEnvironmentsResponse] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, +) -> ErrorModel | ListAppEnvironmentsResponse | None: + """List app environments + + Generates a list of all the known environments for a given app in the current account. + + Args: + name (str): The name of the app to get the version for. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListAppEnvironmentsResponse + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/list_app_versions.py b/src/tower/tower_api_client/api/default/list_app_versions.py new file mode 100644 index 00000000..a3414d4c --- /dev/null +++ b/src/tower/tower_api_client/api/default/list_app_versions.py @@ -0,0 +1,161 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.list_app_versions_response import ListAppVersionsResponse +from ...types import Response + + +def _get_kwargs( + name: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/apps/{name}/versions".format( + name=quote(str(name), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListAppVersionsResponse: + if response.status_code == 200: + response_200 = ListAppVersionsResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListAppVersionsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[ErrorModel | ListAppVersionsResponse]: + """List app versions + + List all versions of an app in the current account, sorted with the most recent first. + + Args: + name (str): The name of the app to list versions for. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListAppVersionsResponse] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, +) -> ErrorModel | ListAppVersionsResponse | None: + """List app versions + + List all versions of an app in the current account, sorted with the most recent first. + + Args: + name (str): The name of the app to list versions for. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListAppVersionsResponse + """ + + return sync_detailed( + name=name, + client=client, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[ErrorModel | ListAppVersionsResponse]: + """List app versions + + List all versions of an app in the current account, sorted with the most recent first. + + Args: + name (str): The name of the app to list versions for. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListAppVersionsResponse] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, +) -> ErrorModel | ListAppVersionsResponse | None: + """List app versions + + List all versions of an app in the current account, sorted with the most recent first. + + Args: + name (str): The name of the app to list versions for. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListAppVersionsResponse + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/list_apps.py b/src/tower/tower_api_client/api/default/list_apps.py new file mode 100644 index 00000000..c71e0f10 --- /dev/null +++ b/src/tower/tower_api_client/api/default/list_apps.py @@ -0,0 +1,274 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.list_apps_filter import ListAppsFilter +from ...models.list_apps_response import ListAppsResponse +from ...models.list_apps_sort import ListAppsSort +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + page: int | Unset = 1, + page_size: int | Unset = 20, + query: str | Unset = UNSET, + num_runs: int | Unset = 20, + sort: ListAppsSort | Unset = ListAppsSort.CREATED_AT, + filter_: ListAppsFilter | Unset = UNSET, + environment: str | Unset = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["page"] = page + + params["page_size"] = page_size + + params["query"] = query + + params["num_runs"] = num_runs + + json_sort: str | Unset = UNSET + if not isinstance(sort, Unset): + json_sort = sort.value + + params["sort"] = json_sort + + json_filter_: str | Unset = UNSET + if not isinstance(filter_, Unset): + json_filter_ = filter_.value + + params["filter"] = json_filter_ + + params["environment"] = environment + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/apps", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListAppsResponse: + if response.status_code == 200: + response_200 = ListAppsResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListAppsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, + query: str | Unset = UNSET, + num_runs: int | Unset = 20, + sort: ListAppsSort | Unset = ListAppsSort.CREATED_AT, + filter_: ListAppsFilter | Unset = UNSET, + environment: str | Unset = UNSET, +) -> Response[ErrorModel | ListAppsResponse]: + """List apps + + Get all the apps for the current account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + query (str | Unset): The search query to filter apps by. + num_runs (int | Unset): Number of recent runs to fetch (-1 for all runs, defaults to 20) + Default: 20. + sort (ListAppsSort | Unset): Sort order for the results. Default: ListAppsSort.CREATED_AT. + filter_ (ListAppsFilter | Unset): Filter to see apps with certain statuses. + environment (str | Unset): The environment to filter the apps by. If not provided, apps + for all environments will be returned. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListAppsResponse] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + query=query, + num_runs=num_runs, + sort=sort, + filter_=filter_, + environment=environment, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, + query: str | Unset = UNSET, + num_runs: int | Unset = 20, + sort: ListAppsSort | Unset = ListAppsSort.CREATED_AT, + filter_: ListAppsFilter | Unset = UNSET, + environment: str | Unset = UNSET, +) -> ErrorModel | ListAppsResponse | None: + """List apps + + Get all the apps for the current account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + query (str | Unset): The search query to filter apps by. + num_runs (int | Unset): Number of recent runs to fetch (-1 for all runs, defaults to 20) + Default: 20. + sort (ListAppsSort | Unset): Sort order for the results. Default: ListAppsSort.CREATED_AT. + filter_ (ListAppsFilter | Unset): Filter to see apps with certain statuses. + environment (str | Unset): The environment to filter the apps by. If not provided, apps + for all environments will be returned. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListAppsResponse + """ + + return sync_detailed( + client=client, + page=page, + page_size=page_size, + query=query, + num_runs=num_runs, + sort=sort, + filter_=filter_, + environment=environment, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, + query: str | Unset = UNSET, + num_runs: int | Unset = 20, + sort: ListAppsSort | Unset = ListAppsSort.CREATED_AT, + filter_: ListAppsFilter | Unset = UNSET, + environment: str | Unset = UNSET, +) -> Response[ErrorModel | ListAppsResponse]: + """List apps + + Get all the apps for the current account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + query (str | Unset): The search query to filter apps by. + num_runs (int | Unset): Number of recent runs to fetch (-1 for all runs, defaults to 20) + Default: 20. + sort (ListAppsSort | Unset): Sort order for the results. Default: ListAppsSort.CREATED_AT. + filter_ (ListAppsFilter | Unset): Filter to see apps with certain statuses. + environment (str | Unset): The environment to filter the apps by. If not provided, apps + for all environments will be returned. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListAppsResponse] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + query=query, + num_runs=num_runs, + sort=sort, + filter_=filter_, + environment=environment, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, + query: str | Unset = UNSET, + num_runs: int | Unset = 20, + sort: ListAppsSort | Unset = ListAppsSort.CREATED_AT, + filter_: ListAppsFilter | Unset = UNSET, + environment: str | Unset = UNSET, +) -> ErrorModel | ListAppsResponse | None: + """List apps + + Get all the apps for the current account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + query (str | Unset): The search query to filter apps by. + num_runs (int | Unset): Number of recent runs to fetch (-1 for all runs, defaults to 20) + Default: 20. + sort (ListAppsSort | Unset): Sort order for the results. Default: ListAppsSort.CREATED_AT. + filter_ (ListAppsFilter | Unset): Filter to see apps with certain statuses. + environment (str | Unset): The environment to filter the apps by. If not provided, apps + for all environments will be returned. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListAppsResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + page_size=page_size, + query=query, + num_runs=num_runs, + sort=sort, + filter_=filter_, + environment=environment, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/list_catalogs.py b/src/tower/tower_api_client/api/default/list_catalogs.py new file mode 100644 index 00000000..b559eb5b --- /dev/null +++ b/src/tower/tower_api_client/api/default/list_catalogs.py @@ -0,0 +1,215 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.list_catalogs_response import ListCatalogsResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + page: int | Unset = 1, + page_size: int | Unset = 20, + environment: str | Unset = UNSET, + all_: bool | Unset = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["page"] = page + + params["page_size"] = page_size + + params["environment"] = environment + + params["all"] = all_ + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/catalogs", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListCatalogsResponse: + if response.status_code == 200: + response_200 = ListCatalogsResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListCatalogsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, + environment: str | Unset = UNSET, + all_: bool | Unset = UNSET, +) -> Response[ErrorModel | ListCatalogsResponse]: + """List catalogs + + Lists all the catalogs associated with your current account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + environment (str | Unset): The environment to filter by. + all_ (bool | Unset): Whether to fetch all catalogs across all environments or only for the + current environment. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListCatalogsResponse] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + environment=environment, + all_=all_, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, + environment: str | Unset = UNSET, + all_: bool | Unset = UNSET, +) -> ErrorModel | ListCatalogsResponse | None: + """List catalogs + + Lists all the catalogs associated with your current account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + environment (str | Unset): The environment to filter by. + all_ (bool | Unset): Whether to fetch all catalogs across all environments or only for the + current environment. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListCatalogsResponse + """ + + return sync_detailed( + client=client, + page=page, + page_size=page_size, + environment=environment, + all_=all_, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, + environment: str | Unset = UNSET, + all_: bool | Unset = UNSET, +) -> Response[ErrorModel | ListCatalogsResponse]: + """List catalogs + + Lists all the catalogs associated with your current account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + environment (str | Unset): The environment to filter by. + all_ (bool | Unset): Whether to fetch all catalogs across all environments or only for the + current environment. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListCatalogsResponse] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + environment=environment, + all_=all_, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, + environment: str | Unset = UNSET, + all_: bool | Unset = UNSET, +) -> ErrorModel | ListCatalogsResponse | None: + """List catalogs + + Lists all the catalogs associated with your current account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + environment (str | Unset): The environment to filter by. + all_ (bool | Unset): Whether to fetch all catalogs across all environments or only for the + current environment. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListCatalogsResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + page_size=page_size, + environment=environment, + all_=all_, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/list_environments.py b/src/tower/tower_api_client/api/default/list_environments.py new file mode 100644 index 00000000..cdf077dc --- /dev/null +++ b/src/tower/tower_api_client/api/default/list_environments.py @@ -0,0 +1,181 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.list_environments_response import ListEnvironmentsResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["page"] = page + + params["page_size"] = page_size + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/environments", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListEnvironmentsResponse: + if response.status_code == 200: + response_200 = ListEnvironmentsResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListEnvironmentsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> Response[ErrorModel | ListEnvironmentsResponse]: + """List environments + + List all environments in your account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListEnvironmentsResponse] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> ErrorModel | ListEnvironmentsResponse | None: + """List environments + + List all environments in your account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListEnvironmentsResponse + """ + + return sync_detailed( + client=client, + page=page, + page_size=page_size, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> Response[ErrorModel | ListEnvironmentsResponse]: + """List environments + + List all environments in your account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListEnvironmentsResponse] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> ErrorModel | ListEnvironmentsResponse | None: + """List environments + + List all environments in your account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListEnvironmentsResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + page_size=page_size, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/list_guests.py b/src/tower/tower_api_client/api/default/list_guests.py new file mode 100644 index 00000000..117a77b8 --- /dev/null +++ b/src/tower/tower_api_client/api/default/list_guests.py @@ -0,0 +1,166 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.list_guests_response import ListGuestsResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + app: str | Unset = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["app"] = app + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/guests", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListGuestsResponse: + if response.status_code == 200: + response_200 = ListGuestsResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListGuestsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + app: str | Unset = UNSET, +) -> Response[ErrorModel | ListGuestsResponse]: + """List guests + + Lists all guests for the current account, optionally filtered by app. + + Args: + app (str | Unset): Filter guests by app name. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListGuestsResponse] + """ + + kwargs = _get_kwargs( + app=app, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + app: str | Unset = UNSET, +) -> ErrorModel | ListGuestsResponse | None: + """List guests + + Lists all guests for the current account, optionally filtered by app. + + Args: + app (str | Unset): Filter guests by app name. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListGuestsResponse + """ + + return sync_detailed( + client=client, + app=app, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + app: str | Unset = UNSET, +) -> Response[ErrorModel | ListGuestsResponse]: + """List guests + + Lists all guests for the current account, optionally filtered by app. + + Args: + app (str | Unset): Filter guests by app name. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListGuestsResponse] + """ + + kwargs = _get_kwargs( + app=app, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + app: str | Unset = UNSET, +) -> ErrorModel | ListGuestsResponse | None: + """List guests + + Lists all guests for the current account, optionally filtered by app. + + Args: + app (str | Unset): Filter guests by app name. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListGuestsResponse + """ + + return ( + await asyncio_detailed( + client=client, + app=app, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/list_my_team_invitations.py b/src/tower/tower_api_client/api/default/list_my_team_invitations.py new file mode 100644 index 00000000..30b74b6b --- /dev/null +++ b/src/tower/tower_api_client/api/default/list_my_team_invitations.py @@ -0,0 +1,134 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.list_my_team_invitations_response import ListMyTeamInvitationsResponse +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/team-invites", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListMyTeamInvitationsResponse: + if response.status_code == 200: + response_200 = ListMyTeamInvitationsResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListMyTeamInvitationsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[ErrorModel | ListMyTeamInvitationsResponse]: + """List my team invitations + + List your pending invitations for teams + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListMyTeamInvitationsResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> ErrorModel | ListMyTeamInvitationsResponse | None: + """List my team invitations + + List your pending invitations for teams + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListMyTeamInvitationsResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[ErrorModel | ListMyTeamInvitationsResponse]: + """List my team invitations + + List your pending invitations for teams + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListMyTeamInvitationsResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> ErrorModel | ListMyTeamInvitationsResponse | None: + """List my team invitations + + List your pending invitations for teams + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListMyTeamInvitationsResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/list_runners.py b/src/tower/tower_api_client/api/default/list_runners.py new file mode 100644 index 00000000..a863ef62 --- /dev/null +++ b/src/tower/tower_api_client/api/default/list_runners.py @@ -0,0 +1,181 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.list_runners_response import ListRunnersResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["page"] = page + + params["page_size"] = page_size + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/runners", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListRunnersResponse: + if response.status_code == 200: + response_200 = ListRunnersResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListRunnersResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> Response[ErrorModel | ListRunnersResponse]: + """List runners + + Get all self-hosted runners for the current account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListRunnersResponse] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> ErrorModel | ListRunnersResponse | None: + """List runners + + Get all self-hosted runners for the current account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListRunnersResponse + """ + + return sync_detailed( + client=client, + page=page, + page_size=page_size, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> Response[ErrorModel | ListRunnersResponse]: + """List runners + + Get all self-hosted runners for the current account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListRunnersResponse] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> ErrorModel | ListRunnersResponse | None: + """List runners + + Get all self-hosted runners for the current account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListRunnersResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + page_size=page_size, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/list_runs.py b/src/tower/tower_api_client/api/default/list_runs.py new file mode 100644 index 00000000..045426f6 --- /dev/null +++ b/src/tower/tower_api_client/api/default/list_runs.py @@ -0,0 +1,292 @@ +import datetime +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.list_runs_response import ListRunsResponse +from ...models.list_runs_status_item import ListRunsStatusItem +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + name: str, + *, + page: int | Unset = 1, + page_size: int | Unset = 20, + status: list[ListRunsStatusItem] | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + environment: str | Unset = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["page"] = page + + params["page_size"] = page_size + + json_status: list[str] | Unset = UNSET + if not isinstance(status, Unset): + json_status = [] + for status_item_data in status: + status_item = status_item_data.value + json_status.append(status_item) + + params["status"] = json_status + + json_start_at: str | Unset = UNSET + if not isinstance(start_at, Unset): + json_start_at = start_at.isoformat() + params["start_at"] = json_start_at + + json_end_at: str | Unset = UNSET + if not isinstance(end_at, Unset): + json_end_at = end_at.isoformat() + params["end_at"] = json_end_at + + params["environment"] = environment + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/apps/{name}/runs".format( + name=quote(str(name), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListRunsResponse: + if response.status_code == 200: + response_200 = ListRunsResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListRunsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, + status: list[ListRunsStatusItem] | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + environment: str | Unset = UNSET, +) -> Response[ErrorModel | ListRunsResponse]: + """List runs + + Generates a list of all the runs for a given app. The list is paginated based on the query string + parameters passed in. + + Args: + name (str): The name of the app to fetch runs for. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + status (list[ListRunsStatusItem] | Unset): Filter runs by status(es). Define multiple with + a comma-separated list. Supplying none will return all statuses. + start_at (datetime.datetime | Unset): Filter runs scheduled after or at this datetime + (inclusive) + end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime + (inclusive) + environment (str | Unset): Filter runs by environment. If not provided, all environments + will be included. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListRunsResponse] + """ + + kwargs = _get_kwargs( + name=name, + page=page, + page_size=page_size, + status=status, + start_at=start_at, + end_at=end_at, + environment=environment, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, + status: list[ListRunsStatusItem] | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + environment: str | Unset = UNSET, +) -> ErrorModel | ListRunsResponse | None: + """List runs + + Generates a list of all the runs for a given app. The list is paginated based on the query string + parameters passed in. + + Args: + name (str): The name of the app to fetch runs for. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + status (list[ListRunsStatusItem] | Unset): Filter runs by status(es). Define multiple with + a comma-separated list. Supplying none will return all statuses. + start_at (datetime.datetime | Unset): Filter runs scheduled after or at this datetime + (inclusive) + end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime + (inclusive) + environment (str | Unset): Filter runs by environment. If not provided, all environments + will be included. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListRunsResponse + """ + + return sync_detailed( + name=name, + client=client, + page=page, + page_size=page_size, + status=status, + start_at=start_at, + end_at=end_at, + environment=environment, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, + status: list[ListRunsStatusItem] | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + environment: str | Unset = UNSET, +) -> Response[ErrorModel | ListRunsResponse]: + """List runs + + Generates a list of all the runs for a given app. The list is paginated based on the query string + parameters passed in. + + Args: + name (str): The name of the app to fetch runs for. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + status (list[ListRunsStatusItem] | Unset): Filter runs by status(es). Define multiple with + a comma-separated list. Supplying none will return all statuses. + start_at (datetime.datetime | Unset): Filter runs scheduled after or at this datetime + (inclusive) + end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime + (inclusive) + environment (str | Unset): Filter runs by environment. If not provided, all environments + will be included. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListRunsResponse] + """ + + kwargs = _get_kwargs( + name=name, + page=page, + page_size=page_size, + status=status, + start_at=start_at, + end_at=end_at, + environment=environment, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, + status: list[ListRunsStatusItem] | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + environment: str | Unset = UNSET, +) -> ErrorModel | ListRunsResponse | None: + """List runs + + Generates a list of all the runs for a given app. The list is paginated based on the query string + parameters passed in. + + Args: + name (str): The name of the app to fetch runs for. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + status (list[ListRunsStatusItem] | Unset): Filter runs by status(es). Define multiple with + a comma-separated list. Supplying none will return all statuses. + start_at (datetime.datetime | Unset): Filter runs scheduled after or at this datetime + (inclusive) + end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime + (inclusive) + environment (str | Unset): Filter runs by environment. If not provided, all environments + will be included. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListRunsResponse + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + page=page, + page_size=page_size, + status=status, + start_at=start_at, + end_at=end_at, + environment=environment, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/list_schedules.py b/src/tower/tower_api_client/api/default/list_schedules.py new file mode 100644 index 00000000..582621bf --- /dev/null +++ b/src/tower/tower_api_client/api/default/list_schedules.py @@ -0,0 +1,200 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.list_schedules_response import ListSchedulesResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + page: int | Unset = 1, + page_size: int | Unset = 20, + environment: str | Unset = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["page"] = page + + params["page_size"] = page_size + + params["environment"] = environment + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/schedules", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListSchedulesResponse: + if response.status_code == 200: + response_200 = ListSchedulesResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListSchedulesResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, + environment: str | Unset = UNSET, +) -> Response[ErrorModel | ListSchedulesResponse]: + """List schedules + + List all schedules for an app. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + environment (str | Unset): Filter schedules by environment. If not provided, all + environments will be included. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListSchedulesResponse] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + environment=environment, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, + environment: str | Unset = UNSET, +) -> ErrorModel | ListSchedulesResponse | None: + """List schedules + + List all schedules for an app. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + environment (str | Unset): Filter schedules by environment. If not provided, all + environments will be included. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListSchedulesResponse + """ + + return sync_detailed( + client=client, + page=page, + page_size=page_size, + environment=environment, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, + environment: str | Unset = UNSET, +) -> Response[ErrorModel | ListSchedulesResponse]: + """List schedules + + List all schedules for an app. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + environment (str | Unset): Filter schedules by environment. If not provided, all + environments will be included. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListSchedulesResponse] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + environment=environment, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, + environment: str | Unset = UNSET, +) -> ErrorModel | ListSchedulesResponse | None: + """List schedules + + List all schedules for an app. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + environment (str | Unset): Filter schedules by environment. If not provided, all + environments will be included. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListSchedulesResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + page_size=page_size, + environment=environment, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/list_secret_environments.py b/src/tower/tower_api_client/api/default/list_secret_environments.py new file mode 100644 index 00000000..83a17848 --- /dev/null +++ b/src/tower/tower_api_client/api/default/list_secret_environments.py @@ -0,0 +1,134 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.list_secret_environments_response import ListSecretEnvironmentsResponse +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/secrets/environments", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListSecretEnvironmentsResponse: + if response.status_code == 200: + response_200 = ListSecretEnvironmentsResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListSecretEnvironmentsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[ErrorModel | ListSecretEnvironmentsResponse]: + """List secret environments + + Lists all the environments associated with secrets. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListSecretEnvironmentsResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> ErrorModel | ListSecretEnvironmentsResponse | None: + """List secret environments + + Lists all the environments associated with secrets. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListSecretEnvironmentsResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[ErrorModel | ListSecretEnvironmentsResponse]: + """List secret environments + + Lists all the environments associated with secrets. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListSecretEnvironmentsResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> ErrorModel | ListSecretEnvironmentsResponse | None: + """List secret environments + + Lists all the environments associated with secrets. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListSecretEnvironmentsResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/list_secrets.py b/src/tower/tower_api_client/api/default/list_secrets.py new file mode 100644 index 00000000..35d5237e --- /dev/null +++ b/src/tower/tower_api_client/api/default/list_secrets.py @@ -0,0 +1,215 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.list_secrets_response import ListSecretsResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + page: int | Unset = 1, + page_size: int | Unset = 20, + environment: str | Unset = UNSET, + all_: bool | Unset = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["page"] = page + + params["page_size"] = page_size + + params["environment"] = environment + + params["all"] = all_ + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/secrets", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListSecretsResponse: + if response.status_code == 200: + response_200 = ListSecretsResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListSecretsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, + environment: str | Unset = UNSET, + all_: bool | Unset = UNSET, +) -> Response[ErrorModel | ListSecretsResponse]: + """List secrets + + Lists all the secrets associated with your current account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + environment (str | Unset): The environment to filter by. + all_ (bool | Unset): Whether to fetch all secrets or only the ones that are not marked as + deleted. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListSecretsResponse] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + environment=environment, + all_=all_, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, + environment: str | Unset = UNSET, + all_: bool | Unset = UNSET, +) -> ErrorModel | ListSecretsResponse | None: + """List secrets + + Lists all the secrets associated with your current account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + environment (str | Unset): The environment to filter by. + all_ (bool | Unset): Whether to fetch all secrets or only the ones that are not marked as + deleted. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListSecretsResponse + """ + + return sync_detailed( + client=client, + page=page, + page_size=page_size, + environment=environment, + all_=all_, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, + environment: str | Unset = UNSET, + all_: bool | Unset = UNSET, +) -> Response[ErrorModel | ListSecretsResponse]: + """List secrets + + Lists all the secrets associated with your current account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + environment (str | Unset): The environment to filter by. + all_ (bool | Unset): Whether to fetch all secrets or only the ones that are not marked as + deleted. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListSecretsResponse] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + environment=environment, + all_=all_, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, + environment: str | Unset = UNSET, + all_: bool | Unset = UNSET, +) -> ErrorModel | ListSecretsResponse | None: + """List secrets + + Lists all the secrets associated with your current account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + environment (str | Unset): The environment to filter by. + all_ (bool | Unset): Whether to fetch all secrets or only the ones that are not marked as + deleted. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListSecretsResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + page_size=page_size, + environment=environment, + all_=all_, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/list_team_invitations.py b/src/tower/tower_api_client/api/default/list_team_invitations.py new file mode 100644 index 00000000..ee6cd54d --- /dev/null +++ b/src/tower/tower_api_client/api/default/list_team_invitations.py @@ -0,0 +1,161 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.list_team_invitations_response import ListTeamInvitationsResponse +from ...types import Response + + +def _get_kwargs( + name: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/teams/{name}/invites".format( + name=quote(str(name), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListTeamInvitationsResponse: + if response.status_code == 200: + response_200 = ListTeamInvitationsResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListTeamInvitationsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[ErrorModel | ListTeamInvitationsResponse]: + """List team invitations + + List the pending invitations for a team + + Args: + name (str): The name of the team to list members for + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListTeamInvitationsResponse] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, +) -> ErrorModel | ListTeamInvitationsResponse | None: + """List team invitations + + List the pending invitations for a team + + Args: + name (str): The name of the team to list members for + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListTeamInvitationsResponse + """ + + return sync_detailed( + name=name, + client=client, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[ErrorModel | ListTeamInvitationsResponse]: + """List team invitations + + List the pending invitations for a team + + Args: + name (str): The name of the team to list members for + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListTeamInvitationsResponse] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, +) -> ErrorModel | ListTeamInvitationsResponse | None: + """List team invitations + + List the pending invitations for a team + + Args: + name (str): The name of the team to list members for + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListTeamInvitationsResponse + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/list_team_members.py b/src/tower/tower_api_client/api/default/list_team_members.py new file mode 100644 index 00000000..3b3d8715 --- /dev/null +++ b/src/tower/tower_api_client/api/default/list_team_members.py @@ -0,0 +1,161 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.list_team_members_response import ListTeamMembersResponse +from ...types import Response + + +def _get_kwargs( + name: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/teams/{name}/members".format( + name=quote(str(name), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListTeamMembersResponse: + if response.status_code == 200: + response_200 = ListTeamMembersResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListTeamMembersResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[ErrorModel | ListTeamMembersResponse]: + """List team members + + List the members of a team + + Args: + name (str): The name of the team to list members for + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListTeamMembersResponse] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, +) -> ErrorModel | ListTeamMembersResponse | None: + """List team members + + List the members of a team + + Args: + name (str): The name of the team to list members for + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListTeamMembersResponse + """ + + return sync_detailed( + name=name, + client=client, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[ErrorModel | ListTeamMembersResponse]: + """List team members + + List the members of a team + + Args: + name (str): The name of the team to list members for + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListTeamMembersResponse] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, +) -> ErrorModel | ListTeamMembersResponse | None: + """List team members + + List the members of a team + + Args: + name (str): The name of the team to list members for + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListTeamMembersResponse + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/list_teams.py b/src/tower/tower_api_client/api/default/list_teams.py new file mode 100644 index 00000000..c298077b --- /dev/null +++ b/src/tower/tower_api_client/api/default/list_teams.py @@ -0,0 +1,181 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.list_teams_response import ListTeamsResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["page"] = page + + params["page_size"] = page_size + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/teams", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListTeamsResponse: + if response.status_code == 200: + response_200 = ListTeamsResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListTeamsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> Response[ErrorModel | ListTeamsResponse]: + """List teams + + List all the teams that you are a member of. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListTeamsResponse] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> ErrorModel | ListTeamsResponse | None: + """List teams + + List all the teams that you are a member of. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListTeamsResponse + """ + + return sync_detailed( + client=client, + page=page, + page_size=page_size, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> Response[ErrorModel | ListTeamsResponse]: + """List teams + + List all the teams that you are a member of. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListTeamsResponse] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> ErrorModel | ListTeamsResponse | None: + """List teams + + List all the teams that you are a member of. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListTeamsResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + page_size=page_size, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/list_webhooks.py b/src/tower/tower_api_client/api/default/list_webhooks.py new file mode 100644 index 00000000..25f201c3 --- /dev/null +++ b/src/tower/tower_api_client/api/default/list_webhooks.py @@ -0,0 +1,173 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.list_webhooks_response import ListWebhooksResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["page"] = page + + params["page_size"] = page_size + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/webhooks", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListWebhooksResponse: + if response.status_code == 200: + response_200 = ListWebhooksResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListWebhooksResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> Response[ErrorModel | ListWebhooksResponse]: + """List webhooks + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListWebhooksResponse] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> ErrorModel | ListWebhooksResponse | None: + """List webhooks + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListWebhooksResponse + """ + + return sync_detailed( + client=client, + page=page, + page_size=page_size, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> Response[ErrorModel | ListWebhooksResponse]: + """List webhooks + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ListWebhooksResponse] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> ErrorModel | ListWebhooksResponse | None: + """List webhooks + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ListWebhooksResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + page_size=page_size, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/refresh_session.py b/src/tower/tower_api_client/api/default/refresh_session.py new file mode 100644 index 00000000..fc8825a3 --- /dev/null +++ b/src/tower/tower_api_client/api/default/refresh_session.py @@ -0,0 +1,175 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.refresh_session_params import RefreshSessionParams +from ...models.refresh_session_response import RefreshSessionResponse +from ...types import Response + + +def _get_kwargs( + *, + body: RefreshSessionParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/session/refresh", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | RefreshSessionResponse: + if response.status_code == 200: + response_200 = RefreshSessionResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | RefreshSessionResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: RefreshSessionParams, +) -> Response[ErrorModel | RefreshSessionResponse]: + """Refresh session + + If your access tokens expire, this API endpoint takes a Refresh Token and returns a new set of + Access Tokens for your session. Note that we don't rotate the Refresh Token itself, and it's not + returned by this API endpoint. + + Args: + body (RefreshSessionParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | RefreshSessionResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: RefreshSessionParams, +) -> ErrorModel | RefreshSessionResponse | None: + """Refresh session + + If your access tokens expire, this API endpoint takes a Refresh Token and returns a new set of + Access Tokens for your session. Note that we don't rotate the Refresh Token itself, and it's not + returned by this API endpoint. + + Args: + body (RefreshSessionParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | RefreshSessionResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: RefreshSessionParams, +) -> Response[ErrorModel | RefreshSessionResponse]: + """Refresh session + + If your access tokens expire, this API endpoint takes a Refresh Token and returns a new set of + Access Tokens for your session. Note that we don't rotate the Refresh Token itself, and it's not + returned by this API endpoint. + + Args: + body (RefreshSessionParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | RefreshSessionResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: RefreshSessionParams, +) -> ErrorModel | RefreshSessionResponse | None: + """Refresh session + + If your access tokens expire, this API endpoint takes a Refresh Token and returns a new set of + Access Tokens for your session. Note that we don't rotate the Refresh Token itself, and it's not + returned by this API endpoint. + + Args: + body (RefreshSessionParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | RefreshSessionResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/regenerate_guest_login_url.py b/src/tower/tower_api_client/api/default/regenerate_guest_login_url.py new file mode 100644 index 00000000..0937e249 --- /dev/null +++ b/src/tower/tower_api_client/api/default/regenerate_guest_login_url.py @@ -0,0 +1,189 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.regenerate_guest_login_url_params import RegenerateGuestLoginURLParams +from ...models.regenerate_guest_login_url_response import ( + RegenerateGuestLoginURLResponse, +) +from ...types import Response + + +def _get_kwargs( + guest_id: str, + *, + body: RegenerateGuestLoginURLParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/guests/{guest_id}/login-url".format( + guest_id=quote(str(guest_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | RegenerateGuestLoginURLResponse: + if response.status_code == 200: + response_200 = RegenerateGuestLoginURLResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | RegenerateGuestLoginURLResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + guest_id: str, + *, + client: AuthenticatedClient, + body: RegenerateGuestLoginURLParams, +) -> Response[ErrorModel | RegenerateGuestLoginURLResponse]: + """Regenerate guest login URL + + Creates a new login URL for an existing guest. Use this if the previous URL expired or was + compromised. + + Args: + guest_id (str): The ID of the guest to regenerate the login URL for. + body (RegenerateGuestLoginURLParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | RegenerateGuestLoginURLResponse] + """ + + kwargs = _get_kwargs( + guest_id=guest_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + guest_id: str, + *, + client: AuthenticatedClient, + body: RegenerateGuestLoginURLParams, +) -> ErrorModel | RegenerateGuestLoginURLResponse | None: + """Regenerate guest login URL + + Creates a new login URL for an existing guest. Use this if the previous URL expired or was + compromised. + + Args: + guest_id (str): The ID of the guest to regenerate the login URL for. + body (RegenerateGuestLoginURLParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | RegenerateGuestLoginURLResponse + """ + + return sync_detailed( + guest_id=guest_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + guest_id: str, + *, + client: AuthenticatedClient, + body: RegenerateGuestLoginURLParams, +) -> Response[ErrorModel | RegenerateGuestLoginURLResponse]: + """Regenerate guest login URL + + Creates a new login URL for an existing guest. Use this if the previous URL expired or was + compromised. + + Args: + guest_id (str): The ID of the guest to regenerate the login URL for. + body (RegenerateGuestLoginURLParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | RegenerateGuestLoginURLResponse] + """ + + kwargs = _get_kwargs( + guest_id=guest_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + guest_id: str, + *, + client: AuthenticatedClient, + body: RegenerateGuestLoginURLParams, +) -> ErrorModel | RegenerateGuestLoginURLResponse | None: + """Regenerate guest login URL + + Creates a new login URL for an existing guest. Use this if the previous URL expired or was + compromised. + + Args: + guest_id (str): The ID of the guest to regenerate the login URL for. + body (RegenerateGuestLoginURLParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | RegenerateGuestLoginURLResponse + """ + + return ( + await asyncio_detailed( + guest_id=guest_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/remove_team_member.py b/src/tower/tower_api_client/api/default/remove_team_member.py new file mode 100644 index 00000000..1a80ada5 --- /dev/null +++ b/src/tower/tower_api_client/api/default/remove_team_member.py @@ -0,0 +1,175 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.remove_team_member_params import RemoveTeamMemberParams +from ...models.remove_team_member_response import RemoveTeamMemberResponse +from ...types import Response + + +def _get_kwargs( + name: str, + *, + body: RemoveTeamMemberParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/teams/{name}/members".format( + name=quote(str(name), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | RemoveTeamMemberResponse: + if response.status_code == 200: + response_200 = RemoveTeamMemberResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | RemoveTeamMemberResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, + body: RemoveTeamMemberParams, +) -> Response[ErrorModel | RemoveTeamMemberResponse]: + """Remove team member + + Args: + name (str): The name of the team to remove someone from + body (RemoveTeamMemberParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | RemoveTeamMemberResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, + body: RemoveTeamMemberParams, +) -> ErrorModel | RemoveTeamMemberResponse | None: + """Remove team member + + Args: + name (str): The name of the team to remove someone from + body (RemoveTeamMemberParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | RemoveTeamMemberResponse + """ + + return sync_detailed( + name=name, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, + body: RemoveTeamMemberParams, +) -> Response[ErrorModel | RemoveTeamMemberResponse]: + """Remove team member + + Args: + name (str): The name of the team to remove someone from + body (RemoveTeamMemberParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | RemoveTeamMemberResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, + body: RemoveTeamMemberParams, +) -> ErrorModel | RemoveTeamMemberResponse | None: + """Remove team member + + Args: + name (str): The name of the team to remove someone from + body (RemoveTeamMemberParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | RemoveTeamMemberResponse + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/resend_team_invitation.py b/src/tower/tower_api_client/api/default/resend_team_invitation.py new file mode 100644 index 00000000..b519ebf1 --- /dev/null +++ b/src/tower/tower_api_client/api/default/resend_team_invitation.py @@ -0,0 +1,183 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.resend_team_invitation_params import ResendTeamInvitationParams +from ...models.resend_team_invitation_response import ResendTeamInvitationResponse +from ...types import Response + + +def _get_kwargs( + name: str, + *, + body: ResendTeamInvitationParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/teams/{name}/invites/resend".format( + name=quote(str(name), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ResendTeamInvitationResponse: + if response.status_code == 200: + response_200 = ResendTeamInvitationResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ResendTeamInvitationResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, + body: ResendTeamInvitationParams, +) -> Response[ErrorModel | ResendTeamInvitationResponse]: + """Resend team invitation + + Resend a team invitation to a user if they need a reminder or if they lost it + + Args: + name (str): The name of the team to invite someone to + body (ResendTeamInvitationParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ResendTeamInvitationResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, + body: ResendTeamInvitationParams, +) -> ErrorModel | ResendTeamInvitationResponse | None: + """Resend team invitation + + Resend a team invitation to a user if they need a reminder or if they lost it + + Args: + name (str): The name of the team to invite someone to + body (ResendTeamInvitationParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ResendTeamInvitationResponse + """ + + return sync_detailed( + name=name, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, + body: ResendTeamInvitationParams, +) -> Response[ErrorModel | ResendTeamInvitationResponse]: + """Resend team invitation + + Resend a team invitation to a user if they need a reminder or if they lost it + + Args: + name (str): The name of the team to invite someone to + body (ResendTeamInvitationParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | ResendTeamInvitationResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, + body: ResendTeamInvitationParams, +) -> ErrorModel | ResendTeamInvitationResponse | None: + """Resend team invitation + + Resend a team invitation to a user if they need a reminder or if they lost it + + Args: + name (str): The name of the team to invite someone to + body (ResendTeamInvitationParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | ResendTeamInvitationResponse + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/run_app.py b/src/tower/tower_api_client/api/default/run_app.py new file mode 100644 index 00000000..8ef5e82f --- /dev/null +++ b/src/tower/tower_api_client/api/default/run_app.py @@ -0,0 +1,190 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.run_app_params import RunAppParams +from ...models.run_app_response import RunAppResponse +from ...types import Response + + +def _get_kwargs( + name: str, + *, + body: RunAppParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/apps/{name}/runs".format( + name=quote(str(name), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | RunAppResponse | None: + if response.status_code == 201: + response_201 = RunAppResponse.from_dict(response.json()) + + return response_201 + + if response.status_code == 401: + response_401 = ErrorModel.from_dict(response.json()) + + return response_401 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | RunAppResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, + body: RunAppParams, +) -> Response[ErrorModel | RunAppResponse]: + """Run app + + Runs an app with the supplied parameters. + + Args: + name (str): The name of the app to fetch runs for. + body (RunAppParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | RunAppResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, + body: RunAppParams, +) -> ErrorModel | RunAppResponse | None: + """Run app + + Runs an app with the supplied parameters. + + Args: + name (str): The name of the app to fetch runs for. + body (RunAppParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | RunAppResponse + """ + + return sync_detailed( + name=name, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, + body: RunAppParams, +) -> Response[ErrorModel | RunAppResponse]: + """Run app + + Runs an app with the supplied parameters. + + Args: + name (str): The name of the app to fetch runs for. + body (RunAppParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | RunAppResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, + body: RunAppParams, +) -> ErrorModel | RunAppResponse | None: + """Run app + + Runs an app with the supplied parameters. + + Args: + name (str): The name of the app to fetch runs for. + body (RunAppParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | RunAppResponse + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/search_runs.py b/src/tower/tower_api_client/api/default/search_runs.py new file mode 100644 index 00000000..9af4f0b6 --- /dev/null +++ b/src/tower/tower_api_client/api/default/search_runs.py @@ -0,0 +1,272 @@ +import datetime +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.search_runs_response import SearchRunsResponse +from ...models.search_runs_status_item import SearchRunsStatusItem +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + page: int | Unset = 1, + page_size: int | Unset = 20, + status: list[SearchRunsStatusItem] | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + environment: str | Unset = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["page"] = page + + params["page_size"] = page_size + + json_status: list[str] | Unset = UNSET + if not isinstance(status, Unset): + json_status = [] + for status_item_data in status: + status_item = status_item_data.value + json_status.append(status_item) + + params["status"] = json_status + + json_start_at: str | Unset = UNSET + if not isinstance(start_at, Unset): + json_start_at = start_at.isoformat() + params["start_at"] = json_start_at + + json_end_at: str | Unset = UNSET + if not isinstance(end_at, Unset): + json_end_at = end_at.isoformat() + params["end_at"] = json_end_at + + params["environment"] = environment + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/runs", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | SearchRunsResponse: + if response.status_code == 200: + response_200 = SearchRunsResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | SearchRunsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, + status: list[SearchRunsStatusItem] | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + environment: str | Unset = UNSET, +) -> Response[ErrorModel | SearchRunsResponse]: + """Search runs + + Search, filter, and list runs across all of the apps in your account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + status (list[SearchRunsStatusItem] | Unset): Filter runs by status(es). Define multiple + with a comma-separated list. Supplying none will return all statuses. + start_at (datetime.datetime | Unset): Filter runs scheduled after this datetime + (inclusive). Provide timestamps in ISO-8601 format. + end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime + (inclusive). Provide timestamps in ISO-8601 format. + environment (str | Unset): Filter runs by environment. If not provided, all environments + will be included. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | SearchRunsResponse] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + status=status, + start_at=start_at, + end_at=end_at, + environment=environment, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, + status: list[SearchRunsStatusItem] | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + environment: str | Unset = UNSET, +) -> ErrorModel | SearchRunsResponse | None: + """Search runs + + Search, filter, and list runs across all of the apps in your account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + status (list[SearchRunsStatusItem] | Unset): Filter runs by status(es). Define multiple + with a comma-separated list. Supplying none will return all statuses. + start_at (datetime.datetime | Unset): Filter runs scheduled after this datetime + (inclusive). Provide timestamps in ISO-8601 format. + end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime + (inclusive). Provide timestamps in ISO-8601 format. + environment (str | Unset): Filter runs by environment. If not provided, all environments + will be included. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | SearchRunsResponse + """ + + return sync_detailed( + client=client, + page=page, + page_size=page_size, + status=status, + start_at=start_at, + end_at=end_at, + environment=environment, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, + status: list[SearchRunsStatusItem] | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + environment: str | Unset = UNSET, +) -> Response[ErrorModel | SearchRunsResponse]: + """Search runs + + Search, filter, and list runs across all of the apps in your account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + status (list[SearchRunsStatusItem] | Unset): Filter runs by status(es). Define multiple + with a comma-separated list. Supplying none will return all statuses. + start_at (datetime.datetime | Unset): Filter runs scheduled after this datetime + (inclusive). Provide timestamps in ISO-8601 format. + end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime + (inclusive). Provide timestamps in ISO-8601 format. + environment (str | Unset): Filter runs by environment. If not provided, all environments + will be included. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | SearchRunsResponse] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + status=status, + start_at=start_at, + end_at=end_at, + environment=environment, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, + status: list[SearchRunsStatusItem] | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + environment: str | Unset = UNSET, +) -> ErrorModel | SearchRunsResponse | None: + """Search runs + + Search, filter, and list runs across all of the apps in your account. + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + status (list[SearchRunsStatusItem] | Unset): Filter runs by status(es). Define multiple + with a comma-separated list. Supplying none will return all statuses. + start_at (datetime.datetime | Unset): Filter runs scheduled after this datetime + (inclusive). Provide timestamps in ISO-8601 format. + end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime + (inclusive). Provide timestamps in ISO-8601 format. + environment (str | Unset): Filter runs by environment. If not provided, all environments + will be included. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | SearchRunsResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + page_size=page_size, + status=status, + start_at=start_at, + end_at=end_at, + environment=environment, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/stream_alerts.py b/src/tower/tower_api_client/api/default/stream_alerts.py new file mode 100644 index 00000000..8339c35b --- /dev/null +++ b/src/tower/tower_api_client/api/default/stream_alerts.py @@ -0,0 +1,160 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.stream_alerts_event_alert import StreamAlertsEventAlert +from ...models.stream_alerts_event_error import StreamAlertsEventError +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/alerts/stream", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | list[StreamAlertsEventAlert | StreamAlertsEventError]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.text + for response_200_item_data in _response_200: + + def _parse_response_200_item( + data: object, + ) -> StreamAlertsEventAlert | StreamAlertsEventError: + try: + if not isinstance(data, dict): + raise TypeError() + response_200_item_event_alert = StreamAlertsEventAlert.from_dict( + data + ) + + return response_200_item_event_alert + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + response_200_item_event_error = StreamAlertsEventError.from_dict(data) + + return response_200_item_event_error + + response_200_item = _parse_response_200_item(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | list[StreamAlertsEventAlert | StreamAlertsEventError]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[ErrorModel | list[StreamAlertsEventAlert | StreamAlertsEventError]]: + """Stream alert notifications + + Streams alert notifications in real-time + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | list[StreamAlertsEventAlert | StreamAlertsEventError]] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> ErrorModel | list[StreamAlertsEventAlert | StreamAlertsEventError] | None: + """Stream alert notifications + + Streams alert notifications in real-time + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | list[StreamAlertsEventAlert | StreamAlertsEventError] + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[ErrorModel | list[StreamAlertsEventAlert | StreamAlertsEventError]]: + """Stream alert notifications + + Streams alert notifications in real-time + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | list[StreamAlertsEventAlert | StreamAlertsEventError]] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> ErrorModel | list[StreamAlertsEventAlert | StreamAlertsEventError] | None: + """Stream alert notifications + + Streams alert notifications in real-time + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | list[StreamAlertsEventAlert | StreamAlertsEventError] + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/stream_run_logs.py b/src/tower/tower_api_client/api/default/stream_run_logs.py new file mode 100644 index 00000000..d203deba --- /dev/null +++ b/src/tower/tower_api_client/api/default/stream_run_logs.py @@ -0,0 +1,201 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.stream_run_logs_event_log import StreamRunLogsEventLog +from ...models.stream_run_logs_event_warning import StreamRunLogsEventWarning +from ...types import Response + + +def _get_kwargs( + name: str, + seq: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/apps/{name}/runs/{seq}/logs/stream".format( + name=quote(str(name), safe=""), + seq=quote(str(seq), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | list[StreamRunLogsEventLog | StreamRunLogsEventWarning]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.text + for response_200_item_data in _response_200: + + def _parse_response_200_item( + data: object, + ) -> StreamRunLogsEventLog | StreamRunLogsEventWarning: + try: + if not isinstance(data, dict): + raise TypeError() + response_200_item_event_log = StreamRunLogsEventLog.from_dict(data) + + return response_200_item_event_log + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + response_200_item_event_warning = StreamRunLogsEventWarning.from_dict( + data + ) + + return response_200_item_event_warning + + response_200_item = _parse_response_200_item(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | list[StreamRunLogsEventLog | StreamRunLogsEventWarning]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + seq: int, + *, + client: AuthenticatedClient, +) -> Response[ErrorModel | list[StreamRunLogsEventLog | StreamRunLogsEventWarning]]: + """Stream run logs + + Streams the logs associated with a particular run of an app in real-time. + + Args: + name (str): The name of the app to get logs for. + seq (int): The sequence number of the run to get logs for. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | list[StreamRunLogsEventLog | StreamRunLogsEventWarning]] + """ + + kwargs = _get_kwargs( + name=name, + seq=seq, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + seq: int, + *, + client: AuthenticatedClient, +) -> ErrorModel | list[StreamRunLogsEventLog | StreamRunLogsEventWarning] | None: + """Stream run logs + + Streams the logs associated with a particular run of an app in real-time. + + Args: + name (str): The name of the app to get logs for. + seq (int): The sequence number of the run to get logs for. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | list[StreamRunLogsEventLog | StreamRunLogsEventWarning] + """ + + return sync_detailed( + name=name, + seq=seq, + client=client, + ).parsed + + +async def asyncio_detailed( + name: str, + seq: int, + *, + client: AuthenticatedClient, +) -> Response[ErrorModel | list[StreamRunLogsEventLog | StreamRunLogsEventWarning]]: + """Stream run logs + + Streams the logs associated with a particular run of an app in real-time. + + Args: + name (str): The name of the app to get logs for. + seq (int): The sequence number of the run to get logs for. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | list[StreamRunLogsEventLog | StreamRunLogsEventWarning]] + """ + + kwargs = _get_kwargs( + name=name, + seq=seq, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + seq: int, + *, + client: AuthenticatedClient, +) -> ErrorModel | list[StreamRunLogsEventLog | StreamRunLogsEventWarning] | None: + """Stream run logs + + Streams the logs associated with a particular run of an app in real-time. + + Args: + name (str): The name of the app to get logs for. + seq (int): The sequence number of the run to get logs for. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | list[StreamRunLogsEventLog | StreamRunLogsEventWarning] + """ + + return ( + await asyncio_detailed( + name=name, + seq=seq, + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/stream_shouldertaps.py b/src/tower/tower_api_client/api/default/stream_shouldertaps.py new file mode 100644 index 00000000..639307e2 --- /dev/null +++ b/src/tower/tower_api_client/api/default/stream_shouldertaps.py @@ -0,0 +1,184 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.stream_shouldertaps_event_shouldertap import ( + StreamShouldertapsEventShouldertap, +) +from ...models.stream_shouldertaps_event_warning import StreamShouldertapsEventWarning +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/shouldertaps/stream", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + ErrorModel + | list[StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning] +): + if response.status_code == 200: + response_200 = [] + _response_200 = response.text + for response_200_item_data in _response_200: + + def _parse_response_200_item( + data: object, + ) -> StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning: + try: + if not isinstance(data, dict): + raise TypeError() + response_200_item_event_shouldertap = ( + StreamShouldertapsEventShouldertap.from_dict(data) + ) + + return response_200_item_event_shouldertap + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + response_200_item_event_warning = ( + StreamShouldertapsEventWarning.from_dict(data) + ) + + return response_200_item_event_warning + + response_200_item = _parse_response_200_item(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + ErrorModel + | list[StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning] +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[ + ErrorModel + | list[StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning] +]: + """Stream shouldertaps + + Stream events over SSE that notify you of potential data staleness + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | list[StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning]] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> ( + ErrorModel + | list[StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning] + | None +): + """Stream shouldertaps + + Stream events over SSE that notify you of potential data staleness + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | list[StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning] + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[ + ErrorModel + | list[StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning] +]: + """Stream shouldertaps + + Stream events over SSE that notify you of potential data staleness + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | list[StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning]] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> ( + ErrorModel + | list[StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning] + | None +): + """Stream shouldertaps + + Stream events over SSE that notify you of potential data staleness + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | list[StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning] + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/update_account.py b/src/tower/tower_api_client/api/default/update_account.py new file mode 100644 index 00000000..d5425c46 --- /dev/null +++ b/src/tower/tower_api_client/api/default/update_account.py @@ -0,0 +1,183 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.update_account_params import UpdateAccountParams +from ...models.update_account_response import UpdateAccountResponse +from ...types import Response + + +def _get_kwargs( + name: str, + *, + body: UpdateAccountParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/accounts/{name}".format( + name=quote(str(name), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | UpdateAccountResponse: + if response.status_code == 200: + response_200 = UpdateAccountResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | UpdateAccountResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, + body: UpdateAccountParams, +) -> Response[ErrorModel | UpdateAccountResponse]: + """Update account + + Update the properties of an account + + Args: + name (str): The name of the account to update + body (UpdateAccountParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | UpdateAccountResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, + body: UpdateAccountParams, +) -> ErrorModel | UpdateAccountResponse | None: + """Update account + + Update the properties of an account + + Args: + name (str): The name of the account to update + body (UpdateAccountParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | UpdateAccountResponse + """ + + return sync_detailed( + name=name, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, + body: UpdateAccountParams, +) -> Response[ErrorModel | UpdateAccountResponse]: + """Update account + + Update the properties of an account + + Args: + name (str): The name of the account to update + body (UpdateAccountParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | UpdateAccountResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, + body: UpdateAccountParams, +) -> ErrorModel | UpdateAccountResponse | None: + """Update account + + Update the properties of an account + + Args: + name (str): The name of the account to update + body (UpdateAccountParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | UpdateAccountResponse + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/update_app.py b/src/tower/tower_api_client/api/default/update_app.py new file mode 100644 index 00000000..6e68bd0c --- /dev/null +++ b/src/tower/tower_api_client/api/default/update_app.py @@ -0,0 +1,183 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.update_app_params import UpdateAppParams +from ...models.update_app_response import UpdateAppResponse +from ...types import Response + + +def _get_kwargs( + name: str, + *, + body: UpdateAppParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/apps/{name}".format( + name=quote(str(name), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | UpdateAppResponse: + if response.status_code == 200: + response_200 = UpdateAppResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | UpdateAppResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, + body: UpdateAppParams, +) -> Response[ErrorModel | UpdateAppResponse]: + """Update app + + Update an app in the currently authenticated account. + + Args: + name (str): The name of the App to update. + body (UpdateAppParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | UpdateAppResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, + body: UpdateAppParams, +) -> ErrorModel | UpdateAppResponse | None: + """Update app + + Update an app in the currently authenticated account. + + Args: + name (str): The name of the App to update. + body (UpdateAppParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | UpdateAppResponse + """ + + return sync_detailed( + name=name, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, + body: UpdateAppParams, +) -> Response[ErrorModel | UpdateAppResponse]: + """Update app + + Update an app in the currently authenticated account. + + Args: + name (str): The name of the App to update. + body (UpdateAppParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | UpdateAppResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, + body: UpdateAppParams, +) -> ErrorModel | UpdateAppResponse | None: + """Update app + + Update an app in the currently authenticated account. + + Args: + name (str): The name of the App to update. + body (UpdateAppParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | UpdateAppResponse + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/update_app_environment.py b/src/tower/tower_api_client/api/default/update_app_environment.py new file mode 100644 index 00000000..1c3d2ac3 --- /dev/null +++ b/src/tower/tower_api_client/api/default/update_app_environment.py @@ -0,0 +1,197 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.update_app_environment_params import UpdateAppEnvironmentParams +from ...models.update_app_environment_response import UpdateAppEnvironmentResponse +from ...types import Response + + +def _get_kwargs( + name: str, + environment: str, + *, + body: UpdateAppEnvironmentParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/apps/{name}/environments/{environment}".format( + name=quote(str(name), safe=""), + environment=quote(str(environment), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | UpdateAppEnvironmentResponse: + if response.status_code == 200: + response_200 = UpdateAppEnvironmentResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | UpdateAppEnvironmentResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + environment: str, + *, + client: AuthenticatedClient, + body: UpdateAppEnvironmentParams, +) -> Response[ErrorModel | UpdateAppEnvironmentResponse]: + """Update app environment + + Update the configuration of an app in a specific environment, such as which version is deployed. + + Args: + name (str): The name of the app. + environment (str): The name of the environment. + body (UpdateAppEnvironmentParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | UpdateAppEnvironmentResponse] + """ + + kwargs = _get_kwargs( + name=name, + environment=environment, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + environment: str, + *, + client: AuthenticatedClient, + body: UpdateAppEnvironmentParams, +) -> ErrorModel | UpdateAppEnvironmentResponse | None: + """Update app environment + + Update the configuration of an app in a specific environment, such as which version is deployed. + + Args: + name (str): The name of the app. + environment (str): The name of the environment. + body (UpdateAppEnvironmentParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | UpdateAppEnvironmentResponse + """ + + return sync_detailed( + name=name, + environment=environment, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + name: str, + environment: str, + *, + client: AuthenticatedClient, + body: UpdateAppEnvironmentParams, +) -> Response[ErrorModel | UpdateAppEnvironmentResponse]: + """Update app environment + + Update the configuration of an app in a specific environment, such as which version is deployed. + + Args: + name (str): The name of the app. + environment (str): The name of the environment. + body (UpdateAppEnvironmentParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | UpdateAppEnvironmentResponse] + """ + + kwargs = _get_kwargs( + name=name, + environment=environment, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + environment: str, + *, + client: AuthenticatedClient, + body: UpdateAppEnvironmentParams, +) -> ErrorModel | UpdateAppEnvironmentResponse | None: + """Update app environment + + Update the configuration of an app in a specific environment, such as which version is deployed. + + Args: + name (str): The name of the app. + environment (str): The name of the environment. + body (UpdateAppEnvironmentParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | UpdateAppEnvironmentResponse + """ + + return ( + await asyncio_detailed( + name=name, + environment=environment, + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/update_catalog.py b/src/tower/tower_api_client/api/default/update_catalog.py new file mode 100644 index 00000000..446a800c --- /dev/null +++ b/src/tower/tower_api_client/api/default/update_catalog.py @@ -0,0 +1,183 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.update_catalog_params import UpdateCatalogParams +from ...models.update_catalog_response import UpdateCatalogResponse +from ...types import Response + + +def _get_kwargs( + name: str, + *, + body: UpdateCatalogParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/catalogs/{name}".format( + name=quote(str(name), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | UpdateCatalogResponse: + if response.status_code == 200: + response_200 = UpdateCatalogResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | UpdateCatalogResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, + body: UpdateCatalogParams, +) -> Response[ErrorModel | UpdateCatalogResponse]: + """Update catalog + + Update a new catalog object in the currently authenticated account. + + Args: + name (str): The name of the catalog to update. + body (UpdateCatalogParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | UpdateCatalogResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, + body: UpdateCatalogParams, +) -> ErrorModel | UpdateCatalogResponse | None: + """Update catalog + + Update a new catalog object in the currently authenticated account. + + Args: + name (str): The name of the catalog to update. + body (UpdateCatalogParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | UpdateCatalogResponse + """ + + return sync_detailed( + name=name, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, + body: UpdateCatalogParams, +) -> Response[ErrorModel | UpdateCatalogResponse]: + """Update catalog + + Update a new catalog object in the currently authenticated account. + + Args: + name (str): The name of the catalog to update. + body (UpdateCatalogParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | UpdateCatalogResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, + body: UpdateCatalogParams, +) -> ErrorModel | UpdateCatalogResponse | None: + """Update catalog + + Update a new catalog object in the currently authenticated account. + + Args: + name (str): The name of the catalog to update. + body (UpdateCatalogParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | UpdateCatalogResponse + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/update_email_preferences.py b/src/tower/tower_api_client/api/default/update_email_preferences.py new file mode 100644 index 00000000..ede38b4b --- /dev/null +++ b/src/tower/tower_api_client/api/default/update_email_preferences.py @@ -0,0 +1,170 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.update_email_preferences_body import UpdateEmailPreferencesBody +from ...types import Response + + +def _get_kwargs( + *, + body: UpdateEmailPreferencesBody, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/user/email-preferences", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | UpdateEmailPreferencesBody: + if response.status_code == 200: + response_200 = UpdateEmailPreferencesBody.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | UpdateEmailPreferencesBody]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: UpdateEmailPreferencesBody, +) -> Response[ErrorModel | UpdateEmailPreferencesBody]: + """Update email preferences + + Updates the set of email preferences the current user has. If a partial set of preferences is + submitted, it will be updated accordingly. + + Args: + body (UpdateEmailPreferencesBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | UpdateEmailPreferencesBody] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: UpdateEmailPreferencesBody, +) -> ErrorModel | UpdateEmailPreferencesBody | None: + """Update email preferences + + Updates the set of email preferences the current user has. If a partial set of preferences is + submitted, it will be updated accordingly. + + Args: + body (UpdateEmailPreferencesBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | UpdateEmailPreferencesBody + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: UpdateEmailPreferencesBody, +) -> Response[ErrorModel | UpdateEmailPreferencesBody]: + """Update email preferences + + Updates the set of email preferences the current user has. If a partial set of preferences is + submitted, it will be updated accordingly. + + Args: + body (UpdateEmailPreferencesBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | UpdateEmailPreferencesBody] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: UpdateEmailPreferencesBody, +) -> ErrorModel | UpdateEmailPreferencesBody | None: + """Update email preferences + + Updates the set of email preferences the current user has. If a partial set of preferences is + submitted, it will be updated accordingly. + + Args: + body (UpdateEmailPreferencesBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | UpdateEmailPreferencesBody + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/update_environment.py b/src/tower/tower_api_client/api/default/update_environment.py new file mode 100644 index 00000000..c0a2f94a --- /dev/null +++ b/src/tower/tower_api_client/api/default/update_environment.py @@ -0,0 +1,183 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.update_environment_params import UpdateEnvironmentParams +from ...models.update_environment_response import UpdateEnvironmentResponse +from ...types import Response + + +def _get_kwargs( + name: str, + *, + body: UpdateEnvironmentParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/environments/{name}".format( + name=quote(str(name), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | UpdateEnvironmentResponse: + if response.status_code == 200: + response_200 = UpdateEnvironmentResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | UpdateEnvironmentResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, + body: UpdateEnvironmentParams, +) -> Response[ErrorModel | UpdateEnvironmentResponse]: + """Update environment + + Rename your environment + + Args: + name (str): The current name of the environment to update. + body (UpdateEnvironmentParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | UpdateEnvironmentResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, + body: UpdateEnvironmentParams, +) -> ErrorModel | UpdateEnvironmentResponse | None: + """Update environment + + Rename your environment + + Args: + name (str): The current name of the environment to update. + body (UpdateEnvironmentParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | UpdateEnvironmentResponse + """ + + return sync_detailed( + name=name, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, + body: UpdateEnvironmentParams, +) -> Response[ErrorModel | UpdateEnvironmentResponse]: + """Update environment + + Rename your environment + + Args: + name (str): The current name of the environment to update. + body (UpdateEnvironmentParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | UpdateEnvironmentResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, + body: UpdateEnvironmentParams, +) -> ErrorModel | UpdateEnvironmentResponse | None: + """Update environment + + Rename your environment + + Args: + name (str): The current name of the environment to update. + body (UpdateEnvironmentParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | UpdateEnvironmentResponse + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/update_my_team_invitation.py b/src/tower/tower_api_client/api/default/update_my_team_invitation.py new file mode 100644 index 00000000..823c9058 --- /dev/null +++ b/src/tower/tower_api_client/api/default/update_my_team_invitation.py @@ -0,0 +1,184 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.update_my_team_invitation_params import UpdateMyTeamInvitationParams +from ...models.update_my_team_invitation_response import UpdateMyTeamInvitationResponse +from ...types import Response + + +def _get_kwargs( + *, + body: UpdateMyTeamInvitationParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/team-invites", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | UpdateMyTeamInvitationResponse | None: + if response.status_code == 200: + response_200 = UpdateMyTeamInvitationResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = ErrorModel.from_dict(response.json()) + + return response_404 + + if response.status_code == 422: + response_422 = ErrorModel.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | UpdateMyTeamInvitationResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: UpdateMyTeamInvitationParams, +) -> Response[ErrorModel | UpdateMyTeamInvitationResponse]: + """Update my team invitation + + Update a team invitation that you have pending + + Args: + body (UpdateMyTeamInvitationParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | UpdateMyTeamInvitationResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: UpdateMyTeamInvitationParams, +) -> ErrorModel | UpdateMyTeamInvitationResponse | None: + """Update my team invitation + + Update a team invitation that you have pending + + Args: + body (UpdateMyTeamInvitationParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | UpdateMyTeamInvitationResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: UpdateMyTeamInvitationParams, +) -> Response[ErrorModel | UpdateMyTeamInvitationResponse]: + """Update my team invitation + + Update a team invitation that you have pending + + Args: + body (UpdateMyTeamInvitationParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | UpdateMyTeamInvitationResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: UpdateMyTeamInvitationParams, +) -> ErrorModel | UpdateMyTeamInvitationResponse | None: + """Update my team invitation + + Update a team invitation that you have pending + + Args: + body (UpdateMyTeamInvitationParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | UpdateMyTeamInvitationResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/update_organization.py b/src/tower/tower_api_client/api/default/update_organization.py new file mode 100644 index 00000000..614eee9b --- /dev/null +++ b/src/tower/tower_api_client/api/default/update_organization.py @@ -0,0 +1,210 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.update_organization_params import UpdateOrganizationParams +from ...models.update_organization_response import UpdateOrganizationResponse +from ...types import Response + + +def _get_kwargs( + name: str, + *, + body: UpdateOrganizationParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/organizations/{name}".format( + name=quote(str(name), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | UpdateOrganizationResponse | None: + if response.status_code == 200: + response_200 = UpdateOrganizationResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 403: + response_403 = ErrorModel.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ErrorModel.from_dict(response.json()) + + return response_404 + + if response.status_code == 409: + response_409 = ErrorModel.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ErrorModel.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | UpdateOrganizationResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, + body: UpdateOrganizationParams, +) -> Response[ErrorModel | UpdateOrganizationResponse]: + """Update organization + + Update an organization's name. Only the current owner can perform this operation. + + Args: + name (str): The current name of the organization to update + body (UpdateOrganizationParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | UpdateOrganizationResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, + body: UpdateOrganizationParams, +) -> ErrorModel | UpdateOrganizationResponse | None: + """Update organization + + Update an organization's name. Only the current owner can perform this operation. + + Args: + name (str): The current name of the organization to update + body (UpdateOrganizationParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | UpdateOrganizationResponse + """ + + return sync_detailed( + name=name, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, + body: UpdateOrganizationParams, +) -> Response[ErrorModel | UpdateOrganizationResponse]: + """Update organization + + Update an organization's name. Only the current owner can perform this operation. + + Args: + name (str): The current name of the organization to update + body (UpdateOrganizationParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | UpdateOrganizationResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, + body: UpdateOrganizationParams, +) -> ErrorModel | UpdateOrganizationResponse | None: + """Update organization + + Update an organization's name. Only the current owner can perform this operation. + + Args: + name (str): The current name of the organization to update + body (UpdateOrganizationParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | UpdateOrganizationResponse + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/update_plan.py b/src/tower/tower_api_client/api/default/update_plan.py new file mode 100644 index 00000000..bddc9deb --- /dev/null +++ b/src/tower/tower_api_client/api/default/update_plan.py @@ -0,0 +1,159 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.update_plan_params import UpdatePlanParams +from ...models.update_plan_response import UpdatePlanResponse +from ...types import Response + + +def _get_kwargs( + *, + body: UpdatePlanParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/plan", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | UpdatePlanResponse: + if response.status_code == 201: + response_201 = UpdatePlanResponse.from_dict(response.json()) + + return response_201 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | UpdatePlanResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: UpdatePlanParams, +) -> Response[ErrorModel | UpdatePlanResponse]: + """Update plan + + Args: + body (UpdatePlanParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | UpdatePlanResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: UpdatePlanParams, +) -> ErrorModel | UpdatePlanResponse | None: + """Update plan + + Args: + body (UpdatePlanParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | UpdatePlanResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: UpdatePlanParams, +) -> Response[ErrorModel | UpdatePlanResponse]: + """Update plan + + Args: + body (UpdatePlanParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | UpdatePlanResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: UpdatePlanParams, +) -> ErrorModel | UpdatePlanResponse | None: + """Update plan + + Args: + body (UpdatePlanParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | UpdatePlanResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/update_schedule.py b/src/tower/tower_api_client/api/default/update_schedule.py new file mode 100644 index 00000000..33a68f47 --- /dev/null +++ b/src/tower/tower_api_client/api/default/update_schedule.py @@ -0,0 +1,183 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.update_schedule_params import UpdateScheduleParams +from ...models.update_schedule_response import UpdateScheduleResponse +from ...types import Response + + +def _get_kwargs( + id_or_name: str, + *, + body: UpdateScheduleParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/schedules/{id_or_name}".format( + id_or_name=quote(str(id_or_name), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | UpdateScheduleResponse: + if response.status_code == 200: + response_200 = UpdateScheduleResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | UpdateScheduleResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id_or_name: str, + *, + client: AuthenticatedClient, + body: UpdateScheduleParams, +) -> Response[ErrorModel | UpdateScheduleResponse]: + """Update schedule + + Update an existing schedule for an app. + + Args: + id_or_name (str): The ID or name of the schedule to update. + body (UpdateScheduleParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | UpdateScheduleResponse] + """ + + kwargs = _get_kwargs( + id_or_name=id_or_name, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id_or_name: str, + *, + client: AuthenticatedClient, + body: UpdateScheduleParams, +) -> ErrorModel | UpdateScheduleResponse | None: + """Update schedule + + Update an existing schedule for an app. + + Args: + id_or_name (str): The ID or name of the schedule to update. + body (UpdateScheduleParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | UpdateScheduleResponse + """ + + return sync_detailed( + id_or_name=id_or_name, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id_or_name: str, + *, + client: AuthenticatedClient, + body: UpdateScheduleParams, +) -> Response[ErrorModel | UpdateScheduleResponse]: + """Update schedule + + Update an existing schedule for an app. + + Args: + id_or_name (str): The ID or name of the schedule to update. + body (UpdateScheduleParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | UpdateScheduleResponse] + """ + + kwargs = _get_kwargs( + id_or_name=id_or_name, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id_or_name: str, + *, + client: AuthenticatedClient, + body: UpdateScheduleParams, +) -> ErrorModel | UpdateScheduleResponse | None: + """Update schedule + + Update an existing schedule for an app. + + Args: + id_or_name (str): The ID or name of the schedule to update. + body (UpdateScheduleParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | UpdateScheduleResponse + """ + + return ( + await asyncio_detailed( + id_or_name=id_or_name, + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/update_secret.py b/src/tower/tower_api_client/api/default/update_secret.py new file mode 100644 index 00000000..af711f95 --- /dev/null +++ b/src/tower/tower_api_client/api/default/update_secret.py @@ -0,0 +1,183 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.update_secret_params import UpdateSecretParams +from ...models.update_secret_response import UpdateSecretResponse +from ...types import Response + + +def _get_kwargs( + name: str, + *, + body: UpdateSecretParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/secrets/{name}".format( + name=quote(str(name), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | UpdateSecretResponse: + if response.status_code == 200: + response_200 = UpdateSecretResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | UpdateSecretResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, + body: UpdateSecretParams, +) -> Response[ErrorModel | UpdateSecretResponse]: + """Update secret + + Updates a secret that has previously been created in your account + + Args: + name (str): + body (UpdateSecretParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | UpdateSecretResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, + body: UpdateSecretParams, +) -> ErrorModel | UpdateSecretResponse | None: + """Update secret + + Updates a secret that has previously been created in your account + + Args: + name (str): + body (UpdateSecretParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | UpdateSecretResponse + """ + + return sync_detailed( + name=name, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, + body: UpdateSecretParams, +) -> Response[ErrorModel | UpdateSecretResponse]: + """Update secret + + Updates a secret that has previously been created in your account + + Args: + name (str): + body (UpdateSecretParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | UpdateSecretResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, + body: UpdateSecretParams, +) -> ErrorModel | UpdateSecretResponse | None: + """Update secret + + Updates a secret that has previously been created in your account + + Args: + name (str): + body (UpdateSecretParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | UpdateSecretResponse + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/update_team.py b/src/tower/tower_api_client/api/default/update_team.py new file mode 100644 index 00000000..89a10a6e --- /dev/null +++ b/src/tower/tower_api_client/api/default/update_team.py @@ -0,0 +1,187 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.update_team_params import UpdateTeamParams +from ...models.update_team_response import UpdateTeamResponse +from ...types import Response + + +def _get_kwargs( + name: str, + *, + body: UpdateTeamParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/teams/{name}".format( + name=quote(str(name), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | UpdateTeamResponse: + if response.status_code == 200: + response_200 = UpdateTeamResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | UpdateTeamResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, + body: UpdateTeamParams, +) -> Response[ErrorModel | UpdateTeamResponse]: + """Update team + + Update a team with a new name or name. Note that updating the team with a new name will cause all + your URLs to change! + + Args: + name (str): The name of the team to update + body (UpdateTeamParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | UpdateTeamResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, + body: UpdateTeamParams, +) -> ErrorModel | UpdateTeamResponse | None: + """Update team + + Update a team with a new name or name. Note that updating the team with a new name will cause all + your URLs to change! + + Args: + name (str): The name of the team to update + body (UpdateTeamParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | UpdateTeamResponse + """ + + return sync_detailed( + name=name, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, + body: UpdateTeamParams, +) -> Response[ErrorModel | UpdateTeamResponse]: + """Update team + + Update a team with a new name or name. Note that updating the team with a new name will cause all + your URLs to change! + + Args: + name (str): The name of the team to update + body (UpdateTeamParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | UpdateTeamResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, + body: UpdateTeamParams, +) -> ErrorModel | UpdateTeamResponse | None: + """Update team + + Update a team with a new name or name. Note that updating the team with a new name will cause all + your URLs to change! + + Args: + name (str): The name of the team to update + body (UpdateTeamParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | UpdateTeamResponse + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/update_team_member.py b/src/tower/tower_api_client/api/default/update_team_member.py new file mode 100644 index 00000000..cc151a65 --- /dev/null +++ b/src/tower/tower_api_client/api/default/update_team_member.py @@ -0,0 +1,175 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.update_team_member_params import UpdateTeamMemberParams +from ...models.update_team_member_response import UpdateTeamMemberResponse +from ...types import Response + + +def _get_kwargs( + name: str, + *, + body: UpdateTeamMemberParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/teams/{name}/members".format( + name=quote(str(name), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | UpdateTeamMemberResponse: + if response.status_code == 200: + response_200 = UpdateTeamMemberResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | UpdateTeamMemberResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, + body: UpdateTeamMemberParams, +) -> Response[ErrorModel | UpdateTeamMemberResponse]: + """Update team member + + Args: + name (str): The name of the team + body (UpdateTeamMemberParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | UpdateTeamMemberResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, + body: UpdateTeamMemberParams, +) -> ErrorModel | UpdateTeamMemberResponse | None: + """Update team member + + Args: + name (str): The name of the team + body (UpdateTeamMemberParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | UpdateTeamMemberResponse + """ + + return sync_detailed( + name=name, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, + body: UpdateTeamMemberParams, +) -> Response[ErrorModel | UpdateTeamMemberResponse]: + """Update team member + + Args: + name (str): The name of the team + body (UpdateTeamMemberParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | UpdateTeamMemberResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, + body: UpdateTeamMemberParams, +) -> ErrorModel | UpdateTeamMemberResponse | None: + """Update team member + + Args: + name (str): The name of the team + body (UpdateTeamMemberParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | UpdateTeamMemberResponse + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/update_user.py b/src/tower/tower_api_client/api/default/update_user.py new file mode 100644 index 00000000..26298fe3 --- /dev/null +++ b/src/tower/tower_api_client/api/default/update_user.py @@ -0,0 +1,167 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.update_user_params import UpdateUserParams +from ...models.update_user_response import UpdateUserResponse +from ...types import Response + + +def _get_kwargs( + *, + body: UpdateUserParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/user", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | UpdateUserResponse: + if response.status_code == 200: + response_200 = UpdateUserResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | UpdateUserResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: UpdateUserParams, +) -> Response[ErrorModel | UpdateUserResponse]: + """Update user profile + + Updates your current user profile. + + Args: + body (UpdateUserParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | UpdateUserResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: UpdateUserParams, +) -> ErrorModel | UpdateUserResponse | None: + """Update user profile + + Updates your current user profile. + + Args: + body (UpdateUserParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | UpdateUserResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: UpdateUserParams, +) -> Response[ErrorModel | UpdateUserResponse]: + """Update user profile + + Updates your current user profile. + + Args: + body (UpdateUserParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | UpdateUserResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: UpdateUserParams, +) -> ErrorModel | UpdateUserResponse | None: + """Update user profile + + Updates your current user profile. + + Args: + body (UpdateUserParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | UpdateUserResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/update_webhook.py b/src/tower/tower_api_client/api/default/update_webhook.py new file mode 100644 index 00000000..7ee5b4c5 --- /dev/null +++ b/src/tower/tower_api_client/api/default/update_webhook.py @@ -0,0 +1,187 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.update_webhook_params import UpdateWebhookParams +from ...models.update_webhook_response import UpdateWebhookResponse +from ...types import Response + + +def _get_kwargs( + name: str, + *, + body: UpdateWebhookParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/webhooks/{name}".format( + name=quote(str(name), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | UpdateWebhookResponse: + if response.status_code == 200: + response_200 = UpdateWebhookResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | UpdateWebhookResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, + body: UpdateWebhookParams, +) -> Response[ErrorModel | UpdateWebhookResponse]: + """Update webhook + + Updates webhook. Note: it is not possible to update the URL. To do so, you should delete and + recreate the webhook instead. + + Args: + name (str): The name of the webhook. + body (UpdateWebhookParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | UpdateWebhookResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, + body: UpdateWebhookParams, +) -> ErrorModel | UpdateWebhookResponse | None: + """Update webhook + + Updates webhook. Note: it is not possible to update the URL. To do so, you should delete and + recreate the webhook instead. + + Args: + name (str): The name of the webhook. + body (UpdateWebhookParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | UpdateWebhookResponse + """ + + return sync_detailed( + name=name, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, + body: UpdateWebhookParams, +) -> Response[ErrorModel | UpdateWebhookResponse]: + """Update webhook + + Updates webhook. Note: it is not possible to update the URL. To do so, you should delete and + recreate the webhook instead. + + Args: + name (str): The name of the webhook. + body (UpdateWebhookParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | UpdateWebhookResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, + body: UpdateWebhookParams, +) -> ErrorModel | UpdateWebhookResponse | None: + """Update webhook + + Updates webhook. Note: it is not possible to update the URL. To do so, you should delete and + recreate the webhook instead. + + Args: + name (str): The name of the webhook. + body (UpdateWebhookParams): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | UpdateWebhookResponse + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/feature_flags/__init__.py b/src/tower/tower_api_client/api/feature_flags/__init__.py new file mode 100644 index 00000000..2d7c0b23 --- /dev/null +++ b/src/tower/tower_api_client/api/feature_flags/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/src/tower/tower_api_client/api/feature_flags/get_feature_flag_value.py b/src/tower/tower_api_client/api/feature_flags/get_feature_flag_value.py new file mode 100644 index 00000000..dd1cdc1f --- /dev/null +++ b/src/tower/tower_api_client/api/feature_flags/get_feature_flag_value.py @@ -0,0 +1,165 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.get_feature_flag_response_body import GetFeatureFlagResponseBody +from ...types import Response + + +def _get_kwargs( + key: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/feature-flags/{key}".format( + key=quote(str(key), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | GetFeatureFlagResponseBody: + if response.status_code == 200: + response_200 = GetFeatureFlagResponseBody.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | GetFeatureFlagResponseBody]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + key: str, + *, + client: AuthenticatedClient | Client, +) -> Response[ErrorModel | GetFeatureFlagResponseBody]: + """Get feature flag value + + Get the current value of a feature flag. Returns the flag value if enabled, or a default falsey + value if disabled. + + Args: + key (str): The feature flag key Example: schedules-enabled. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | GetFeatureFlagResponseBody] + """ + + kwargs = _get_kwargs( + key=key, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + key: str, + *, + client: AuthenticatedClient | Client, +) -> ErrorModel | GetFeatureFlagResponseBody | None: + """Get feature flag value + + Get the current value of a feature flag. Returns the flag value if enabled, or a default falsey + value if disabled. + + Args: + key (str): The feature flag key Example: schedules-enabled. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | GetFeatureFlagResponseBody + """ + + return sync_detailed( + key=key, + client=client, + ).parsed + + +async def asyncio_detailed( + key: str, + *, + client: AuthenticatedClient | Client, +) -> Response[ErrorModel | GetFeatureFlagResponseBody]: + """Get feature flag value + + Get the current value of a feature flag. Returns the flag value if enabled, or a default falsey + value if disabled. + + Args: + key (str): The feature flag key Example: schedules-enabled. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorModel | GetFeatureFlagResponseBody] + """ + + kwargs = _get_kwargs( + key=key, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + key: str, + *, + client: AuthenticatedClient | Client, +) -> ErrorModel | GetFeatureFlagResponseBody | None: + """Get feature flag value + + Get the current value of a feature flag. Returns the flag value if enabled, or a default falsey + value if disabled. + + Args: + key (str): The feature flag key Example: schedules-enabled. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorModel | GetFeatureFlagResponseBody + """ + + return ( + await asyncio_detailed( + key=key, + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/client.py b/src/tower/tower_api_client/client.py new file mode 100644 index 00000000..0ab15895 --- /dev/null +++ b/src/tower/tower_api_client/client.py @@ -0,0 +1,282 @@ +import ssl +from typing import Any + +import httpx +from attrs import define, evolve, field + + +@define +class Client: + """A class for keeping track of data related to the API + + The following are accepted as keyword arguments and will be used to construct httpx Clients internally: + + ``base_url``: The base URL for the API, all requests are made to a relative path to this URL + + ``cookies``: A dictionary of cookies to be sent with every request + + ``headers``: A dictionary of headers to be sent with every request + + ``timeout``: The maximum amount of a time a request can take. API functions will raise + httpx.TimeoutException if this is exceeded. + + ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, + but can be set to False for testing purposes. + + ``follow_redirects``: Whether or not to follow redirects. Default value is False. + + ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. + + + Attributes: + raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a + status code that was not documented in the source OpenAPI document. Can also be provided as a keyword + argument to the constructor. + """ + + raise_on_unexpected_status: bool = field(default=False, kw_only=True) + _base_url: str = field(alias="base_url") + _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") + _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") + _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: str | bool | ssl.SSLContext = field( + default=True, kw_only=True, alias="verify_ssl" + ) + _follow_redirects: bool = field( + default=False, kw_only=True, alias="follow_redirects" + ) + _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") + _client: httpx.Client | None = field(default=None, init=False) + _async_client: httpx.AsyncClient | None = field(default=None, init=False) + + def with_headers(self, headers: dict[str, str]) -> "Client": + """Get a new client matching this one with additional headers""" + if self._client is not None: + self._client.headers.update(headers) + if self._async_client is not None: + self._async_client.headers.update(headers) + return evolve(self, headers={**self._headers, **headers}) + + def with_cookies(self, cookies: dict[str, str]) -> "Client": + """Get a new client matching this one with additional cookies""" + if self._client is not None: + self._client.cookies.update(cookies) + if self._async_client is not None: + self._async_client.cookies.update(cookies) + return evolve(self, cookies={**self._cookies, **cookies}) + + def with_timeout(self, timeout: httpx.Timeout) -> "Client": + """Get a new client matching this one with a new timeout configuration""" + if self._client is not None: + self._client.timeout = timeout + if self._async_client is not None: + self._async_client.timeout = timeout + return evolve(self, timeout=timeout) + + def set_httpx_client(self, client: httpx.Client) -> "Client": + """Manually set the underlying httpx.Client + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._client = client + return self + + def get_httpx_client(self) -> httpx.Client: + """Get the underlying httpx.Client, constructing a new one if not previously set""" + if self._client is None: + self._client = httpx.Client( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._client + + def __enter__(self) -> "Client": + """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" + self.get_httpx_client().__enter__() + return self + + def __exit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for internal httpx.Client (see httpx docs)""" + self.get_httpx_client().__exit__(*args, **kwargs) + + def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Client": + """Manually set the underlying httpx.AsyncClient + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._async_client = async_client + return self + + def get_async_httpx_client(self) -> httpx.AsyncClient: + """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" + if self._async_client is None: + self._async_client = httpx.AsyncClient( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._async_client + + async def __aenter__(self) -> "Client": + """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" + await self.get_async_httpx_client().__aenter__() + return self + + async def __aexit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" + await self.get_async_httpx_client().__aexit__(*args, **kwargs) + + +@define +class AuthenticatedClient: + """A Client which has been authenticated for use on secured endpoints + + The following are accepted as keyword arguments and will be used to construct httpx Clients internally: + + ``base_url``: The base URL for the API, all requests are made to a relative path to this URL + + ``cookies``: A dictionary of cookies to be sent with every request + + ``headers``: A dictionary of headers to be sent with every request + + ``timeout``: The maximum amount of a time a request can take. API functions will raise + httpx.TimeoutException if this is exceeded. + + ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, + but can be set to False for testing purposes. + + ``follow_redirects``: Whether or not to follow redirects. Default value is False. + + ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. + + + Attributes: + raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a + status code that was not documented in the source OpenAPI document. Can also be provided as a keyword + argument to the constructor. + token: The token to use for authentication + prefix: The prefix to use for the Authorization header + auth_header_name: The name of the Authorization header + """ + + raise_on_unexpected_status: bool = field(default=False, kw_only=True) + _base_url: str = field(alias="base_url") + _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") + _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") + _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: str | bool | ssl.SSLContext = field( + default=True, kw_only=True, alias="verify_ssl" + ) + _follow_redirects: bool = field( + default=False, kw_only=True, alias="follow_redirects" + ) + _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") + _client: httpx.Client | None = field(default=None, init=False) + _async_client: httpx.AsyncClient | None = field(default=None, init=False) + + token: str + prefix: str = "Bearer" + auth_header_name: str = "Authorization" + + def with_headers(self, headers: dict[str, str]) -> "AuthenticatedClient": + """Get a new client matching this one with additional headers""" + if self._client is not None: + self._client.headers.update(headers) + if self._async_client is not None: + self._async_client.headers.update(headers) + return evolve(self, headers={**self._headers, **headers}) + + def with_cookies(self, cookies: dict[str, str]) -> "AuthenticatedClient": + """Get a new client matching this one with additional cookies""" + if self._client is not None: + self._client.cookies.update(cookies) + if self._async_client is not None: + self._async_client.cookies.update(cookies) + return evolve(self, cookies={**self._cookies, **cookies}) + + def with_timeout(self, timeout: httpx.Timeout) -> "AuthenticatedClient": + """Get a new client matching this one with a new timeout configuration""" + if self._client is not None: + self._client.timeout = timeout + if self._async_client is not None: + self._async_client.timeout = timeout + return evolve(self, timeout=timeout) + + def set_httpx_client(self, client: httpx.Client) -> "AuthenticatedClient": + """Manually set the underlying httpx.Client + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._client = client + return self + + def get_httpx_client(self) -> httpx.Client: + """Get the underlying httpx.Client, constructing a new one if not previously set""" + if self._client is None: + self._headers[self.auth_header_name] = ( + f"{self.prefix} {self.token}" if self.prefix else self.token + ) + self._client = httpx.Client( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._client + + def __enter__(self) -> "AuthenticatedClient": + """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" + self.get_httpx_client().__enter__() + return self + + def __exit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for internal httpx.Client (see httpx docs)""" + self.get_httpx_client().__exit__(*args, **kwargs) + + def set_async_httpx_client( + self, async_client: httpx.AsyncClient + ) -> "AuthenticatedClient": + """Manually set the underlying httpx.AsyncClient + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._async_client = async_client + return self + + def get_async_httpx_client(self) -> httpx.AsyncClient: + """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" + if self._async_client is None: + self._headers[self.auth_header_name] = ( + f"{self.prefix} {self.token}" if self.prefix else self.token + ) + self._async_client = httpx.AsyncClient( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._async_client + + async def __aenter__(self) -> "AuthenticatedClient": + """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" + await self.get_async_httpx_client().__aenter__() + return self + + async def __aexit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" + await self.get_async_httpx_client().__aexit__(*args, **kwargs) diff --git a/src/tower/tower_api_client/errors.py b/src/tower/tower_api_client/errors.py new file mode 100644 index 00000000..5f92e76a --- /dev/null +++ b/src/tower/tower_api_client/errors.py @@ -0,0 +1,16 @@ +"""Contains shared errors types that can be raised from API functions""" + + +class UnexpectedStatus(Exception): + """Raised by api functions when the response status an undocumented status and Client.raise_on_unexpected_status is True""" + + def __init__(self, status_code: int, content: bytes): + self.status_code = status_code + self.content = content + + super().__init__( + f"Unexpected status code: {status_code}\n\nResponse content:\n{content.decode(errors='ignore')}" + ) + + +__all__ = ["UnexpectedStatus"] diff --git a/src/tower/tower_api_client/models/__init__.py b/src/tower/tower_api_client/models/__init__.py new file mode 100644 index 00000000..d57f7661 --- /dev/null +++ b/src/tower/tower_api_client/models/__init__.py @@ -0,0 +1,469 @@ +"""Contains all the data models used in inputs/outputs""" + +from .account import Account +from .acknowledge_alert_response import AcknowledgeAlertResponse +from .acknowledge_all_alerts_response import AcknowledgeAllAlertsResponse +from .alert import Alert +from .api_key import APIKey +from .app import App +from .app_health_status import AppHealthStatus +from .app_statistics import AppStatistics +from .app_status import AppStatus +from .app_summary import AppSummary +from .app_version import AppVersion +from .authentication_context import AuthenticationContext +from .batch_schedule_params import BatchScheduleParams +from .batch_schedule_response import BatchScheduleResponse +from .cancel_run_response import CancelRunResponse +from .catalog import Catalog +from .catalog_property import CatalogProperty +from .claim_device_login_ticket_params import ClaimDeviceLoginTicketParams +from .claim_device_login_ticket_response import ClaimDeviceLoginTicketResponse +from .create_account_params import CreateAccountParams +from .create_account_params_flags_struct import CreateAccountParamsFlagsStruct +from .create_account_response import CreateAccountResponse +from .create_api_key_params import CreateAPIKeyParams +from .create_api_key_response import CreateAPIKeyResponse +from .create_app_params import CreateAppParams +from .create_app_response import CreateAppResponse +from .create_catalog_params import CreateCatalogParams +from .create_catalog_params_type import CreateCatalogParamsType +from .create_catalog_response import CreateCatalogResponse +from .create_device_login_ticket_response import CreateDeviceLoginTicketResponse +from .create_environment_params import CreateEnvironmentParams +from .create_environment_response import CreateEnvironmentResponse +from .create_guest_params import CreateGuestParams +from .create_guest_response import CreateGuestResponse +from .create_sandbox_secrets_params import CreateSandboxSecretsParams +from .create_sandbox_secrets_response import CreateSandboxSecretsResponse +from .create_schedule_params import CreateScheduleParams +from .create_schedule_params_overlap_policy import CreateScheduleParamsOverlapPolicy +from .create_schedule_params_status import CreateScheduleParamsStatus +from .create_schedule_response import CreateScheduleResponse +from .create_secret_params import CreateSecretParams +from .create_secret_response import CreateSecretResponse +from .create_session_params import CreateSessionParams +from .create_session_response import CreateSessionResponse +from .create_team_params import CreateTeamParams +from .create_team_response import CreateTeamResponse +from .create_webhook_params import CreateWebhookParams +from .create_webhook_response import CreateWebhookResponse +from .delete_api_key_params import DeleteAPIKeyParams +from .delete_api_key_response import DeleteAPIKeyResponse +from .delete_app_response import DeleteAppResponse +from .delete_catalog_response import DeleteCatalogResponse +from .delete_guest_output_body import DeleteGuestOutputBody +from .delete_schedule_params import DeleteScheduleParams +from .delete_schedule_response import DeleteScheduleResponse +from .delete_secret_response import DeleteSecretResponse +from .delete_session_params import DeleteSessionParams +from .delete_session_response import DeleteSessionResponse +from .delete_team_invitation_params import DeleteTeamInvitationParams +from .delete_team_invitation_response import DeleteTeamInvitationResponse +from .delete_team_params import DeleteTeamParams +from .delete_team_response import DeleteTeamResponse +from .delete_webhook_response import DeleteWebhookResponse +from .deploy_app_json_body import DeployAppJsonBody +from .deploy_app_response import DeployAppResponse +from .describe_account_body import DescribeAccountBody +from .describe_app_response import DescribeAppResponse +from .describe_app_version_response import DescribeAppVersionResponse +from .describe_authentication_context_body import DescribeAuthenticationContextBody +from .describe_catalog_response import DescribeCatalogResponse +from .describe_device_login_session_response import DescribeDeviceLoginSessionResponse +from .describe_email_preferences_body import DescribeEmailPreferencesBody +from .describe_plan_response import DescribePlanResponse +from .describe_run_graph_response import DescribeRunGraphResponse +from .describe_run_links import DescribeRunLinks +from .describe_run_logs_response import DescribeRunLogsResponse +from .describe_run_response import DescribeRunResponse +from .describe_secrets_key_response import DescribeSecretsKeyResponse +from .describe_session_response import DescribeSessionResponse +from .describe_team_response import DescribeTeamResponse +from .describe_webhook_response import DescribeWebhookResponse +from .email_subscriptions import EmailSubscriptions +from .encrypted_catalog_property import EncryptedCatalogProperty +from .environment import Environment +from .error_detail import ErrorDetail +from .error_model import ErrorModel +from .export_catalogs_params import ExportCatalogsParams +from .export_catalogs_response import ExportCatalogsResponse +from .export_secrets_params import ExportSecretsParams +from .export_secrets_response import ExportSecretsResponse +from .exported_catalog import ExportedCatalog +from .exported_catalog_property import ExportedCatalogProperty +from .exported_secret import ExportedSecret +from .feature import Feature +from .featurebase_identity import FeaturebaseIdentity +from .generate_app_statistics_response import GenerateAppStatisticsResponse +from .generate_organization_usage_time_series_response import ( + GenerateOrganizationUsageTimeSeriesResponse, +) +from .generate_run_statistics_response import GenerateRunStatisticsResponse +from .generate_run_statistics_status_item import GenerateRunStatisticsStatusItem +from .generate_runner_credentials_response import GenerateRunnerCredentialsResponse +from .get_feature_flag_response_body import GetFeatureFlagResponseBody +from .get_feature_flag_response_body_value_type import ( + GetFeatureFlagResponseBodyValueType, +) +from .guest import Guest +from .invite_team_member_params import InviteTeamMemberParams +from .invite_team_member_params_role import InviteTeamMemberParamsRole +from .invite_team_member_response import InviteTeamMemberResponse +from .leave_team_response import LeaveTeamResponse +from .list_alerts_response import ListAlertsResponse +from .list_api_keys_response import ListAPIKeysResponse +from .list_app_environments_response import ListAppEnvironmentsResponse +from .list_app_versions_response import ListAppVersionsResponse +from .list_apps_filter import ListAppsFilter +from .list_apps_response import ListAppsResponse +from .list_apps_sort import ListAppsSort +from .list_catalogs_response import ListCatalogsResponse +from .list_environments_response import ListEnvironmentsResponse +from .list_guests_response import ListGuestsResponse +from .list_my_team_invitations_response import ListMyTeamInvitationsResponse +from .list_runners_response import ListRunnersResponse +from .list_runs_response import ListRunsResponse +from .list_runs_status_item import ListRunsStatusItem +from .list_schedules_response import ListSchedulesResponse +from .list_secret_environments_response import ListSecretEnvironmentsResponse +from .list_secrets_response import ListSecretsResponse +from .list_team_invitations_response import ListTeamInvitationsResponse +from .list_team_members_response import ListTeamMembersResponse +from .list_teams_response import ListTeamsResponse +from .list_webhooks_response import ListWebhooksResponse +from .organization import Organization +from .organization_usage import OrganizationUsage +from .pagination import Pagination +from .parameter import Parameter +from .plan import Plan +from .refresh_session_params import RefreshSessionParams +from .refresh_session_response import RefreshSessionResponse +from .regenerate_guest_login_url_params import RegenerateGuestLoginURLParams +from .regenerate_guest_login_url_response import RegenerateGuestLoginURLResponse +from .remove_team_member_params import RemoveTeamMemberParams +from .remove_team_member_response import RemoveTeamMemberResponse +from .resend_team_invitation_params import ResendTeamInvitationParams +from .resend_team_invitation_response import ResendTeamInvitationResponse +from .run import Run +from .run_app_initiator_data import RunAppInitiatorData +from .run_app_initiator_data_type import RunAppInitiatorDataType +from .run_app_params import RunAppParams +from .run_app_params_parameters import RunAppParamsParameters +from .run_app_response import RunAppResponse +from .run_attempt import RunAttempt +from .run_failure_alert import RunFailureAlert +from .run_graph_node import RunGraphNode +from .run_graph_run_id import RunGraphRunID +from .run_initiator import RunInitiator +from .run_log_line import RunLogLine +from .run_log_line_channel import RunLogLineChannel +from .run_parameter import RunParameter +from .run_parameter_input import RunParameterInput +from .run_results import RunResults +from .run_retry_policy import RunRetryPolicy +from .run_run_initiator_details import RunRunInitiatorDetails +from .run_statistics import RunStatistics +from .run_status import RunStatus +from .run_status_group import RunStatusGroup +from .run_timeseries_point import RunTimeseriesPoint +from .runner import Runner +from .runner_credentials import RunnerCredentials +from .schedule import Schedule +from .schedule_app_status import ScheduleAppStatus +from .schedule_overlap_policy import ScheduleOverlapPolicy +from .schedule_run_initiator_details import ScheduleRunInitiatorDetails +from .schedule_status import ScheduleStatus +from .search_runs_response import SearchRunsResponse +from .search_runs_status_item import SearchRunsStatusItem +from .secret import Secret +from .session import Session +from .shoulder_tap import ShoulderTap +from .sse_warning import SSEWarning +from .statistics_settings import StatisticsSettings +from .statistics_settings_interval import StatisticsSettingsInterval +from .stream_alerts_event_alert import StreamAlertsEventAlert +from .stream_alerts_event_error import StreamAlertsEventError +from .stream_run_logs_event_log import StreamRunLogsEventLog +from .stream_run_logs_event_warning import StreamRunLogsEventWarning +from .stream_shouldertaps_event_shouldertap import StreamShouldertapsEventShouldertap +from .stream_shouldertaps_event_warning import StreamShouldertapsEventWarning +from .team import Team +from .team_invitation import TeamInvitation +from .team_membership import TeamMembership +from .team_membership_role import TeamMembershipRole +from .test_webhook_response import TestWebhookResponse +from .token import Token +from .update_account_params import UpdateAccountParams +from .update_account_params_execution_region import UpdateAccountParamsExecutionRegion +from .update_account_response import UpdateAccountResponse +from .update_app_environment_params import UpdateAppEnvironmentParams +from .update_app_environment_response import UpdateAppEnvironmentResponse +from .update_app_params import UpdateAppParams +from .update_app_response import UpdateAppResponse +from .update_catalog_params import UpdateCatalogParams +from .update_catalog_response import UpdateCatalogResponse +from .update_email_preferences_body import UpdateEmailPreferencesBody +from .update_environment_params import UpdateEnvironmentParams +from .update_environment_response import UpdateEnvironmentResponse +from .update_my_team_invitation_params import UpdateMyTeamInvitationParams +from .update_my_team_invitation_response import UpdateMyTeamInvitationResponse +from .update_organization_params import UpdateOrganizationParams +from .update_organization_response import UpdateOrganizationResponse +from .update_plan_params import UpdatePlanParams +from .update_plan_response import UpdatePlanResponse +from .update_schedule_params import UpdateScheduleParams +from .update_schedule_params_overlap_policy import UpdateScheduleParamsOverlapPolicy +from .update_schedule_params_status import UpdateScheduleParamsStatus +from .update_schedule_response import UpdateScheduleResponse +from .update_secret_params import UpdateSecretParams +from .update_secret_response import UpdateSecretResponse +from .update_team_member_params import UpdateTeamMemberParams +from .update_team_member_params_role import UpdateTeamMemberParamsRole +from .update_team_member_response import UpdateTeamMemberResponse +from .update_team_params import UpdateTeamParams +from .update_team_params_execution_region import UpdateTeamParamsExecutionRegion +from .update_team_response import UpdateTeamResponse +from .update_user_params import UpdateUserParams +from .update_user_response import UpdateUserResponse +from .update_webhook_params import UpdateWebhookParams +from .update_webhook_response import UpdateWebhookResponse +from .usage_limit import UsageLimit +from .usage_metric_time_series_point import UsageMetricTimeSeriesPoint +from .usage_metric_time_series_point_name import UsageMetricTimeSeriesPointName +from .user import User +from .webhook import Webhook +from .webhook_state import WebhookState + +__all__ = ( + "Account", + "AcknowledgeAlertResponse", + "AcknowledgeAllAlertsResponse", + "Alert", + "APIKey", + "App", + "AppHealthStatus", + "AppStatistics", + "AppStatus", + "AppSummary", + "AppVersion", + "AuthenticationContext", + "BatchScheduleParams", + "BatchScheduleResponse", + "CancelRunResponse", + "Catalog", + "CatalogProperty", + "ClaimDeviceLoginTicketParams", + "ClaimDeviceLoginTicketResponse", + "CreateAccountParams", + "CreateAccountParamsFlagsStruct", + "CreateAccountResponse", + "CreateAPIKeyParams", + "CreateAPIKeyResponse", + "CreateAppParams", + "CreateAppResponse", + "CreateCatalogParams", + "CreateCatalogParamsType", + "CreateCatalogResponse", + "CreateDeviceLoginTicketResponse", + "CreateEnvironmentParams", + "CreateEnvironmentResponse", + "CreateGuestParams", + "CreateGuestResponse", + "CreateSandboxSecretsParams", + "CreateSandboxSecretsResponse", + "CreateScheduleParams", + "CreateScheduleParamsOverlapPolicy", + "CreateScheduleParamsStatus", + "CreateScheduleResponse", + "CreateSecretParams", + "CreateSecretResponse", + "CreateSessionParams", + "CreateSessionResponse", + "CreateTeamParams", + "CreateTeamResponse", + "CreateWebhookParams", + "CreateWebhookResponse", + "DeleteAPIKeyParams", + "DeleteAPIKeyResponse", + "DeleteAppResponse", + "DeleteCatalogResponse", + "DeleteGuestOutputBody", + "DeleteScheduleParams", + "DeleteScheduleResponse", + "DeleteSecretResponse", + "DeleteSessionParams", + "DeleteSessionResponse", + "DeleteTeamInvitationParams", + "DeleteTeamInvitationResponse", + "DeleteTeamParams", + "DeleteTeamResponse", + "DeleteWebhookResponse", + "DeployAppJsonBody", + "DeployAppResponse", + "DescribeAccountBody", + "DescribeAppResponse", + "DescribeAppVersionResponse", + "DescribeAuthenticationContextBody", + "DescribeCatalogResponse", + "DescribeDeviceLoginSessionResponse", + "DescribeEmailPreferencesBody", + "DescribePlanResponse", + "DescribeRunGraphResponse", + "DescribeRunLinks", + "DescribeRunLogsResponse", + "DescribeRunResponse", + "DescribeSecretsKeyResponse", + "DescribeSessionResponse", + "DescribeTeamResponse", + "DescribeWebhookResponse", + "EmailSubscriptions", + "EncryptedCatalogProperty", + "Environment", + "ErrorDetail", + "ErrorModel", + "ExportCatalogsParams", + "ExportCatalogsResponse", + "ExportedCatalog", + "ExportedCatalogProperty", + "ExportedSecret", + "ExportSecretsParams", + "ExportSecretsResponse", + "Feature", + "FeaturebaseIdentity", + "GenerateAppStatisticsResponse", + "GenerateOrganizationUsageTimeSeriesResponse", + "GenerateRunnerCredentialsResponse", + "GenerateRunStatisticsResponse", + "GenerateRunStatisticsStatusItem", + "GetFeatureFlagResponseBody", + "GetFeatureFlagResponseBodyValueType", + "Guest", + "InviteTeamMemberParams", + "InviteTeamMemberParamsRole", + "InviteTeamMemberResponse", + "LeaveTeamResponse", + "ListAlertsResponse", + "ListAPIKeysResponse", + "ListAppEnvironmentsResponse", + "ListAppsFilter", + "ListAppsResponse", + "ListAppsSort", + "ListAppVersionsResponse", + "ListCatalogsResponse", + "ListEnvironmentsResponse", + "ListGuestsResponse", + "ListMyTeamInvitationsResponse", + "ListRunnersResponse", + "ListRunsResponse", + "ListRunsStatusItem", + "ListSchedulesResponse", + "ListSecretEnvironmentsResponse", + "ListSecretsResponse", + "ListTeamInvitationsResponse", + "ListTeamMembersResponse", + "ListTeamsResponse", + "ListWebhooksResponse", + "Organization", + "OrganizationUsage", + "Pagination", + "Parameter", + "Plan", + "RefreshSessionParams", + "RefreshSessionResponse", + "RegenerateGuestLoginURLParams", + "RegenerateGuestLoginURLResponse", + "RemoveTeamMemberParams", + "RemoveTeamMemberResponse", + "ResendTeamInvitationParams", + "ResendTeamInvitationResponse", + "Run", + "RunAppInitiatorData", + "RunAppInitiatorDataType", + "RunAppParams", + "RunAppParamsParameters", + "RunAppResponse", + "RunAttempt", + "RunFailureAlert", + "RunGraphNode", + "RunGraphRunID", + "RunInitiator", + "RunLogLine", + "RunLogLineChannel", + "Runner", + "RunnerCredentials", + "RunParameter", + "RunParameterInput", + "RunResults", + "RunRetryPolicy", + "RunRunInitiatorDetails", + "RunStatistics", + "RunStatus", + "RunStatusGroup", + "RunTimeseriesPoint", + "Schedule", + "ScheduleAppStatus", + "ScheduleOverlapPolicy", + "ScheduleRunInitiatorDetails", + "ScheduleStatus", + "SearchRunsResponse", + "SearchRunsStatusItem", + "Secret", + "Session", + "ShoulderTap", + "SSEWarning", + "StatisticsSettings", + "StatisticsSettingsInterval", + "StreamAlertsEventAlert", + "StreamAlertsEventError", + "StreamRunLogsEventLog", + "StreamRunLogsEventWarning", + "StreamShouldertapsEventShouldertap", + "StreamShouldertapsEventWarning", + "Team", + "TeamInvitation", + "TeamMembership", + "TeamMembershipRole", + "TestWebhookResponse", + "Token", + "UpdateAccountParams", + "UpdateAccountParamsExecutionRegion", + "UpdateAccountResponse", + "UpdateAppEnvironmentParams", + "UpdateAppEnvironmentResponse", + "UpdateAppParams", + "UpdateAppResponse", + "UpdateCatalogParams", + "UpdateCatalogResponse", + "UpdateEmailPreferencesBody", + "UpdateEnvironmentParams", + "UpdateEnvironmentResponse", + "UpdateMyTeamInvitationParams", + "UpdateMyTeamInvitationResponse", + "UpdateOrganizationParams", + "UpdateOrganizationResponse", + "UpdatePlanParams", + "UpdatePlanResponse", + "UpdateScheduleParams", + "UpdateScheduleParamsOverlapPolicy", + "UpdateScheduleParamsStatus", + "UpdateScheduleResponse", + "UpdateSecretParams", + "UpdateSecretResponse", + "UpdateTeamMemberParams", + "UpdateTeamMemberParamsRole", + "UpdateTeamMemberResponse", + "UpdateTeamParams", + "UpdateTeamParamsExecutionRegion", + "UpdateTeamResponse", + "UpdateUserParams", + "UpdateUserResponse", + "UpdateWebhookParams", + "UpdateWebhookResponse", + "UsageLimit", + "UsageMetricTimeSeriesPoint", + "UsageMetricTimeSeriesPointName", + "User", + "Webhook", + "WebhookState", +) diff --git a/src/tower/tower_api_client/models/account.py b/src/tower/tower_api_client/models/account.py new file mode 100644 index 00000000..19efc05b --- /dev/null +++ b/src/tower/tower_api_client/models/account.py @@ -0,0 +1,69 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="Account") + + +@_attrs_define +class Account: + """ + Attributes: + execution_region (str): + is_self_hosted_only (bool): + name (str): + slug (str | Unset): This property is deprecated. Use name instead. + """ + + execution_region: str + is_self_hosted_only: bool + name: str + slug: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + execution_region = self.execution_region + + is_self_hosted_only = self.is_self_hosted_only + + name = self.name + + slug = self.slug + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "execution_region": execution_region, + "is_self_hosted_only": is_self_hosted_only, + "name": name, + } + ) + if slug is not UNSET: + field_dict["slug"] = slug + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + execution_region = d.pop("execution_region") + + is_self_hosted_only = d.pop("is_self_hosted_only") + + name = d.pop("name") + + slug = d.pop("slug", UNSET) + + account = cls( + execution_region=execution_region, + is_self_hosted_only=is_self_hosted_only, + name=name, + slug=slug, + ) + + return account diff --git a/src/tower/tower_api_client/models/acknowledge_alert_response.py b/src/tower/tower_api_client/models/acknowledge_alert_response.py new file mode 100644 index 00000000..c82bc172 --- /dev/null +++ b/src/tower/tower_api_client/models/acknowledge_alert_response.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AcknowledgeAlertResponse") + + +@_attrs_define +class AcknowledgeAlertResponse: + """ + Attributes: + status (str): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/AcknowledgeAlertResponse.json. + """ + + status: str + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + status = self.status + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "status": status, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + status = d.pop("status") + + schema = d.pop("$schema", UNSET) + + acknowledge_alert_response = cls( + status=status, + schema=schema, + ) + + return acknowledge_alert_response diff --git a/src/tower/tower_api_client/models/acknowledge_all_alerts_response.py b/src/tower/tower_api_client/models/acknowledge_all_alerts_response.py new file mode 100644 index 00000000..0a100799 --- /dev/null +++ b/src/tower/tower_api_client/models/acknowledge_all_alerts_response.py @@ -0,0 +1,62 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AcknowledgeAllAlertsResponse") + + +@_attrs_define +class AcknowledgeAllAlertsResponse: + """ + Attributes: + count (int): Number of alerts that were acknowledged + status (str): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/AcknowledgeAllAlertsResponse.json. + """ + + count: int + status: str + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + count = self.count + + status = self.status + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "count": count, + "status": status, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + count = d.pop("count") + + status = d.pop("status") + + schema = d.pop("$schema", UNSET) + + acknowledge_all_alerts_response = cls( + count=count, + status=status, + schema=schema, + ) + + return acknowledge_all_alerts_response diff --git a/src/tower/tower_api_client/models/alert.py b/src/tower/tower_api_client/models/alert.py new file mode 100644 index 00000000..342204ce --- /dev/null +++ b/src/tower/tower_api_client/models/alert.py @@ -0,0 +1,90 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +if TYPE_CHECKING: + from ..models.run_failure_alert import RunFailureAlert + + +T = TypeVar("T", bound="Alert") + + +@_attrs_define +class Alert: + """ + Attributes: + acked (bool): + alert_type (str): + created_at (datetime.datetime): + detail (RunFailureAlert): + seq (int): + status (str): + """ + + acked: bool + alert_type: str + created_at: datetime.datetime + detail: RunFailureAlert + seq: int + status: str + + def to_dict(self) -> dict[str, Any]: + acked = self.acked + + alert_type = self.alert_type + + created_at = self.created_at.isoformat() + + detail = self.detail.to_dict() + + seq = self.seq + + status = self.status + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "acked": acked, + "alert_type": alert_type, + "created_at": created_at, + "detail": detail, + "seq": seq, + "status": status, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.run_failure_alert import RunFailureAlert + + d = dict(src_dict) + acked = d.pop("acked") + + alert_type = d.pop("alert_type") + + created_at = isoparse(d.pop("created_at")) + + detail = RunFailureAlert.from_dict(d.pop("detail")) + + seq = d.pop("seq") + + status = d.pop("status") + + alert = cls( + acked=acked, + alert_type=alert_type, + created_at=created_at, + detail=detail, + seq=seq, + status=status, + ) + + return alert diff --git a/src/tower/tower_api_client/models/api_key.py b/src/tower/tower_api_client/models/api_key.py new file mode 100644 index 00000000..cffbde33 --- /dev/null +++ b/src/tower/tower_api_client/models/api_key.py @@ -0,0 +1,112 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="APIKey") + + +@_attrs_define +class APIKey: + """ + Attributes: + created_at (datetime.datetime): + identifier (str): + last_used_at (datetime.datetime | None): + name (str): + expires_at (datetime.datetime | Unset): + scopes (str | Unset): + """ + + created_at: datetime.datetime + identifier: str + last_used_at: datetime.datetime | None + name: str + expires_at: datetime.datetime | Unset = UNSET + scopes: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + identifier = self.identifier + + last_used_at: None | str + if isinstance(self.last_used_at, datetime.datetime): + last_used_at = self.last_used_at.isoformat() + else: + last_used_at = self.last_used_at + + name = self.name + + expires_at: str | Unset = UNSET + if not isinstance(self.expires_at, Unset): + expires_at = self.expires_at.isoformat() + + scopes = self.scopes + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "created_at": created_at, + "identifier": identifier, + "last_used_at": last_used_at, + "name": name, + } + ) + if expires_at is not UNSET: + field_dict["expires_at"] = expires_at + if scopes is not UNSET: + field_dict["scopes"] = scopes + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + identifier = d.pop("identifier") + + def _parse_last_used_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + last_used_at_type_0 = isoparse(data) + + return last_used_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + last_used_at = _parse_last_used_at(d.pop("last_used_at")) + + name = d.pop("name") + + _expires_at = d.pop("expires_at", UNSET) + expires_at: datetime.datetime | Unset + if isinstance(_expires_at, Unset): + expires_at = UNSET + else: + expires_at = isoparse(_expires_at) + + scopes = d.pop("scopes", UNSET) + + api_key = cls( + created_at=created_at, + identifier=identifier, + last_used_at=last_used_at, + name=name, + expires_at=expires_at, + scopes=scopes, + ) + + return api_key diff --git a/src/tower/tower_api_client/models/app.py b/src/tower/tower_api_client/models/app.py new file mode 100644 index 00000000..73d7656b --- /dev/null +++ b/src/tower/tower_api_client/models/app.py @@ -0,0 +1,251 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.app_health_status import AppHealthStatus +from ..models.app_status import AppStatus +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.run import Run + from ..models.run_results import RunResults + from ..models.run_retry_policy import RunRetryPolicy + + +T = TypeVar("T", bound="App") + + +@_attrs_define +class App: + """ + Attributes: + created_at (datetime.datetime): The date and time this app was created. + health_status (AppHealthStatus): This property is deprecated. It will always be 'healthy'. + is_externally_accessible (bool): + name (str): The name of the app. + next_run_at (datetime.datetime | None): The next time this app will run as part of it's schedule, null if none. + owner (str): The account slug that owns this app. + pending_timeout (int): The maximum time in seconds that a run can stay in the pending state before being marked + as cancelled. Default: 600. + running_timeout (int): The number of seconds that a run can stay running before it gets cancelled. Value of 0 + (default) means no timeout. Default: 0. + schedule (None | str): The schedule associated with this app, null if none. + short_description (str): A short description of the app. Can be empty. + version (None | str): The current version of this app, null if none. + last_run (Run | Unset): + retry_policy (RunRetryPolicy | Unset): + run_results (RunResults | Unset): + slug (str | Unset): This property is deprecated. Use name instead. + status (AppStatus | Unset): The status of the app. + subdomain (str | Unset): The subdomain that this app is accessible via. Must be externally accessible first. + """ + + created_at: datetime.datetime + health_status: AppHealthStatus + is_externally_accessible: bool + name: str + next_run_at: datetime.datetime | None + owner: str + schedule: None | str + short_description: str + version: None | str + pending_timeout: int = 600 + running_timeout: int = 0 + last_run: Run | Unset = UNSET + retry_policy: RunRetryPolicy | Unset = UNSET + run_results: RunResults | Unset = UNSET + slug: str | Unset = UNSET + status: AppStatus | Unset = UNSET + subdomain: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + health_status = self.health_status.value + + is_externally_accessible = self.is_externally_accessible + + name = self.name + + next_run_at: None | str + if isinstance(self.next_run_at, datetime.datetime): + next_run_at = self.next_run_at.isoformat() + else: + next_run_at = self.next_run_at + + owner = self.owner + + pending_timeout = self.pending_timeout + + running_timeout = self.running_timeout + + schedule: None | str + schedule = self.schedule + + short_description = self.short_description + + version: None | str + version = self.version + + last_run: dict[str, Any] | Unset = UNSET + if not isinstance(self.last_run, Unset): + last_run = self.last_run.to_dict() + + retry_policy: dict[str, Any] | Unset = UNSET + if not isinstance(self.retry_policy, Unset): + retry_policy = self.retry_policy.to_dict() + + run_results: dict[str, Any] | Unset = UNSET + if not isinstance(self.run_results, Unset): + run_results = self.run_results.to_dict() + + slug = self.slug + + status: str | Unset = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + subdomain = self.subdomain + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "created_at": created_at, + "health_status": health_status, + "is_externally_accessible": is_externally_accessible, + "name": name, + "next_run_at": next_run_at, + "owner": owner, + "pending_timeout": pending_timeout, + "running_timeout": running_timeout, + "schedule": schedule, + "short_description": short_description, + "version": version, + } + ) + if last_run is not UNSET: + field_dict["last_run"] = last_run + if retry_policy is not UNSET: + field_dict["retry_policy"] = retry_policy + if run_results is not UNSET: + field_dict["run_results"] = run_results + if slug is not UNSET: + field_dict["slug"] = slug + if status is not UNSET: + field_dict["status"] = status + if subdomain is not UNSET: + field_dict["subdomain"] = subdomain + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.run import Run + from ..models.run_results import RunResults + from ..models.run_retry_policy import RunRetryPolicy + + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + health_status = AppHealthStatus(d.pop("health_status")) + + is_externally_accessible = d.pop("is_externally_accessible") + + name = d.pop("name") + + def _parse_next_run_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + next_run_at_type_0 = isoparse(data) + + return next_run_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + next_run_at = _parse_next_run_at(d.pop("next_run_at")) + + owner = d.pop("owner") + + pending_timeout = d.pop("pending_timeout") + + running_timeout = d.pop("running_timeout") + + def _parse_schedule(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + schedule = _parse_schedule(d.pop("schedule")) + + short_description = d.pop("short_description") + + def _parse_version(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + version = _parse_version(d.pop("version")) + + _last_run = d.pop("last_run", UNSET) + last_run: Run | Unset + if isinstance(_last_run, Unset): + last_run = UNSET + else: + last_run = Run.from_dict(_last_run) + + _retry_policy = d.pop("retry_policy", UNSET) + retry_policy: RunRetryPolicy | Unset + if isinstance(_retry_policy, Unset): + retry_policy = UNSET + else: + retry_policy = RunRetryPolicy.from_dict(_retry_policy) + + _run_results = d.pop("run_results", UNSET) + run_results: RunResults | Unset + if isinstance(_run_results, Unset): + run_results = UNSET + else: + run_results = RunResults.from_dict(_run_results) + + slug = d.pop("slug", UNSET) + + _status = d.pop("status", UNSET) + status: AppStatus | Unset + if isinstance(_status, Unset): + status = UNSET + else: + status = AppStatus(_status) + + subdomain = d.pop("subdomain", UNSET) + + app = cls( + created_at=created_at, + health_status=health_status, + is_externally_accessible=is_externally_accessible, + name=name, + next_run_at=next_run_at, + owner=owner, + pending_timeout=pending_timeout, + running_timeout=running_timeout, + schedule=schedule, + short_description=short_description, + version=version, + last_run=last_run, + retry_policy=retry_policy, + run_results=run_results, + slug=slug, + status=status, + subdomain=subdomain, + ) + + return app diff --git a/src/tower/tower_api_client/models/app_health_status.py b/src/tower/tower_api_client/models/app_health_status.py new file mode 100644 index 00000000..d60e33c5 --- /dev/null +++ b/src/tower/tower_api_client/models/app_health_status.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class AppHealthStatus(str, Enum): + HEALTHY = "healthy" + WARNING = "warning" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/app_statistics.py b/src/tower/tower_api_client/models/app_statistics.py new file mode 100644 index 00000000..e8616eb1 --- /dev/null +++ b/src/tower/tower_api_client/models/app_statistics.py @@ -0,0 +1,66 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="AppStatistics") + + +@_attrs_define +class AppStatistics: + """ + Attributes: + all_apps (int): + disabled_apps (int): + healthy_apps (int): + running_apps (int): + """ + + all_apps: int + disabled_apps: int + healthy_apps: int + running_apps: int + + def to_dict(self) -> dict[str, Any]: + all_apps = self.all_apps + + disabled_apps = self.disabled_apps + + healthy_apps = self.healthy_apps + + running_apps = self.running_apps + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "all_apps": all_apps, + "disabled_apps": disabled_apps, + "healthy_apps": healthy_apps, + "running_apps": running_apps, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + all_apps = d.pop("all_apps") + + disabled_apps = d.pop("disabled_apps") + + healthy_apps = d.pop("healthy_apps") + + running_apps = d.pop("running_apps") + + app_statistics = cls( + all_apps=all_apps, + disabled_apps=disabled_apps, + healthy_apps=healthy_apps, + running_apps=running_apps, + ) + + return app_statistics diff --git a/src/tower/tower_api_client/models/app_status.py b/src/tower/tower_api_client/models/app_status.py new file mode 100644 index 00000000..5d249261 --- /dev/null +++ b/src/tower/tower_api_client/models/app_status.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class AppStatus(str, Enum): + ACTIVE = "active" + DISABLED = "disabled" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/app_summary.py b/src/tower/tower_api_client/models/app_summary.py new file mode 100644 index 00000000..61f41257 --- /dev/null +++ b/src/tower/tower_api_client/models/app_summary.py @@ -0,0 +1,66 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +if TYPE_CHECKING: + from ..models.app import App + from ..models.run import Run + + +T = TypeVar("T", bound="AppSummary") + + +@_attrs_define +class AppSummary: + """ + Attributes: + app (App): + runs (list[Run]): + """ + + app: App + runs: list[Run] + + def to_dict(self) -> dict[str, Any]: + app = self.app.to_dict() + + runs = [] + for runs_item_data in self.runs: + runs_item = runs_item_data.to_dict() + runs.append(runs_item) + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "app": app, + "runs": runs, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.app import App + from ..models.run import Run + + d = dict(src_dict) + app = App.from_dict(d.pop("app")) + + runs = [] + _runs = d.pop("runs") + for runs_item_data in _runs: + runs_item = Run.from_dict(runs_item_data) + + runs.append(runs_item) + + app_summary = cls( + app=app, + runs=runs, + ) + + return app_summary diff --git a/src/tower/tower_api_client/models/app_version.py b/src/tower/tower_api_client/models/app_version.py new file mode 100644 index 00000000..376fd435 --- /dev/null +++ b/src/tower/tower_api_client/models/app_version.py @@ -0,0 +1,82 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +if TYPE_CHECKING: + from ..models.parameter import Parameter + + +T = TypeVar("T", bound="AppVersion") + + +@_attrs_define +class AppVersion: + """ + Attributes: + created_at (datetime.datetime): + parameters (list[Parameter]): + towerfile (str): The Towerfile that this version was created from. + version (str): + """ + + created_at: datetime.datetime + parameters: list[Parameter] + towerfile: str + version: str + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + parameters = [] + for parameters_item_data in self.parameters: + parameters_item = parameters_item_data.to_dict() + parameters.append(parameters_item) + + towerfile = self.towerfile + + version = self.version + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "created_at": created_at, + "parameters": parameters, + "towerfile": towerfile, + "version": version, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.parameter import Parameter + + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + parameters = [] + _parameters = d.pop("parameters") + for parameters_item_data in _parameters: + parameters_item = Parameter.from_dict(parameters_item_data) + + parameters.append(parameters_item) + + towerfile = d.pop("towerfile") + + version = d.pop("version") + + app_version = cls( + created_at=created_at, + parameters=parameters, + towerfile=towerfile, + version=version, + ) + + return app_version diff --git a/src/tower/tower_api_client/models/authentication_context.py b/src/tower/tower_api_client/models/authentication_context.py new file mode 100644 index 00000000..6f4f39a7 --- /dev/null +++ b/src/tower/tower_api_client/models/authentication_context.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="AuthenticationContext") + + +@_attrs_define +class AuthenticationContext: + """ + Attributes: + work_os_access_token (str): The WorkOS access token for SSO authentication. + """ + + work_os_access_token: str + + def to_dict(self) -> dict[str, Any]: + work_os_access_token = self.work_os_access_token + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "work_os_access_token": work_os_access_token, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + work_os_access_token = d.pop("work_os_access_token") + + authentication_context = cls( + work_os_access_token=work_os_access_token, + ) + + return authentication_context diff --git a/src/tower/tower_api_client/models/batch_schedule_params.py b/src/tower/tower_api_client/models/batch_schedule_params.py new file mode 100644 index 00000000..b44c46b9 --- /dev/null +++ b/src/tower/tower_api_client/models/batch_schedule_params.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="BatchScheduleParams") + + +@_attrs_define +class BatchScheduleParams: + """ + Attributes: + ids (list[str]): The IDs of the schedules to modify + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/BatchScheduleParams.json. + """ + + ids: list[str] + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + ids = self.ids + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "ids": ids, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + ids = cast(list[str], d.pop("ids")) + + schema = d.pop("$schema", UNSET) + + batch_schedule_params = cls( + ids=ids, + schema=schema, + ) + + return batch_schedule_params diff --git a/src/tower/tower_api_client/models/batch_schedule_response.py b/src/tower/tower_api_client/models/batch_schedule_response.py new file mode 100644 index 00000000..499d5b42 --- /dev/null +++ b/src/tower/tower_api_client/models/batch_schedule_response.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.schedule import Schedule + + +T = TypeVar("T", bound="BatchScheduleResponse") + + +@_attrs_define +class BatchScheduleResponse: + """ + Attributes: + schedules (list[Schedule]): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/BatchScheduleResponse.json. + """ + + schedules: list[Schedule] + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + schedules = [] + for schedules_item_data in self.schedules: + schedules_item = schedules_item_data.to_dict() + schedules.append(schedules_item) + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "schedules": schedules, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.schedule import Schedule + + d = dict(src_dict) + schedules = [] + _schedules = d.pop("schedules") + for schedules_item_data in _schedules: + schedules_item = Schedule.from_dict(schedules_item_data) + + schedules.append(schedules_item) + + schema = d.pop("$schema", UNSET) + + batch_schedule_response = cls( + schedules=schedules, + schema=schema, + ) + + return batch_schedule_response diff --git a/src/tower/tower_api_client/models/cancel_run_response.py b/src/tower/tower_api_client/models/cancel_run_response.py new file mode 100644 index 00000000..c0719a98 --- /dev/null +++ b/src/tower/tower_api_client/models/cancel_run_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.run import Run + + +T = TypeVar("T", bound="CancelRunResponse") + + +@_attrs_define +class CancelRunResponse: + """ + Attributes: + run (Run): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/CancelRunResponse.json. + """ + + run: Run + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + run = self.run.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "run": run, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.run import Run + + d = dict(src_dict) + run = Run.from_dict(d.pop("run")) + + schema = d.pop("$schema", UNSET) + + cancel_run_response = cls( + run=run, + schema=schema, + ) + + return cancel_run_response diff --git a/src/tower/tower_api_client/models/catalog.py b/src/tower/tower_api_client/models/catalog.py new file mode 100644 index 00000000..ab6e6e2d --- /dev/null +++ b/src/tower/tower_api_client/models/catalog.py @@ -0,0 +1,101 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.catalog_property import CatalogProperty + + +T = TypeVar("T", bound="Catalog") + + +@_attrs_define +class Catalog: + """ + Attributes: + created_at (datetime.datetime): + environment (str): + name (str): + properties (list[CatalogProperty]): + type_ (str): + slug (str | Unset): This property is deprecated. Use name instead. + """ + + created_at: datetime.datetime + environment: str + name: str + properties: list[CatalogProperty] + type_: str + slug: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + environment = self.environment + + name = self.name + + properties = [] + for properties_item_data in self.properties: + properties_item = properties_item_data.to_dict() + properties.append(properties_item) + + type_ = self.type_ + + slug = self.slug + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "CreatedAt": created_at, + "environment": environment, + "name": name, + "properties": properties, + "type": type_, + } + ) + if slug is not UNSET: + field_dict["slug"] = slug + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.catalog_property import CatalogProperty + + d = dict(src_dict) + created_at = isoparse(d.pop("CreatedAt")) + + environment = d.pop("environment") + + name = d.pop("name") + + properties = [] + _properties = d.pop("properties") + for properties_item_data in _properties: + properties_item = CatalogProperty.from_dict(properties_item_data) + + properties.append(properties_item) + + type_ = d.pop("type") + + slug = d.pop("slug", UNSET) + + catalog = cls( + created_at=created_at, + environment=environment, + name=name, + properties=properties, + type_=type_, + slug=slug, + ) + + return catalog diff --git a/src/tower/tower_api_client/models/catalog_property.py b/src/tower/tower_api_client/models/catalog_property.py new file mode 100644 index 00000000..e6d33414 --- /dev/null +++ b/src/tower/tower_api_client/models/catalog_property.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CatalogProperty") + + +@_attrs_define +class CatalogProperty: + """ + Attributes: + name (str): + preview (str): + environment_variable (str | Unset): The environment variable name this property is injected as at runtime. + """ + + name: str + preview: str + environment_variable: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + name = self.name + + preview = self.preview + + environment_variable = self.environment_variable + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "name": name, + "preview": preview, + } + ) + if environment_variable is not UNSET: + field_dict["environment_variable"] = environment_variable + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + preview = d.pop("preview") + + environment_variable = d.pop("environment_variable", UNSET) + + catalog_property = cls( + name=name, + preview=preview, + environment_variable=environment_variable, + ) + + return catalog_property diff --git a/src/tower/tower_api_client/models/claim_device_login_ticket_params.py b/src/tower/tower_api_client/models/claim_device_login_ticket_params.py new file mode 100644 index 00000000..8c1be7cb --- /dev/null +++ b/src/tower/tower_api_client/models/claim_device_login_ticket_params.py @@ -0,0 +1,62 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ClaimDeviceLoginTicketParams") + + +@_attrs_define +class ClaimDeviceLoginTicketParams: + """ + Attributes: + refresh_token (str): The refresh token for the session to delegate to the device. + user_code (str): The user code to claim. + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/ClaimDeviceLoginTicketParams.json. + """ + + refresh_token: str + user_code: str + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + refresh_token = self.refresh_token + + user_code = self.user_code + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "refresh_token": refresh_token, + "user_code": user_code, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + refresh_token = d.pop("refresh_token") + + user_code = d.pop("user_code") + + schema = d.pop("$schema", UNSET) + + claim_device_login_ticket_params = cls( + refresh_token=refresh_token, + user_code=user_code, + schema=schema, + ) + + return claim_device_login_ticket_params diff --git a/src/tower/tower_api_client/models/claim_device_login_ticket_response.py b/src/tower/tower_api_client/models/claim_device_login_ticket_response.py new file mode 100644 index 00000000..81e889cc --- /dev/null +++ b/src/tower/tower_api_client/models/claim_device_login_ticket_response.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ClaimDeviceLoginTicketResponse") + + +@_attrs_define +class ClaimDeviceLoginTicketResponse: + """ + Attributes: + claimed (bool): Whether the code was successfully claimed. + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/ClaimDeviceLoginTicketResponse.json. + """ + + claimed: bool + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + claimed = self.claimed + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "claimed": claimed, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + claimed = d.pop("claimed") + + schema = d.pop("$schema", UNSET) + + claim_device_login_ticket_response = cls( + claimed=claimed, + schema=schema, + ) + + return claim_device_login_ticket_response diff --git a/src/tower/tower_api_client/models/create_account_params.py b/src/tower/tower_api_client/models/create_account_params.py new file mode 100644 index 00000000..bbce44bd --- /dev/null +++ b/src/tower/tower_api_client/models/create_account_params.py @@ -0,0 +1,62 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CreateAccountParams") + + +@_attrs_define +class CreateAccountParams: + """ + Attributes: + email (str): + password (str): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/CreateAccountParams.json. + """ + + email: str + password: str + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + email = self.email + + password = self.password + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "email": email, + "password": password, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + email = d.pop("email") + + password = d.pop("password") + + schema = d.pop("$schema", UNSET) + + create_account_params = cls( + email=email, + password=password, + schema=schema, + ) + + return create_account_params diff --git a/src/tower/tower_api_client/models/create_account_params_flags_struct.py b/src/tower/tower_api_client/models/create_account_params_flags_struct.py new file mode 100644 index 00000000..577aef84 --- /dev/null +++ b/src/tower/tower_api_client/models/create_account_params_flags_struct.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="CreateAccountParamsFlagsStruct") + + +@_attrs_define +class CreateAccountParamsFlagsStruct: + """ + Attributes: + is_test_account (bool): + """ + + is_test_account: bool + + def to_dict(self) -> dict[str, Any]: + is_test_account = self.is_test_account + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "is_test_account": is_test_account, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + is_test_account = d.pop("is_test_account") + + create_account_params_flags_struct = cls( + is_test_account=is_test_account, + ) + + return create_account_params_flags_struct diff --git a/src/tower/tower_api_client/models/create_account_response.py b/src/tower/tower_api_client/models/create_account_response.py new file mode 100644 index 00000000..86a66ff0 --- /dev/null +++ b/src/tower/tower_api_client/models/create_account_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.session import Session + + +T = TypeVar("T", bound="CreateAccountResponse") + + +@_attrs_define +class CreateAccountResponse: + """ + Attributes: + session (Session): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/CreateAccountResponse.json. + """ + + session: Session + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + session = self.session.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "session": session, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.session import Session + + d = dict(src_dict) + session = Session.from_dict(d.pop("session")) + + schema = d.pop("$schema", UNSET) + + create_account_response = cls( + session=session, + schema=schema, + ) + + return create_account_response diff --git a/src/tower/tower_api_client/models/create_api_key_params.py b/src/tower/tower_api_client/models/create_api_key_params.py new file mode 100644 index 00000000..f5b36b7e --- /dev/null +++ b/src/tower/tower_api_client/models/create_api_key_params.py @@ -0,0 +1,128 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CreateAPIKeyParams") + + +@_attrs_define +class CreateAPIKeyParams: + """ + Attributes: + name (str): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/CreateAPIKeyParams.json. + expires_at (datetime.datetime | None | Unset): When this API key expires. + scopes (None | str | Unset): Space separated scopes that this API key is valid for. + team (None | str | Unset): The team this API key is associated with. This field is optional. You must be a + member of the team that you're creating the API key for, and if you're using an API key to create a new API key, + the API key you use to authenticate this request must be a personal API key. + """ + + name: str + schema: str | Unset = UNSET + expires_at: datetime.datetime | None | Unset = UNSET + scopes: None | str | Unset = UNSET + team: None | str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + name = self.name + + schema = self.schema + + expires_at: None | str | Unset + if isinstance(self.expires_at, Unset): + expires_at = UNSET + elif isinstance(self.expires_at, datetime.datetime): + expires_at = self.expires_at.isoformat() + else: + expires_at = self.expires_at + + scopes: None | str | Unset + if isinstance(self.scopes, Unset): + scopes = UNSET + else: + scopes = self.scopes + + team: None | str | Unset + if isinstance(self.team, Unset): + team = UNSET + else: + team = self.team + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "name": name, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + if expires_at is not UNSET: + field_dict["expires_at"] = expires_at + if scopes is not UNSET: + field_dict["scopes"] = scopes + if team is not UNSET: + field_dict["team"] = team + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + schema = d.pop("$schema", UNSET) + + def _parse_expires_at(data: object) -> datetime.datetime | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + expires_at_type_0 = isoparse(data) + + return expires_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None | Unset, data) + + expires_at = _parse_expires_at(d.pop("expires_at", UNSET)) + + def _parse_scopes(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + scopes = _parse_scopes(d.pop("scopes", UNSET)) + + def _parse_team(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + team = _parse_team(d.pop("team", UNSET)) + + create_api_key_params = cls( + name=name, + schema=schema, + expires_at=expires_at, + scopes=scopes, + team=team, + ) + + return create_api_key_params diff --git a/src/tower/tower_api_client/models/create_api_key_response.py b/src/tower/tower_api_client/models/create_api_key_response.py new file mode 100644 index 00000000..96a4dd40 --- /dev/null +++ b/src/tower/tower_api_client/models/create_api_key_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.api_key import APIKey + + +T = TypeVar("T", bound="CreateAPIKeyResponse") + + +@_attrs_define +class CreateAPIKeyResponse: + """ + Attributes: + api_key (APIKey): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/CreateAPIKeyResponse.json. + """ + + api_key: APIKey + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + api_key = self.api_key.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "api_key": api_key, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.api_key import APIKey + + d = dict(src_dict) + api_key = APIKey.from_dict(d.pop("api_key")) + + schema = d.pop("$schema", UNSET) + + create_api_key_response = cls( + api_key=api_key, + schema=schema, + ) + + return create_api_key_response diff --git a/src/tower/tower_api_client/models/create_app_params.py b/src/tower/tower_api_client/models/create_app_params.py new file mode 100644 index 00000000..a558bd73 --- /dev/null +++ b/src/tower/tower_api_client/models/create_app_params.py @@ -0,0 +1,103 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CreateAppParams") + + +@_attrs_define +class CreateAppParams: + """ + Attributes: + name (str): The name of the app. + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/CreateAppParams.json. + is_externally_accessible (bool | Unset): Indicates that web traffic should be routed to this app and that its + runs should get a hostname assigned to it. Default: False. + short_description (str | Unset): A description of the app. + slug (str | Unset): The slug of the app. Legacy CLI will send it but we don't need it. + subdomain (None | str | Unset): The subdomain this app is accessible under. Requires is_externally_accessible to + be true. + """ + + name: str + schema: str | Unset = UNSET + is_externally_accessible: bool | Unset = False + short_description: str | Unset = UNSET + slug: str | Unset = UNSET + subdomain: None | str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + name = self.name + + schema = self.schema + + is_externally_accessible = self.is_externally_accessible + + short_description = self.short_description + + slug = self.slug + + subdomain: None | str | Unset + if isinstance(self.subdomain, Unset): + subdomain = UNSET + else: + subdomain = self.subdomain + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "name": name, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + if is_externally_accessible is not UNSET: + field_dict["is_externally_accessible"] = is_externally_accessible + if short_description is not UNSET: + field_dict["short_description"] = short_description + if slug is not UNSET: + field_dict["slug"] = slug + if subdomain is not UNSET: + field_dict["subdomain"] = subdomain + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + schema = d.pop("$schema", UNSET) + + is_externally_accessible = d.pop("is_externally_accessible", UNSET) + + short_description = d.pop("short_description", UNSET) + + slug = d.pop("slug", UNSET) + + def _parse_subdomain(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + subdomain = _parse_subdomain(d.pop("subdomain", UNSET)) + + create_app_params = cls( + name=name, + schema=schema, + is_externally_accessible=is_externally_accessible, + short_description=short_description, + slug=slug, + subdomain=subdomain, + ) + + return create_app_params diff --git a/src/tower/tower_api_client/models/create_app_response.py b/src/tower/tower_api_client/models/create_app_response.py new file mode 100644 index 00000000..eb0dd5f1 --- /dev/null +++ b/src/tower/tower_api_client/models/create_app_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.app import App + + +T = TypeVar("T", bound="CreateAppResponse") + + +@_attrs_define +class CreateAppResponse: + """ + Attributes: + app (App): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/CreateAppResponse.json. + """ + + app: App + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + app = self.app.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "app": app, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.app import App + + d = dict(src_dict) + app = App.from_dict(d.pop("app")) + + schema = d.pop("$schema", UNSET) + + create_app_response = cls( + app=app, + schema=schema, + ) + + return create_app_response diff --git a/src/tower/tower_api_client/models/create_catalog_params.py b/src/tower/tower_api_client/models/create_catalog_params.py new file mode 100644 index 00000000..c0c202ae --- /dev/null +++ b/src/tower/tower_api_client/models/create_catalog_params.py @@ -0,0 +1,93 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.create_catalog_params_type import CreateCatalogParamsType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.encrypted_catalog_property import EncryptedCatalogProperty + + +T = TypeVar("T", bound="CreateCatalogParams") + + +@_attrs_define +class CreateCatalogParams: + """ + Attributes: + environment (str): + name (str): + properties (list[EncryptedCatalogProperty]): + type_ (CreateCatalogParamsType): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/CreateCatalogParams.json. + """ + + environment: str + name: str + properties: list[EncryptedCatalogProperty] + type_: CreateCatalogParamsType + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + environment = self.environment + + name = self.name + + properties = [] + for properties_item_data in self.properties: + properties_item = properties_item_data.to_dict() + properties.append(properties_item) + + type_ = self.type_.value + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "environment": environment, + "name": name, + "properties": properties, + "type": type_, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.encrypted_catalog_property import EncryptedCatalogProperty + + d = dict(src_dict) + environment = d.pop("environment") + + name = d.pop("name") + + properties = [] + _properties = d.pop("properties") + for properties_item_data in _properties: + properties_item = EncryptedCatalogProperty.from_dict(properties_item_data) + + properties.append(properties_item) + + type_ = CreateCatalogParamsType(d.pop("type")) + + schema = d.pop("$schema", UNSET) + + create_catalog_params = cls( + environment=environment, + name=name, + properties=properties, + type_=type_, + schema=schema, + ) + + return create_catalog_params diff --git a/src/tower/tower_api_client/models/create_catalog_params_type.py b/src/tower/tower_api_client/models/create_catalog_params_type.py new file mode 100644 index 00000000..342cdc2a --- /dev/null +++ b/src/tower/tower_api_client/models/create_catalog_params_type.py @@ -0,0 +1,13 @@ +from enum import Enum + + +class CreateCatalogParamsType(str, Enum): + APACHE_POLARIS = "apache-polaris" + CLOUDFLARE_R2_CATALOG = "cloudflare-r2-catalog" + LAKEKEEPER = "lakekeeper" + S3_TABLES = "s3-tables" + SNOWFLAKE_OPEN_CATALOG = "snowflake-open-catalog" + TOWER_CATALOG = "tower-catalog" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/create_catalog_response.py b/src/tower/tower_api_client/models/create_catalog_response.py new file mode 100644 index 00000000..50333b9c --- /dev/null +++ b/src/tower/tower_api_client/models/create_catalog_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.catalog import Catalog + + +T = TypeVar("T", bound="CreateCatalogResponse") + + +@_attrs_define +class CreateCatalogResponse: + """ + Attributes: + catalog (Catalog): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/CreateCatalogResponse.json. + """ + + catalog: Catalog + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + catalog = self.catalog.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "catalog": catalog, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.catalog import Catalog + + d = dict(src_dict) + catalog = Catalog.from_dict(d.pop("catalog")) + + schema = d.pop("$schema", UNSET) + + create_catalog_response = cls( + catalog=catalog, + schema=schema, + ) + + return create_catalog_response diff --git a/src/tower/tower_api_client/models/create_device_login_ticket_response.py b/src/tower/tower_api_client/models/create_device_login_ticket_response.py new file mode 100644 index 00000000..945593bc --- /dev/null +++ b/src/tower/tower_api_client/models/create_device_login_ticket_response.py @@ -0,0 +1,104 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CreateDeviceLoginTicketResponse") + + +@_attrs_define +class CreateDeviceLoginTicketResponse: + """ + Attributes: + device_code (str): The unique code identifying this device login request. + expires_in (int): Number of seconds until this request expires. + generated_at (datetime.datetime): When this device login request was created. + interval (int): Number of seconds to wait between polling attempts. + login_url (str): The URL where the user should go to enter the user code. + user_code (str): The code that the user needs to enter to authenticate. + verification_url (str): The URL that the device should poll to check authentication status. + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/CreateDeviceLoginTicketResponse.json. + """ + + device_code: str + expires_in: int + generated_at: datetime.datetime + interval: int + login_url: str + user_code: str + verification_url: str + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + device_code = self.device_code + + expires_in = self.expires_in + + generated_at = self.generated_at.isoformat() + + interval = self.interval + + login_url = self.login_url + + user_code = self.user_code + + verification_url = self.verification_url + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "device_code": device_code, + "expires_in": expires_in, + "generated_at": generated_at, + "interval": interval, + "login_url": login_url, + "user_code": user_code, + "verification_url": verification_url, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + device_code = d.pop("device_code") + + expires_in = d.pop("expires_in") + + generated_at = isoparse(d.pop("generated_at")) + + interval = d.pop("interval") + + login_url = d.pop("login_url") + + user_code = d.pop("user_code") + + verification_url = d.pop("verification_url") + + schema = d.pop("$schema", UNSET) + + create_device_login_ticket_response = cls( + device_code=device_code, + expires_in=expires_in, + generated_at=generated_at, + interval=interval, + login_url=login_url, + user_code=user_code, + verification_url=verification_url, + schema=schema, + ) + + return create_device_login_ticket_response diff --git a/src/tower/tower_api_client/models/create_environment_params.py b/src/tower/tower_api_client/models/create_environment_params.py new file mode 100644 index 00000000..7b8d9e80 --- /dev/null +++ b/src/tower/tower_api_client/models/create_environment_params.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CreateEnvironmentParams") + + +@_attrs_define +class CreateEnvironmentParams: + """ + Attributes: + name (str): The name of the environment + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/CreateEnvironmentParams.json. + """ + + name: str + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + name = self.name + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "name": name, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + schema = d.pop("$schema", UNSET) + + create_environment_params = cls( + name=name, + schema=schema, + ) + + return create_environment_params diff --git a/src/tower/tower_api_client/models/create_environment_response.py b/src/tower/tower_api_client/models/create_environment_response.py new file mode 100644 index 00000000..50cd8e95 --- /dev/null +++ b/src/tower/tower_api_client/models/create_environment_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.environment import Environment + + +T = TypeVar("T", bound="CreateEnvironmentResponse") + + +@_attrs_define +class CreateEnvironmentResponse: + """ + Attributes: + environment (Environment): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/CreateEnvironmentResponse.json. + """ + + environment: Environment + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + environment = self.environment.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "environment": environment, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.environment import Environment + + d = dict(src_dict) + environment = Environment.from_dict(d.pop("environment")) + + schema = d.pop("$schema", UNSET) + + create_environment_response = cls( + environment=environment, + schema=schema, + ) + + return create_environment_response diff --git a/src/tower/tower_api_client/models/create_guest_params.py b/src/tower/tower_api_client/models/create_guest_params.py new file mode 100644 index 00000000..1defe854 --- /dev/null +++ b/src/tower/tower_api_client/models/create_guest_params.py @@ -0,0 +1,82 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CreateGuestParams") + + +@_attrs_define +class CreateGuestParams: + """ + Attributes: + app (str): The name of the externally accessible app this guest can access. + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/CreateGuestParams.json. + expires_in (int | Unset): The number of seconds the guest session should last. Defaults to 72 hours. Default: + 259200. + name (str | Unset): Optional display name for the guest. + redirect_url (str | Unset): Where to redirect the guest after they log in. Defaults to the app's subdomain. + """ + + app: str + schema: str | Unset = UNSET + expires_in: int | Unset = 259200 + name: str | Unset = UNSET + redirect_url: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + app = self.app + + schema = self.schema + + expires_in = self.expires_in + + name = self.name + + redirect_url = self.redirect_url + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "app": app, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + if expires_in is not UNSET: + field_dict["expires_in"] = expires_in + if name is not UNSET: + field_dict["name"] = name + if redirect_url is not UNSET: + field_dict["redirect_url"] = redirect_url + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + app = d.pop("app") + + schema = d.pop("$schema", UNSET) + + expires_in = d.pop("expires_in", UNSET) + + name = d.pop("name", UNSET) + + redirect_url = d.pop("redirect_url", UNSET) + + create_guest_params = cls( + app=app, + schema=schema, + expires_in=expires_in, + name=name, + redirect_url=redirect_url, + ) + + return create_guest_params diff --git a/src/tower/tower_api_client/models/create_guest_response.py b/src/tower/tower_api_client/models/create_guest_response.py new file mode 100644 index 00000000..bf1ad5de --- /dev/null +++ b/src/tower/tower_api_client/models/create_guest_response.py @@ -0,0 +1,78 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.guest import Guest + + +T = TypeVar("T", bound="CreateGuestResponse") + + +@_attrs_define +class CreateGuestResponse: + """ + Attributes: + guest (Guest): + login_url (str): The URL to share with the guest for logging in. + login_url_expires_at (datetime.datetime): When the login URL expires. + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/CreateGuestResponse.json. + """ + + guest: Guest + login_url: str + login_url_expires_at: datetime.datetime + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + guest = self.guest.to_dict() + + login_url = self.login_url + + login_url_expires_at = self.login_url_expires_at.isoformat() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "guest": guest, + "login_url": login_url, + "login_url_expires_at": login_url_expires_at, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.guest import Guest + + d = dict(src_dict) + guest = Guest.from_dict(d.pop("guest")) + + login_url = d.pop("login_url") + + login_url_expires_at = isoparse(d.pop("login_url_expires_at")) + + schema = d.pop("$schema", UNSET) + + create_guest_response = cls( + guest=guest, + login_url=login_url, + login_url_expires_at=login_url_expires_at, + schema=schema, + ) + + return create_guest_response diff --git a/src/tower/tower_api_client/models/create_sandbox_secrets_params.py b/src/tower/tower_api_client/models/create_sandbox_secrets_params.py new file mode 100644 index 00000000..59fbb62b --- /dev/null +++ b/src/tower/tower_api_client/models/create_sandbox_secrets_params.py @@ -0,0 +1,62 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CreateSandboxSecretsParams") + + +@_attrs_define +class CreateSandboxSecretsParams: + """ + Attributes: + environment (str): Environment to create secrets in + secret_keys (list[str]): List of secret keys to create with Tower defaults + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/CreateSandboxSecretsParams.json. + """ + + environment: str + secret_keys: list[str] + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + environment = self.environment + + secret_keys = self.secret_keys + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "environment": environment, + "secret_keys": secret_keys, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + environment = d.pop("environment") + + secret_keys = cast(list[str], d.pop("secret_keys")) + + schema = d.pop("$schema", UNSET) + + create_sandbox_secrets_params = cls( + environment=environment, + secret_keys=secret_keys, + schema=schema, + ) + + return create_sandbox_secrets_params diff --git a/src/tower/tower_api_client/models/create_sandbox_secrets_response.py b/src/tower/tower_api_client/models/create_sandbox_secrets_response.py new file mode 100644 index 00000000..09e0be98 --- /dev/null +++ b/src/tower/tower_api_client/models/create_sandbox_secrets_response.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CreateSandboxSecretsResponse") + + +@_attrs_define +class CreateSandboxSecretsResponse: + """ + Attributes: + created (list[str]): List of secret keys that were created + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/CreateSandboxSecretsResponse.json. + """ + + created: list[str] + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + created = self.created + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "created": created, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + created = cast(list[str], d.pop("created")) + + schema = d.pop("$schema", UNSET) + + create_sandbox_secrets_response = cls( + created=created, + schema=schema, + ) + + return create_sandbox_secrets_response diff --git a/src/tower/tower_api_client/models/create_schedule_params.py b/src/tower/tower_api_client/models/create_schedule_params.py new file mode 100644 index 00000000..adfbb2c8 --- /dev/null +++ b/src/tower/tower_api_client/models/create_schedule_params.py @@ -0,0 +1,200 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..models.create_schedule_params_overlap_policy import ( + CreateScheduleParamsOverlapPolicy, +) +from ..models.create_schedule_params_status import CreateScheduleParamsStatus +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.run_parameter_input import RunParameterInput + + +T = TypeVar("T", bound="CreateScheduleParams") + + +@_attrs_define +class CreateScheduleParams: + """ + Attributes: + app_name (str): The name of the app to create a schedule for + cron (str): The cron expression defining when the app should run + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/CreateScheduleParams.json. + app_version (None | str | Unset): This property is deprecated and ignored. Schedules inherit the version from + their environment. + environment (str | Unset): The environment to run the app in Default: 'default'. + name (None | str | Unset): The name for this schedule. Must be unique per environment. If not set, one will be + generated for you. + overlap_policy (CreateScheduleParamsOverlapPolicy | Unset): The overlap policy for the schedule Default: + CreateScheduleParamsOverlapPolicy.ALLOW. + parameters (list[RunParameterInput] | Unset): Parameters to pass when running the app + status (CreateScheduleParamsStatus | Unset): The status of the schedule (defaults to active) + timezone (None | str | Unset): The IANA timezone identifier that the cron expression should be evaluated in + (e.g., 'America/New_York', 'Europe/London'). Defaults to 'UTC'. Default: 'UTC'. + """ + + app_name: str + cron: str + schema: str | Unset = UNSET + app_version: None | str | Unset = UNSET + environment: str | Unset = "default" + name: None | str | Unset = UNSET + overlap_policy: CreateScheduleParamsOverlapPolicy | Unset = ( + CreateScheduleParamsOverlapPolicy.ALLOW + ) + parameters: list[RunParameterInput] | Unset = UNSET + status: CreateScheduleParamsStatus | Unset = UNSET + timezone: None | str | Unset = "UTC" + + def to_dict(self) -> dict[str, Any]: + app_name = self.app_name + + cron = self.cron + + schema = self.schema + + app_version: None | str | Unset + if isinstance(self.app_version, Unset): + app_version = UNSET + else: + app_version = self.app_version + + environment = self.environment + + name: None | str | Unset + if isinstance(self.name, Unset): + name = UNSET + else: + name = self.name + + overlap_policy: str | Unset = UNSET + if not isinstance(self.overlap_policy, Unset): + overlap_policy = self.overlap_policy.value + + parameters: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.parameters, Unset): + parameters = [] + for parameters_item_data in self.parameters: + parameters_item = parameters_item_data.to_dict() + parameters.append(parameters_item) + + status: str | Unset = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + timezone: None | str | Unset + if isinstance(self.timezone, Unset): + timezone = UNSET + else: + timezone = self.timezone + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "app_name": app_name, + "cron": cron, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + if app_version is not UNSET: + field_dict["app_version"] = app_version + if environment is not UNSET: + field_dict["environment"] = environment + if name is not UNSET: + field_dict["name"] = name + if overlap_policy is not UNSET: + field_dict["overlap_policy"] = overlap_policy + if parameters is not UNSET: + field_dict["parameters"] = parameters + if status is not UNSET: + field_dict["status"] = status + if timezone is not UNSET: + field_dict["timezone"] = timezone + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.run_parameter_input import RunParameterInput + + d = dict(src_dict) + app_name = d.pop("app_name") + + cron = d.pop("cron") + + schema = d.pop("$schema", UNSET) + + def _parse_app_version(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + app_version = _parse_app_version(d.pop("app_version", UNSET)) + + environment = d.pop("environment", UNSET) + + def _parse_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + name = _parse_name(d.pop("name", UNSET)) + + _overlap_policy = d.pop("overlap_policy", UNSET) + overlap_policy: CreateScheduleParamsOverlapPolicy | Unset + if isinstance(_overlap_policy, Unset): + overlap_policy = UNSET + else: + overlap_policy = CreateScheduleParamsOverlapPolicy(_overlap_policy) + + _parameters = d.pop("parameters", UNSET) + parameters: list[RunParameterInput] | Unset = UNSET + if _parameters is not UNSET: + parameters = [] + for parameters_item_data in _parameters: + parameters_item = RunParameterInput.from_dict(parameters_item_data) + + parameters.append(parameters_item) + + _status = d.pop("status", UNSET) + status: CreateScheduleParamsStatus | Unset + if isinstance(_status, Unset): + status = UNSET + else: + status = CreateScheduleParamsStatus(_status) + + def _parse_timezone(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + timezone = _parse_timezone(d.pop("timezone", UNSET)) + + create_schedule_params = cls( + app_name=app_name, + cron=cron, + schema=schema, + app_version=app_version, + environment=environment, + name=name, + overlap_policy=overlap_policy, + parameters=parameters, + status=status, + timezone=timezone, + ) + + return create_schedule_params diff --git a/src/tower/tower_api_client/models/create_schedule_params_overlap_policy.py b/src/tower/tower_api_client/models/create_schedule_params_overlap_policy.py new file mode 100644 index 00000000..0c9a20db --- /dev/null +++ b/src/tower/tower_api_client/models/create_schedule_params_overlap_policy.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class CreateScheduleParamsOverlapPolicy(str, Enum): + ALLOW = "allow" + SKIP = "skip" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/create_schedule_params_status.py b/src/tower/tower_api_client/models/create_schedule_params_status.py new file mode 100644 index 00000000..e86cf62a --- /dev/null +++ b/src/tower/tower_api_client/models/create_schedule_params_status.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class CreateScheduleParamsStatus(str, Enum): + ACTIVE = "active" + DISABLED = "disabled" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/create_schedule_response.py b/src/tower/tower_api_client/models/create_schedule_response.py new file mode 100644 index 00000000..98128d9f --- /dev/null +++ b/src/tower/tower_api_client/models/create_schedule_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.schedule import Schedule + + +T = TypeVar("T", bound="CreateScheduleResponse") + + +@_attrs_define +class CreateScheduleResponse: + """ + Attributes: + schedule (Schedule): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/CreateScheduleResponse.json. + """ + + schedule: Schedule + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + schedule = self.schedule.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "schedule": schedule, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.schedule import Schedule + + d = dict(src_dict) + schedule = Schedule.from_dict(d.pop("schedule")) + + schema = d.pop("$schema", UNSET) + + create_schedule_response = cls( + schedule=schedule, + schema=schema, + ) + + return create_schedule_response diff --git a/src/tower/tower_api_client/models/create_secret_params.py b/src/tower/tower_api_client/models/create_secret_params.py new file mode 100644 index 00000000..a89e0179 --- /dev/null +++ b/src/tower/tower_api_client/models/create_secret_params.py @@ -0,0 +1,78 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CreateSecretParams") + + +@_attrs_define +class CreateSecretParams: + """ + Attributes: + encrypted_value (str): + environment (str): + name (str): + preview (str): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/CreateSecretParams.json. + """ + + encrypted_value: str + environment: str + name: str + preview: str + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + encrypted_value = self.encrypted_value + + environment = self.environment + + name = self.name + + preview = self.preview + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "encrypted_value": encrypted_value, + "environment": environment, + "name": name, + "preview": preview, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + encrypted_value = d.pop("encrypted_value") + + environment = d.pop("environment") + + name = d.pop("name") + + preview = d.pop("preview") + + schema = d.pop("$schema", UNSET) + + create_secret_params = cls( + encrypted_value=encrypted_value, + environment=environment, + name=name, + preview=preview, + schema=schema, + ) + + return create_secret_params diff --git a/src/tower/tower_api_client/models/create_secret_response.py b/src/tower/tower_api_client/models/create_secret_response.py new file mode 100644 index 00000000..9f8585c3 --- /dev/null +++ b/src/tower/tower_api_client/models/create_secret_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.secret import Secret + + +T = TypeVar("T", bound="CreateSecretResponse") + + +@_attrs_define +class CreateSecretResponse: + """ + Attributes: + secret (Secret): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/CreateSecretResponse.json. + """ + + secret: Secret + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + secret = self.secret.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "secret": secret, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.secret import Secret + + d = dict(src_dict) + secret = Secret.from_dict(d.pop("secret")) + + schema = d.pop("$schema", UNSET) + + create_secret_response = cls( + secret=secret, + schema=schema, + ) + + return create_secret_response diff --git a/src/tower/tower_api_client/models/create_session_params.py b/src/tower/tower_api_client/models/create_session_params.py new file mode 100644 index 00000000..9840a580 --- /dev/null +++ b/src/tower/tower_api_client/models/create_session_params.py @@ -0,0 +1,72 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CreateSessionParams") + + +@_attrs_define +class CreateSessionParams: + """ + Attributes: + password (str): + username (str): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/CreateSessionParams.json. + code (str | Unset): One-time password verification code for two-factor authentication. If the user has two- + factor authentication enabled, this code is required to log in. + """ + + password: str + username: str + schema: str | Unset = UNSET + code: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + password = self.password + + username = self.username + + schema = self.schema + + code = self.code + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "password": password, + "username": username, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + if code is not UNSET: + field_dict["code"] = code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + password = d.pop("password") + + username = d.pop("username") + + schema = d.pop("$schema", UNSET) + + code = d.pop("code", UNSET) + + create_session_params = cls( + password=password, + username=username, + schema=schema, + code=code, + ) + + return create_session_params diff --git a/src/tower/tower_api_client/models/create_session_response.py b/src/tower/tower_api_client/models/create_session_response.py new file mode 100644 index 00000000..cafe99e0 --- /dev/null +++ b/src/tower/tower_api_client/models/create_session_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.session import Session + + +T = TypeVar("T", bound="CreateSessionResponse") + + +@_attrs_define +class CreateSessionResponse: + """ + Attributes: + session (Session): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/CreateSessionResponse.json. + """ + + session: Session + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + session = self.session.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "session": session, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.session import Session + + d = dict(src_dict) + session = Session.from_dict(d.pop("session")) + + schema = d.pop("$schema", UNSET) + + create_session_response = cls( + session=session, + schema=schema, + ) + + return create_session_response diff --git a/src/tower/tower_api_client/models/create_team_params.py b/src/tower/tower_api_client/models/create_team_params.py new file mode 100644 index 00000000..21379b65 --- /dev/null +++ b/src/tower/tower_api_client/models/create_team_params.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CreateTeamParams") + + +@_attrs_define +class CreateTeamParams: + """ + Attributes: + name (str): The name of the team to create + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/CreateTeamParams.json. + """ + + name: str + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + name = self.name + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "name": name, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + schema = d.pop("$schema", UNSET) + + create_team_params = cls( + name=name, + schema=schema, + ) + + return create_team_params diff --git a/src/tower/tower_api_client/models/create_team_response.py b/src/tower/tower_api_client/models/create_team_response.py new file mode 100644 index 00000000..342f3f44 --- /dev/null +++ b/src/tower/tower_api_client/models/create_team_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.team import Team + + +T = TypeVar("T", bound="CreateTeamResponse") + + +@_attrs_define +class CreateTeamResponse: + """ + Attributes: + team (Team): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/CreateTeamResponse.json. + """ + + team: Team + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + team = self.team.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "team": team, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.team import Team + + d = dict(src_dict) + team = Team.from_dict(d.pop("team")) + + schema = d.pop("$schema", UNSET) + + create_team_response = cls( + team=team, + schema=schema, + ) + + return create_team_response diff --git a/src/tower/tower_api_client/models/create_webhook_params.py b/src/tower/tower_api_client/models/create_webhook_params.py new file mode 100644 index 00000000..bb009453 --- /dev/null +++ b/src/tower/tower_api_client/models/create_webhook_params.py @@ -0,0 +1,62 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CreateWebhookParams") + + +@_attrs_define +class CreateWebhookParams: + """ + Attributes: + name (str): The name of the webhook. + url (str): The webhook URL. + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/CreateWebhookParams.json. + """ + + name: str + url: str + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + name = self.name + + url = self.url + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "name": name, + "url": url, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + url = d.pop("url") + + schema = d.pop("$schema", UNSET) + + create_webhook_params = cls( + name=name, + url=url, + schema=schema, + ) + + return create_webhook_params diff --git a/src/tower/tower_api_client/models/create_webhook_response.py b/src/tower/tower_api_client/models/create_webhook_response.py new file mode 100644 index 00000000..1155a59e --- /dev/null +++ b/src/tower/tower_api_client/models/create_webhook_response.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.webhook import Webhook + + +T = TypeVar("T", bound="CreateWebhookResponse") + + +@_attrs_define +class CreateWebhookResponse: + """ + Attributes: + signing_key (str): + webhook (Webhook): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/CreateWebhookResponse.json. + """ + + signing_key: str + webhook: Webhook + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + signing_key = self.signing_key + + webhook = self.webhook.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "signing_key": signing_key, + "webhook": webhook, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.webhook import Webhook + + d = dict(src_dict) + signing_key = d.pop("signing_key") + + webhook = Webhook.from_dict(d.pop("webhook")) + + schema = d.pop("$schema", UNSET) + + create_webhook_response = cls( + signing_key=signing_key, + webhook=webhook, + schema=schema, + ) + + return create_webhook_response diff --git a/src/tower/tower_api_client/models/delete_api_key_params.py b/src/tower/tower_api_client/models/delete_api_key_params.py new file mode 100644 index 00000000..bb18e86b --- /dev/null +++ b/src/tower/tower_api_client/models/delete_api_key_params.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DeleteAPIKeyParams") + + +@_attrs_define +class DeleteAPIKeyParams: + """ + Attributes: + identifier (str): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DeleteAPIKeyParams.json. + """ + + identifier: str + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + identifier = self.identifier + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "identifier": identifier, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + identifier = d.pop("identifier") + + schema = d.pop("$schema", UNSET) + + delete_api_key_params = cls( + identifier=identifier, + schema=schema, + ) + + return delete_api_key_params diff --git a/src/tower/tower_api_client/models/delete_api_key_response.py b/src/tower/tower_api_client/models/delete_api_key_response.py new file mode 100644 index 00000000..5d126a1b --- /dev/null +++ b/src/tower/tower_api_client/models/delete_api_key_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.api_key import APIKey + + +T = TypeVar("T", bound="DeleteAPIKeyResponse") + + +@_attrs_define +class DeleteAPIKeyResponse: + """ + Attributes: + api_key (APIKey): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DeleteAPIKeyResponse.json. + """ + + api_key: APIKey + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + api_key = self.api_key.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "api_key": api_key, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.api_key import APIKey + + d = dict(src_dict) + api_key = APIKey.from_dict(d.pop("api_key")) + + schema = d.pop("$schema", UNSET) + + delete_api_key_response = cls( + api_key=api_key, + schema=schema, + ) + + return delete_api_key_response diff --git a/src/tower/tower_api_client/models/delete_app_response.py b/src/tower/tower_api_client/models/delete_app_response.py new file mode 100644 index 00000000..afbcc3bb --- /dev/null +++ b/src/tower/tower_api_client/models/delete_app_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.app import App + + +T = TypeVar("T", bound="DeleteAppResponse") + + +@_attrs_define +class DeleteAppResponse: + """ + Attributes: + app (App): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DeleteAppResponse.json. + """ + + app: App + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + app = self.app.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "app": app, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.app import App + + d = dict(src_dict) + app = App.from_dict(d.pop("app")) + + schema = d.pop("$schema", UNSET) + + delete_app_response = cls( + app=app, + schema=schema, + ) + + return delete_app_response diff --git a/src/tower/tower_api_client/models/delete_catalog_response.py b/src/tower/tower_api_client/models/delete_catalog_response.py new file mode 100644 index 00000000..86841b07 --- /dev/null +++ b/src/tower/tower_api_client/models/delete_catalog_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.catalog import Catalog + + +T = TypeVar("T", bound="DeleteCatalogResponse") + + +@_attrs_define +class DeleteCatalogResponse: + """ + Attributes: + catalog (Catalog): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DeleteCatalogResponse.json. + """ + + catalog: Catalog + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + catalog = self.catalog.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "catalog": catalog, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.catalog import Catalog + + d = dict(src_dict) + catalog = Catalog.from_dict(d.pop("catalog")) + + schema = d.pop("$schema", UNSET) + + delete_catalog_response = cls( + catalog=catalog, + schema=schema, + ) + + return delete_catalog_response diff --git a/src/tower/tower_api_client/models/delete_guest_output_body.py b/src/tower/tower_api_client/models/delete_guest_output_body.py new file mode 100644 index 00000000..75b6a344 --- /dev/null +++ b/src/tower/tower_api_client/models/delete_guest_output_body.py @@ -0,0 +1,43 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DeleteGuestOutputBody") + + +@_attrs_define +class DeleteGuestOutputBody: + """ + Attributes: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DeleteGuestOutputBody.json. + """ + + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + schema = d.pop("$schema", UNSET) + + delete_guest_output_body = cls( + schema=schema, + ) + + return delete_guest_output_body diff --git a/src/tower/tower_api_client/models/delete_schedule_params.py b/src/tower/tower_api_client/models/delete_schedule_params.py new file mode 100644 index 00000000..63ebb8fe --- /dev/null +++ b/src/tower/tower_api_client/models/delete_schedule_params.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DeleteScheduleParams") + + +@_attrs_define +class DeleteScheduleParams: + """ + Attributes: + ids (list[str]): The IDs of the schedules to delete. + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DeleteScheduleParams.json. + """ + + ids: list[str] + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + ids = self.ids + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "ids": ids, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + ids = cast(list[str], d.pop("ids")) + + schema = d.pop("$schema", UNSET) + + delete_schedule_params = cls( + ids=ids, + schema=schema, + ) + + return delete_schedule_params diff --git a/src/tower/tower_api_client/models/delete_schedule_response.py b/src/tower/tower_api_client/models/delete_schedule_response.py new file mode 100644 index 00000000..c584a75b --- /dev/null +++ b/src/tower/tower_api_client/models/delete_schedule_response.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.schedule import Schedule + + +T = TypeVar("T", bound="DeleteScheduleResponse") + + +@_attrs_define +class DeleteScheduleResponse: + """ + Attributes: + schedules (list[Schedule]): the schedules successfully deleted + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DeleteScheduleResponse.json. + """ + + schedules: list[Schedule] + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + schedules = [] + for schedules_item_data in self.schedules: + schedules_item = schedules_item_data.to_dict() + schedules.append(schedules_item) + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "schedules": schedules, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.schedule import Schedule + + d = dict(src_dict) + schedules = [] + _schedules = d.pop("schedules") + for schedules_item_data in _schedules: + schedules_item = Schedule.from_dict(schedules_item_data) + + schedules.append(schedules_item) + + schema = d.pop("$schema", UNSET) + + delete_schedule_response = cls( + schedules=schedules, + schema=schema, + ) + + return delete_schedule_response diff --git a/src/tower/tower_api_client/models/delete_secret_response.py b/src/tower/tower_api_client/models/delete_secret_response.py new file mode 100644 index 00000000..035235ef --- /dev/null +++ b/src/tower/tower_api_client/models/delete_secret_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.secret import Secret + + +T = TypeVar("T", bound="DeleteSecretResponse") + + +@_attrs_define +class DeleteSecretResponse: + """ + Attributes: + secret (Secret): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DeleteSecretResponse.json. + """ + + secret: Secret + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + secret = self.secret.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "secret": secret, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.secret import Secret + + d = dict(src_dict) + secret = Secret.from_dict(d.pop("secret")) + + schema = d.pop("$schema", UNSET) + + delete_secret_response = cls( + secret=secret, + schema=schema, + ) + + return delete_secret_response diff --git a/src/tower/tower_api_client/models/delete_session_params.py b/src/tower/tower_api_client/models/delete_session_params.py new file mode 100644 index 00000000..fdcb7640 --- /dev/null +++ b/src/tower/tower_api_client/models/delete_session_params.py @@ -0,0 +1,52 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DeleteSessionParams") + + +@_attrs_define +class DeleteSessionParams: + """ + Attributes: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DeleteSessionParams.json. + session_id (str | Unset): The ID of the session to delete. If not provided, the current session will be deleted. + """ + + schema: str | Unset = UNSET + session_id: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + schema = self.schema + + session_id = self.session_id + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if schema is not UNSET: + field_dict["$schema"] = schema + if session_id is not UNSET: + field_dict["session_id"] = session_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + schema = d.pop("$schema", UNSET) + + session_id = d.pop("session_id", UNSET) + + delete_session_params = cls( + schema=schema, + session_id=session_id, + ) + + return delete_session_params diff --git a/src/tower/tower_api_client/models/delete_session_response.py b/src/tower/tower_api_client/models/delete_session_response.py new file mode 100644 index 00000000..0a102077 --- /dev/null +++ b/src/tower/tower_api_client/models/delete_session_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.session import Session + + +T = TypeVar("T", bound="DeleteSessionResponse") + + +@_attrs_define +class DeleteSessionResponse: + """ + Attributes: + session (Session): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DeleteSessionResponse.json. + """ + + session: Session + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + session = self.session.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "session": session, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.session import Session + + d = dict(src_dict) + session = Session.from_dict(d.pop("session")) + + schema = d.pop("$schema", UNSET) + + delete_session_response = cls( + session=session, + schema=schema, + ) + + return delete_session_response diff --git a/src/tower/tower_api_client/models/delete_team_invitation_params.py b/src/tower/tower_api_client/models/delete_team_invitation_params.py new file mode 100644 index 00000000..a32368b6 --- /dev/null +++ b/src/tower/tower_api_client/models/delete_team_invitation_params.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DeleteTeamInvitationParams") + + +@_attrs_define +class DeleteTeamInvitationParams: + """ + Attributes: + email (str): The email address of the team member to remove + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DeleteTeamInvitationParams.json. + """ + + email: str + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + email = self.email + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "email": email, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + email = d.pop("email") + + schema = d.pop("$schema", UNSET) + + delete_team_invitation_params = cls( + email=email, + schema=schema, + ) + + return delete_team_invitation_params diff --git a/src/tower/tower_api_client/models/delete_team_invitation_response.py b/src/tower/tower_api_client/models/delete_team_invitation_response.py new file mode 100644 index 00000000..cb492f18 --- /dev/null +++ b/src/tower/tower_api_client/models/delete_team_invitation_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.team_invitation import TeamInvitation + + +T = TypeVar("T", bound="DeleteTeamInvitationResponse") + + +@_attrs_define +class DeleteTeamInvitationResponse: + """ + Attributes: + invitation (TeamInvitation): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DeleteTeamInvitationResponse.json. + """ + + invitation: TeamInvitation + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + invitation = self.invitation.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "invitation": invitation, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.team_invitation import TeamInvitation + + d = dict(src_dict) + invitation = TeamInvitation.from_dict(d.pop("invitation")) + + schema = d.pop("$schema", UNSET) + + delete_team_invitation_response = cls( + invitation=invitation, + schema=schema, + ) + + return delete_team_invitation_response diff --git a/src/tower/tower_api_client/models/delete_team_params.py b/src/tower/tower_api_client/models/delete_team_params.py new file mode 100644 index 00000000..01ad8f9e --- /dev/null +++ b/src/tower/tower_api_client/models/delete_team_params.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DeleteTeamParams") + + +@_attrs_define +class DeleteTeamParams: + """ + Attributes: + name (str): The name of the team to delete + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DeleteTeamParams.json. + """ + + name: str + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + name = self.name + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "name": name, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + schema = d.pop("$schema", UNSET) + + delete_team_params = cls( + name=name, + schema=schema, + ) + + return delete_team_params diff --git a/src/tower/tower_api_client/models/delete_team_response.py b/src/tower/tower_api_client/models/delete_team_response.py new file mode 100644 index 00000000..ed76230d --- /dev/null +++ b/src/tower/tower_api_client/models/delete_team_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.team import Team + + +T = TypeVar("T", bound="DeleteTeamResponse") + + +@_attrs_define +class DeleteTeamResponse: + """ + Attributes: + team (Team): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DeleteTeamResponse.json. + """ + + team: Team + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + team = self.team.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "team": team, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.team import Team + + d = dict(src_dict) + team = Team.from_dict(d.pop("team")) + + schema = d.pop("$schema", UNSET) + + delete_team_response = cls( + team=team, + schema=schema, + ) + + return delete_team_response diff --git a/src/tower/tower_api_client/models/delete_webhook_response.py b/src/tower/tower_api_client/models/delete_webhook_response.py new file mode 100644 index 00000000..56b13381 --- /dev/null +++ b/src/tower/tower_api_client/models/delete_webhook_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.webhook import Webhook + + +T = TypeVar("T", bound="DeleteWebhookResponse") + + +@_attrs_define +class DeleteWebhookResponse: + """ + Attributes: + webhook (Webhook): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DeleteWebhookResponse.json. + """ + + webhook: Webhook + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + webhook = self.webhook.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "webhook": webhook, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.webhook import Webhook + + d = dict(src_dict) + webhook = Webhook.from_dict(d.pop("webhook")) + + schema = d.pop("$schema", UNSET) + + delete_webhook_response = cls( + webhook=webhook, + schema=schema, + ) + + return delete_webhook_response diff --git a/src/tower/tower_api_client/models/deploy_app_json_body.py b/src/tower/tower_api_client/models/deploy_app_json_body.py new file mode 100644 index 00000000..6109dff8 --- /dev/null +++ b/src/tower/tower_api_client/models/deploy_app_json_body.py @@ -0,0 +1,64 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="DeployAppJsonBody") + + +@_attrs_define +class DeployAppJsonBody: + """ + Example: + {'source_uri': 'https://github.com/tower/tower-examples/tree/main/01-hello-world'} + + Attributes: + source_uri (str): GitHub repository URL for deploying from source + """ + + source_uri: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + source_uri = self.source_uri + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "source_uri": source_uri, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + source_uri = d.pop("source_uri") + + deploy_app_json_body = cls( + source_uri=source_uri, + ) + + deploy_app_json_body.additional_properties = d + return deploy_app_json_body + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/tower/tower_api_client/models/deploy_app_response.py b/src/tower/tower_api_client/models/deploy_app_response.py new file mode 100644 index 00000000..ca4e1400 --- /dev/null +++ b/src/tower/tower_api_client/models/deploy_app_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.app_version import AppVersion + + +T = TypeVar("T", bound="DeployAppResponse") + + +@_attrs_define +class DeployAppResponse: + """ + Attributes: + version (AppVersion): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DeployAppResponse.json. + """ + + version: AppVersion + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + version = self.version.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "version": version, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.app_version import AppVersion + + d = dict(src_dict) + version = AppVersion.from_dict(d.pop("version")) + + schema = d.pop("$schema", UNSET) + + deploy_app_response = cls( + version=version, + schema=schema, + ) + + return deploy_app_response diff --git a/src/tower/tower_api_client/models/describe_account_body.py b/src/tower/tower_api_client/models/describe_account_body.py new file mode 100644 index 00000000..4ebbe0d3 --- /dev/null +++ b/src/tower/tower_api_client/models/describe_account_body.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.account import Account + + +T = TypeVar("T", bound="DescribeAccountBody") + + +@_attrs_define +class DescribeAccountBody: + """ + Attributes: + account (Account): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DescribeAccountBody.json. + """ + + account: Account + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + account = self.account.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "account": account, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.account import Account + + d = dict(src_dict) + account = Account.from_dict(d.pop("account")) + + schema = d.pop("$schema", UNSET) + + describe_account_body = cls( + account=account, + schema=schema, + ) + + return describe_account_body diff --git a/src/tower/tower_api_client/models/describe_app_response.py b/src/tower/tower_api_client/models/describe_app_response.py new file mode 100644 index 00000000..8126dc8e --- /dev/null +++ b/src/tower/tower_api_client/models/describe_app_response.py @@ -0,0 +1,78 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.app import App + from ..models.run import Run + + +T = TypeVar("T", bound="DescribeAppResponse") + + +@_attrs_define +class DescribeAppResponse: + """ + Attributes: + app (App): + runs (list[Run]): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DescribeAppResponse.json. + """ + + app: App + runs: list[Run] + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + app = self.app.to_dict() + + runs = [] + for runs_item_data in self.runs: + runs_item = runs_item_data.to_dict() + runs.append(runs_item) + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "app": app, + "runs": runs, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.app import App + from ..models.run import Run + + d = dict(src_dict) + app = App.from_dict(d.pop("app")) + + runs = [] + _runs = d.pop("runs") + for runs_item_data in _runs: + runs_item = Run.from_dict(runs_item_data) + + runs.append(runs_item) + + schema = d.pop("$schema", UNSET) + + describe_app_response = cls( + app=app, + runs=runs, + schema=schema, + ) + + return describe_app_response diff --git a/src/tower/tower_api_client/models/describe_app_version_response.py b/src/tower/tower_api_client/models/describe_app_version_response.py new file mode 100644 index 00000000..917a68d7 --- /dev/null +++ b/src/tower/tower_api_client/models/describe_app_version_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.app_version import AppVersion + + +T = TypeVar("T", bound="DescribeAppVersionResponse") + + +@_attrs_define +class DescribeAppVersionResponse: + """ + Attributes: + version (AppVersion): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DescribeAppVersionResponse.json. + """ + + version: AppVersion + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + version = self.version.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "version": version, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.app_version import AppVersion + + d = dict(src_dict) + version = AppVersion.from_dict(d.pop("version")) + + schema = d.pop("$schema", UNSET) + + describe_app_version_response = cls( + version=version, + schema=schema, + ) + + return describe_app_version_response diff --git a/src/tower/tower_api_client/models/describe_authentication_context_body.py b/src/tower/tower_api_client/models/describe_authentication_context_body.py new file mode 100644 index 00000000..222638ad --- /dev/null +++ b/src/tower/tower_api_client/models/describe_authentication_context_body.py @@ -0,0 +1,62 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.authentication_context import AuthenticationContext + + +T = TypeVar("T", bound="DescribeAuthenticationContextBody") + + +@_attrs_define +class DescribeAuthenticationContextBody: + """ + Attributes: + authentication_context (AuthenticationContext): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DescribeAuthenticationContextBody.json. + """ + + authentication_context: AuthenticationContext + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + authentication_context = self.authentication_context.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "authentication_context": authentication_context, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.authentication_context import AuthenticationContext + + d = dict(src_dict) + authentication_context = AuthenticationContext.from_dict( + d.pop("authentication_context") + ) + + schema = d.pop("$schema", UNSET) + + describe_authentication_context_body = cls( + authentication_context=authentication_context, + schema=schema, + ) + + return describe_authentication_context_body diff --git a/src/tower/tower_api_client/models/describe_catalog_response.py b/src/tower/tower_api_client/models/describe_catalog_response.py new file mode 100644 index 00000000..2649d4ed --- /dev/null +++ b/src/tower/tower_api_client/models/describe_catalog_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.catalog import Catalog + + +T = TypeVar("T", bound="DescribeCatalogResponse") + + +@_attrs_define +class DescribeCatalogResponse: + """ + Attributes: + catalog (Catalog): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DescribeCatalogResponse.json. + """ + + catalog: Catalog + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + catalog = self.catalog.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "catalog": catalog, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.catalog import Catalog + + d = dict(src_dict) + catalog = Catalog.from_dict(d.pop("catalog")) + + schema = d.pop("$schema", UNSET) + + describe_catalog_response = cls( + catalog=catalog, + schema=schema, + ) + + return describe_catalog_response diff --git a/src/tower/tower_api_client/models/describe_device_login_session_response.py b/src/tower/tower_api_client/models/describe_device_login_session_response.py new file mode 100644 index 00000000..ae4492bd --- /dev/null +++ b/src/tower/tower_api_client/models/describe_device_login_session_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.session import Session + + +T = TypeVar("T", bound="DescribeDeviceLoginSessionResponse") + + +@_attrs_define +class DescribeDeviceLoginSessionResponse: + """ + Attributes: + session (Session): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DescribeDeviceLoginSessionResponse.json. + """ + + session: Session + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + session = self.session.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "session": session, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.session import Session + + d = dict(src_dict) + session = Session.from_dict(d.pop("session")) + + schema = d.pop("$schema", UNSET) + + describe_device_login_session_response = cls( + session=session, + schema=schema, + ) + + return describe_device_login_session_response diff --git a/src/tower/tower_api_client/models/describe_email_preferences_body.py b/src/tower/tower_api_client/models/describe_email_preferences_body.py new file mode 100644 index 00000000..20c97dda --- /dev/null +++ b/src/tower/tower_api_client/models/describe_email_preferences_body.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.email_subscriptions import EmailSubscriptions + + +T = TypeVar("T", bound="DescribeEmailPreferencesBody") + + +@_attrs_define +class DescribeEmailPreferencesBody: + """ + Attributes: + subscriptions (EmailSubscriptions): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DescribeEmailPreferencesBody.json. + """ + + subscriptions: EmailSubscriptions + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + subscriptions = self.subscriptions.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "subscriptions": subscriptions, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.email_subscriptions import EmailSubscriptions + + d = dict(src_dict) + subscriptions = EmailSubscriptions.from_dict(d.pop("subscriptions")) + + schema = d.pop("$schema", UNSET) + + describe_email_preferences_body = cls( + subscriptions=subscriptions, + schema=schema, + ) + + return describe_email_preferences_body diff --git a/src/tower/tower_api_client/models/describe_plan_response.py b/src/tower/tower_api_client/models/describe_plan_response.py new file mode 100644 index 00000000..32bb942a --- /dev/null +++ b/src/tower/tower_api_client/models/describe_plan_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.plan import Plan + + +T = TypeVar("T", bound="DescribePlanResponse") + + +@_attrs_define +class DescribePlanResponse: + """ + Attributes: + plan (Plan): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DescribePlanResponse.json. + """ + + plan: Plan + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + plan = self.plan.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "plan": plan, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.plan import Plan + + d = dict(src_dict) + plan = Plan.from_dict(d.pop("plan")) + + schema = d.pop("$schema", UNSET) + + describe_plan_response = cls( + plan=plan, + schema=schema, + ) + + return describe_plan_response diff --git a/src/tower/tower_api_client/models/describe_run_graph_response.py b/src/tower/tower_api_client/models/describe_run_graph_response.py new file mode 100644 index 00000000..a93b0a78 --- /dev/null +++ b/src/tower/tower_api_client/models/describe_run_graph_response.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.run_graph_node import RunGraphNode + + +T = TypeVar("T", bound="DescribeRunGraphResponse") + + +@_attrs_define +class DescribeRunGraphResponse: + """ + Attributes: + runs (list[RunGraphNode]): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DescribeRunGraphResponse.json. + """ + + runs: list[RunGraphNode] + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + runs = [] + for runs_item_data in self.runs: + runs_item = runs_item_data.to_dict() + runs.append(runs_item) + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "runs": runs, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.run_graph_node import RunGraphNode + + d = dict(src_dict) + runs = [] + _runs = d.pop("runs") + for runs_item_data in _runs: + runs_item = RunGraphNode.from_dict(runs_item_data) + + runs.append(runs_item) + + schema = d.pop("$schema", UNSET) + + describe_run_graph_response = cls( + runs=runs, + schema=schema, + ) + + return describe_run_graph_response diff --git a/src/tower/tower_api_client/models/describe_run_links.py b/src/tower/tower_api_client/models/describe_run_links.py new file mode 100644 index 00000000..53fe1471 --- /dev/null +++ b/src/tower/tower_api_client/models/describe_run_links.py @@ -0,0 +1,99 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="DescribeRunLinks") + + +@_attrs_define +class DescribeRunLinks: + """ + Attributes: + next_ (None | str): The URL of the next run, if any. + next_number (int | None): The number of the next run, if any. + prev (None | str): The URL of the previous run, if any. + prev_number (int | None): The number of the previous run, if any. + self_ (str): The URL of this run. + """ + + next_: None | str + next_number: int | None + prev: None | str + prev_number: int | None + self_: str + + def to_dict(self) -> dict[str, Any]: + next_: None | str + next_ = self.next_ + + next_number: int | None + next_number = self.next_number + + prev: None | str + prev = self.prev + + prev_number: int | None + prev_number = self.prev_number + + self_ = self.self_ + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "next": next_, + "next_number": next_number, + "prev": prev, + "prev_number": prev_number, + "self": self_, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + + def _parse_next_(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + next_ = _parse_next_(d.pop("next")) + + def _parse_next_number(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + next_number = _parse_next_number(d.pop("next_number")) + + def _parse_prev(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + prev = _parse_prev(d.pop("prev")) + + def _parse_prev_number(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + prev_number = _parse_prev_number(d.pop("prev_number")) + + self_ = d.pop("self") + + describe_run_links = cls( + next_=next_, + next_number=next_number, + prev=prev, + prev_number=prev_number, + self_=self_, + ) + + return describe_run_links diff --git a/src/tower/tower_api_client/models/describe_run_logs_response.py b/src/tower/tower_api_client/models/describe_run_logs_response.py new file mode 100644 index 00000000..97fccf35 --- /dev/null +++ b/src/tower/tower_api_client/models/describe_run_logs_response.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.run_log_line import RunLogLine + + +T = TypeVar("T", bound="DescribeRunLogsResponse") + + +@_attrs_define +class DescribeRunLogsResponse: + """ + Attributes: + log_lines (list[RunLogLine]): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DescribeRunLogsResponse.json. + """ + + log_lines: list[RunLogLine] + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + log_lines = [] + for log_lines_item_data in self.log_lines: + log_lines_item = log_lines_item_data.to_dict() + log_lines.append(log_lines_item) + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "log_lines": log_lines, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.run_log_line import RunLogLine + + d = dict(src_dict) + log_lines = [] + _log_lines = d.pop("log_lines") + for log_lines_item_data in _log_lines: + log_lines_item = RunLogLine.from_dict(log_lines_item_data) + + log_lines.append(log_lines_item) + + schema = d.pop("$schema", UNSET) + + describe_run_logs_response = cls( + log_lines=log_lines, + schema=schema, + ) + + return describe_run_logs_response diff --git a/src/tower/tower_api_client/models/describe_run_response.py b/src/tower/tower_api_client/models/describe_run_response.py new file mode 100644 index 00000000..2cb66487 --- /dev/null +++ b/src/tower/tower_api_client/models/describe_run_response.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.describe_run_links import DescribeRunLinks + from ..models.run import Run + + +T = TypeVar("T", bound="DescribeRunResponse") + + +@_attrs_define +class DescribeRunResponse: + """ + Attributes: + links (DescribeRunLinks): + run (Run): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DescribeRunResponse.json. + """ + + links: DescribeRunLinks + run: Run + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + links = self.links.to_dict() + + run = self.run.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "$links": links, + "run": run, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.describe_run_links import DescribeRunLinks + from ..models.run import Run + + d = dict(src_dict) + links = DescribeRunLinks.from_dict(d.pop("$links")) + + run = Run.from_dict(d.pop("run")) + + schema = d.pop("$schema", UNSET) + + describe_run_response = cls( + links=links, + run=run, + schema=schema, + ) + + return describe_run_response diff --git a/src/tower/tower_api_client/models/describe_secrets_key_response.py b/src/tower/tower_api_client/models/describe_secrets_key_response.py new file mode 100644 index 00000000..dee9b03c --- /dev/null +++ b/src/tower/tower_api_client/models/describe_secrets_key_response.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DescribeSecretsKeyResponse") + + +@_attrs_define +class DescribeSecretsKeyResponse: + """ + Attributes: + public_key (str): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DescribeSecretsKeyResponse.json. + """ + + public_key: str + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + public_key = self.public_key + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "public_key": public_key, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + public_key = d.pop("public_key") + + schema = d.pop("$schema", UNSET) + + describe_secrets_key_response = cls( + public_key=public_key, + schema=schema, + ) + + return describe_secrets_key_response diff --git a/src/tower/tower_api_client/models/describe_session_response.py b/src/tower/tower_api_client/models/describe_session_response.py new file mode 100644 index 00000000..95997b8d --- /dev/null +++ b/src/tower/tower_api_client/models/describe_session_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.session import Session + + +T = TypeVar("T", bound="DescribeSessionResponse") + + +@_attrs_define +class DescribeSessionResponse: + """ + Attributes: + session (Session): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DescribeSessionResponse.json. + """ + + session: Session + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + session = self.session.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "session": session, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.session import Session + + d = dict(src_dict) + session = Session.from_dict(d.pop("session")) + + schema = d.pop("$schema", UNSET) + + describe_session_response = cls( + session=session, + schema=schema, + ) + + return describe_session_response diff --git a/src/tower/tower_api_client/models/describe_team_response.py b/src/tower/tower_api_client/models/describe_team_response.py new file mode 100644 index 00000000..ac89f1b3 --- /dev/null +++ b/src/tower/tower_api_client/models/describe_team_response.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.team import Team + from ..models.team_invitation import TeamInvitation + from ..models.user import User + + +T = TypeVar("T", bound="DescribeTeamResponse") + + +@_attrs_define +class DescribeTeamResponse: + """ + Attributes: + invitations (list[TeamInvitation]): Pending team invitations + members (list[User]): The members of the team + team (Team): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DescribeTeamResponse.json. + """ + + invitations: list[TeamInvitation] + members: list[User] + team: Team + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + invitations = [] + for invitations_item_data in self.invitations: + invitations_item = invitations_item_data.to_dict() + invitations.append(invitations_item) + + members = [] + for members_item_data in self.members: + members_item = members_item_data.to_dict() + members.append(members_item) + + team = self.team.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "invitations": invitations, + "members": members, + "team": team, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.team import Team + from ..models.team_invitation import TeamInvitation + from ..models.user import User + + d = dict(src_dict) + invitations = [] + _invitations = d.pop("invitations") + for invitations_item_data in _invitations: + invitations_item = TeamInvitation.from_dict(invitations_item_data) + + invitations.append(invitations_item) + + members = [] + _members = d.pop("members") + for members_item_data in _members: + members_item = User.from_dict(members_item_data) + + members.append(members_item) + + team = Team.from_dict(d.pop("team")) + + schema = d.pop("$schema", UNSET) + + describe_team_response = cls( + invitations=invitations, + members=members, + team=team, + schema=schema, + ) + + return describe_team_response diff --git a/src/tower/tower_api_client/models/describe_webhook_response.py b/src/tower/tower_api_client/models/describe_webhook_response.py new file mode 100644 index 00000000..0467bf0c --- /dev/null +++ b/src/tower/tower_api_client/models/describe_webhook_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.webhook import Webhook + + +T = TypeVar("T", bound="DescribeWebhookResponse") + + +@_attrs_define +class DescribeWebhookResponse: + """ + Attributes: + webhook (Webhook): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/DescribeWebhookResponse.json. + """ + + webhook: Webhook + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + webhook = self.webhook.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "webhook": webhook, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.webhook import Webhook + + d = dict(src_dict) + webhook = Webhook.from_dict(d.pop("webhook")) + + schema = d.pop("$schema", UNSET) + + describe_webhook_response = cls( + webhook=webhook, + schema=schema, + ) + + return describe_webhook_response diff --git a/src/tower/tower_api_client/models/email_subscriptions.py b/src/tower/tower_api_client/models/email_subscriptions.py new file mode 100644 index 00000000..c83bc98c --- /dev/null +++ b/src/tower/tower_api_client/models/email_subscriptions.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="EmailSubscriptions") + + +@_attrs_define +class EmailSubscriptions: + """ + Attributes: + feature_updates (bool | Unset): + marketing_emails (bool | Unset): + tower_newsletter (bool | Unset): + """ + + feature_updates: bool | Unset = UNSET + marketing_emails: bool | Unset = UNSET + tower_newsletter: bool | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + feature_updates = self.feature_updates + + marketing_emails = self.marketing_emails + + tower_newsletter = self.tower_newsletter + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if feature_updates is not UNSET: + field_dict["feature_updates"] = feature_updates + if marketing_emails is not UNSET: + field_dict["marketing_emails"] = marketing_emails + if tower_newsletter is not UNSET: + field_dict["tower_newsletter"] = tower_newsletter + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + feature_updates = d.pop("feature_updates", UNSET) + + marketing_emails = d.pop("marketing_emails", UNSET) + + tower_newsletter = d.pop("tower_newsletter", UNSET) + + email_subscriptions = cls( + feature_updates=feature_updates, + marketing_emails=marketing_emails, + tower_newsletter=tower_newsletter, + ) + + return email_subscriptions diff --git a/src/tower/tower_api_client/models/encrypted_catalog_property.py b/src/tower/tower_api_client/models/encrypted_catalog_property.py new file mode 100644 index 00000000..368ee0d6 --- /dev/null +++ b/src/tower/tower_api_client/models/encrypted_catalog_property.py @@ -0,0 +1,58 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="EncryptedCatalogProperty") + + +@_attrs_define +class EncryptedCatalogProperty: + """ + Attributes: + encrypted_value (str): + name (str): + preview (str): + """ + + encrypted_value: str + name: str + preview: str + + def to_dict(self) -> dict[str, Any]: + encrypted_value = self.encrypted_value + + name = self.name + + preview = self.preview + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "encrypted_value": encrypted_value, + "name": name, + "preview": preview, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + encrypted_value = d.pop("encrypted_value") + + name = d.pop("name") + + preview = d.pop("preview") + + encrypted_catalog_property = cls( + encrypted_value=encrypted_value, + name=name, + preview=preview, + ) + + return encrypted_catalog_property diff --git a/src/tower/tower_api_client/models/environment.py b/src/tower/tower_api_client/models/environment.py new file mode 100644 index 00000000..065ebd2e --- /dev/null +++ b/src/tower/tower_api_client/models/environment.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="Environment") + + +@_attrs_define +class Environment: + """ + Attributes: + name (str): The human readable name for the environment + """ + + name: str + + def to_dict(self) -> dict[str, Any]: + name = self.name + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "name": name, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + environment = cls( + name=name, + ) + + return environment diff --git a/src/tower/tower_api_client/models/error_detail.py b/src/tower/tower_api_client/models/error_detail.py new file mode 100644 index 00000000..fbcb181a --- /dev/null +++ b/src/tower/tower_api_client/models/error_detail.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ErrorDetail") + + +@_attrs_define +class ErrorDetail: + """ + Attributes: + location (str | Unset): Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id' + message (str | Unset): Error message text + value (Any | Unset): The value at the given location + """ + + location: str | Unset = UNSET + message: str | Unset = UNSET + value: Any | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + location = self.location + + message = self.message + + value = self.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if location is not UNSET: + field_dict["location"] = location + if message is not UNSET: + field_dict["message"] = message + if value is not UNSET: + field_dict["value"] = value + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + location = d.pop("location", UNSET) + + message = d.pop("message", UNSET) + + value = d.pop("value", UNSET) + + error_detail = cls( + location=location, + message=message, + value=value, + ) + + return error_detail diff --git a/src/tower/tower_api_client/models/error_model.py b/src/tower/tower_api_client/models/error_model.py new file mode 100644 index 00000000..9cc7e12d --- /dev/null +++ b/src/tower/tower_api_client/models/error_model.py @@ -0,0 +1,119 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.error_detail import ErrorDetail + + +T = TypeVar("T", bound="ErrorModel") + + +@_attrs_define +class ErrorModel: + """ + Attributes: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/ErrorModel.json. + detail (str | Unset): A human-readable explanation specific to this occurrence of the problem. Example: Property + foo is required but is missing.. + errors (list[ErrorDetail] | Unset): Optional list of individual error details + instance (str | Unset): A URI reference that identifies the specific occurrence of the problem. Example: + https://example.com/error-log/abc123. + status (int | Unset): HTTP status code Example: 400. + title (str | Unset): A short, human-readable summary of the problem type. This value should not change between + occurrences of the error. Example: Bad Request. + type_ (str | Unset): A URI reference to human-readable documentation for the error. Default: 'about:blank'. + Example: https://example.com/errors/example. + """ + + schema: str | Unset = UNSET + detail: str | Unset = UNSET + errors: list[ErrorDetail] | Unset = UNSET + instance: str | Unset = UNSET + status: int | Unset = UNSET + title: str | Unset = UNSET + type_: str | Unset = "about:blank" + + def to_dict(self) -> dict[str, Any]: + schema = self.schema + + detail = self.detail + + errors: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.errors, Unset): + errors = [] + for errors_item_data in self.errors: + errors_item = errors_item_data.to_dict() + errors.append(errors_item) + + instance = self.instance + + status = self.status + + title = self.title + + type_ = self.type_ + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if schema is not UNSET: + field_dict["$schema"] = schema + if detail is not UNSET: + field_dict["detail"] = detail + if errors is not UNSET: + field_dict["errors"] = errors + if instance is not UNSET: + field_dict["instance"] = instance + if status is not UNSET: + field_dict["status"] = status + if title is not UNSET: + field_dict["title"] = title + if type_ is not UNSET: + field_dict["type"] = type_ + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.error_detail import ErrorDetail + + d = dict(src_dict) + schema = d.pop("$schema", UNSET) + + detail = d.pop("detail", UNSET) + + _errors = d.pop("errors", UNSET) + errors: list[ErrorDetail] | Unset = UNSET + if _errors is not UNSET: + errors = [] + for errors_item_data in _errors: + errors_item = ErrorDetail.from_dict(errors_item_data) + + errors.append(errors_item) + + instance = d.pop("instance", UNSET) + + status = d.pop("status", UNSET) + + title = d.pop("title", UNSET) + + type_ = d.pop("type", UNSET) + + error_model = cls( + schema=schema, + detail=detail, + errors=errors, + instance=instance, + status=status, + title=title, + type_=type_, + ) + + return error_model diff --git a/src/tower/tower_api_client/models/export_catalogs_params.py b/src/tower/tower_api_client/models/export_catalogs_params.py new file mode 100644 index 00000000..39fccb5c --- /dev/null +++ b/src/tower/tower_api_client/models/export_catalogs_params.py @@ -0,0 +1,86 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ExportCatalogsParams") + + +@_attrs_define +class ExportCatalogsParams: + """ + Attributes: + all_ (bool): Whether to fetch all catalogs or only the ones in the supplied environment. Default: False. + environment (str): The environment to filter by. Default: 'default'. + page (int): The page number to fetch. Default: 1. + page_size (int): The number of records to fetch on each page. Default: 20. + public_key (str): The PEM-encoded public key you want to use to encrypt sensitive catalog properties. + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/ExportCatalogsParams.json. + """ + + public_key: str + all_: bool = False + environment: str = "default" + page: int = 1 + page_size: int = 20 + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + all_ = self.all_ + + environment = self.environment + + page = self.page + + page_size = self.page_size + + public_key = self.public_key + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "all": all_, + "environment": environment, + "page": page, + "page_size": page_size, + "public_key": public_key, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + all_ = d.pop("all") + + environment = d.pop("environment") + + page = d.pop("page") + + page_size = d.pop("page_size") + + public_key = d.pop("public_key") + + schema = d.pop("$schema", UNSET) + + export_catalogs_params = cls( + all_=all_, + environment=environment, + page=page, + page_size=page_size, + public_key=public_key, + schema=schema, + ) + + return export_catalogs_params diff --git a/src/tower/tower_api_client/models/export_catalogs_response.py b/src/tower/tower_api_client/models/export_catalogs_response.py new file mode 100644 index 00000000..70242dc1 --- /dev/null +++ b/src/tower/tower_api_client/models/export_catalogs_response.py @@ -0,0 +1,78 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.exported_catalog import ExportedCatalog + from ..models.pagination import Pagination + + +T = TypeVar("T", bound="ExportCatalogsResponse") + + +@_attrs_define +class ExportCatalogsResponse: + """ + Attributes: + catalogs (list[ExportedCatalog]): + pages (Pagination): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/ExportCatalogsResponse.json. + """ + + catalogs: list[ExportedCatalog] + pages: Pagination + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + catalogs = [] + for catalogs_item_data in self.catalogs: + catalogs_item = catalogs_item_data.to_dict() + catalogs.append(catalogs_item) + + pages = self.pages.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "catalogs": catalogs, + "pages": pages, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.exported_catalog import ExportedCatalog + from ..models.pagination import Pagination + + d = dict(src_dict) + catalogs = [] + _catalogs = d.pop("catalogs") + for catalogs_item_data in _catalogs: + catalogs_item = ExportedCatalog.from_dict(catalogs_item_data) + + catalogs.append(catalogs_item) + + pages = Pagination.from_dict(d.pop("pages")) + + schema = d.pop("$schema", UNSET) + + export_catalogs_response = cls( + catalogs=catalogs, + pages=pages, + schema=schema, + ) + + return export_catalogs_response diff --git a/src/tower/tower_api_client/models/export_secrets_params.py b/src/tower/tower_api_client/models/export_secrets_params.py new file mode 100644 index 00000000..ce797c76 --- /dev/null +++ b/src/tower/tower_api_client/models/export_secrets_params.py @@ -0,0 +1,86 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ExportSecretsParams") + + +@_attrs_define +class ExportSecretsParams: + """ + Attributes: + all_ (bool): Whether to fetch all secrets or only the ones that are not marked as deleted. Default: False. + environment (str): The environment to filter by. Default: 'default'. + page (int): The page number to fetch. Default: 1. + page_size (int): The number of records to fetch on each page. Default: 20. + public_key (str): The PEM-encoded public key you want to use to encrypt sensitive secret values. + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/ExportSecretsParams.json. + """ + + public_key: str + all_: bool = False + environment: str = "default" + page: int = 1 + page_size: int = 20 + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + all_ = self.all_ + + environment = self.environment + + page = self.page + + page_size = self.page_size + + public_key = self.public_key + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "all": all_, + "environment": environment, + "page": page, + "page_size": page_size, + "public_key": public_key, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + all_ = d.pop("all") + + environment = d.pop("environment") + + page = d.pop("page") + + page_size = d.pop("page_size") + + public_key = d.pop("public_key") + + schema = d.pop("$schema", UNSET) + + export_secrets_params = cls( + all_=all_, + environment=environment, + page=page, + page_size=page_size, + public_key=public_key, + schema=schema, + ) + + return export_secrets_params diff --git a/src/tower/tower_api_client/models/export_secrets_response.py b/src/tower/tower_api_client/models/export_secrets_response.py new file mode 100644 index 00000000..960846e1 --- /dev/null +++ b/src/tower/tower_api_client/models/export_secrets_response.py @@ -0,0 +1,78 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.exported_secret import ExportedSecret + from ..models.pagination import Pagination + + +T = TypeVar("T", bound="ExportSecretsResponse") + + +@_attrs_define +class ExportSecretsResponse: + """ + Attributes: + pages (Pagination): + secrets (list[ExportedSecret]): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/ExportSecretsResponse.json. + """ + + pages: Pagination + secrets: list[ExportedSecret] + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + pages = self.pages.to_dict() + + secrets = [] + for secrets_item_data in self.secrets: + secrets_item = secrets_item_data.to_dict() + secrets.append(secrets_item) + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "pages": pages, + "secrets": secrets, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.exported_secret import ExportedSecret + from ..models.pagination import Pagination + + d = dict(src_dict) + pages = Pagination.from_dict(d.pop("pages")) + + secrets = [] + _secrets = d.pop("secrets") + for secrets_item_data in _secrets: + secrets_item = ExportedSecret.from_dict(secrets_item_data) + + secrets.append(secrets_item) + + schema = d.pop("$schema", UNSET) + + export_secrets_response = cls( + pages=pages, + secrets=secrets, + schema=schema, + ) + + return export_secrets_response diff --git a/src/tower/tower_api_client/models/exported_catalog.py b/src/tower/tower_api_client/models/exported_catalog.py new file mode 100644 index 00000000..0a18c5db --- /dev/null +++ b/src/tower/tower_api_client/models/exported_catalog.py @@ -0,0 +1,101 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.exported_catalog_property import ExportedCatalogProperty + + +T = TypeVar("T", bound="ExportedCatalog") + + +@_attrs_define +class ExportedCatalog: + """ + Attributes: + created_at (datetime.datetime): + environment (str): + name (str): + properties (list[ExportedCatalogProperty]): + type_ (str): + slug (str | Unset): This property is deprecated. Use name instead. + """ + + created_at: datetime.datetime + environment: str + name: str + properties: list[ExportedCatalogProperty] + type_: str + slug: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + environment = self.environment + + name = self.name + + properties = [] + for properties_item_data in self.properties: + properties_item = properties_item_data.to_dict() + properties.append(properties_item) + + type_ = self.type_ + + slug = self.slug + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "CreatedAt": created_at, + "environment": environment, + "name": name, + "properties": properties, + "type": type_, + } + ) + if slug is not UNSET: + field_dict["slug"] = slug + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.exported_catalog_property import ExportedCatalogProperty + + d = dict(src_dict) + created_at = isoparse(d.pop("CreatedAt")) + + environment = d.pop("environment") + + name = d.pop("name") + + properties = [] + _properties = d.pop("properties") + for properties_item_data in _properties: + properties_item = ExportedCatalogProperty.from_dict(properties_item_data) + + properties.append(properties_item) + + type_ = d.pop("type") + + slug = d.pop("slug", UNSET) + + exported_catalog = cls( + created_at=created_at, + environment=environment, + name=name, + properties=properties, + type_=type_, + slug=slug, + ) + + return exported_catalog diff --git a/src/tower/tower_api_client/models/exported_catalog_property.py b/src/tower/tower_api_client/models/exported_catalog_property.py new file mode 100644 index 00000000..30767aca --- /dev/null +++ b/src/tower/tower_api_client/models/exported_catalog_property.py @@ -0,0 +1,69 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ExportedCatalogProperty") + + +@_attrs_define +class ExportedCatalogProperty: + """ + Attributes: + encrypted_value (str): + name (str): + preview (str): + environment_variable (str | Unset): The environment variable name this property is injected as at runtime. + """ + + encrypted_value: str + name: str + preview: str + environment_variable: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + encrypted_value = self.encrypted_value + + name = self.name + + preview = self.preview + + environment_variable = self.environment_variable + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "encrypted_value": encrypted_value, + "name": name, + "preview": preview, + } + ) + if environment_variable is not UNSET: + field_dict["environment_variable"] = environment_variable + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + encrypted_value = d.pop("encrypted_value") + + name = d.pop("name") + + preview = d.pop("preview") + + environment_variable = d.pop("environment_variable", UNSET) + + exported_catalog_property = cls( + encrypted_value=encrypted_value, + name=name, + preview=preview, + environment_variable=environment_variable, + ) + + return exported_catalog_property diff --git a/src/tower/tower_api_client/models/exported_secret.py b/src/tower/tower_api_client/models/exported_secret.py new file mode 100644 index 00000000..608e8609 --- /dev/null +++ b/src/tower/tower_api_client/models/exported_secret.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +T = TypeVar("T", bound="ExportedSecret") + + +@_attrs_define +class ExportedSecret: + """ + Attributes: + created_at (datetime.datetime): + encrypted_value (str): + environment (str): + name (str): + """ + + created_at: datetime.datetime + encrypted_value: str + environment: str + name: str + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + encrypted_value = self.encrypted_value + + environment = self.environment + + name = self.name + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "created_at": created_at, + "encrypted_value": encrypted_value, + "environment": environment, + "name": name, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + encrypted_value = d.pop("encrypted_value") + + environment = d.pop("environment") + + name = d.pop("name") + + exported_secret = cls( + created_at=created_at, + encrypted_value=encrypted_value, + environment=environment, + name=name, + ) + + return exported_secret diff --git a/src/tower/tower_api_client/models/feature.py b/src/tower/tower_api_client/models/feature.py new file mode 100644 index 00000000..22c2e91e --- /dev/null +++ b/src/tower/tower_api_client/models/feature.py @@ -0,0 +1,66 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="Feature") + + +@_attrs_define +class Feature: + """ + Attributes: + code (str): + name (str): + type_ (str): + value (int): + """ + + code: str + name: str + type_: str + value: int + + def to_dict(self) -> dict[str, Any]: + code = self.code + + name = self.name + + type_ = self.type_ + + value = self.value + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "code": code, + "name": name, + "type": type_, + "value": value, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + code = d.pop("code") + + name = d.pop("name") + + type_ = d.pop("type") + + value = d.pop("value") + + feature = cls( + code=code, + name=name, + type_=type_, + value=value, + ) + + return feature diff --git a/src/tower/tower_api_client/models/featurebase_identity.py b/src/tower/tower_api_client/models/featurebase_identity.py new file mode 100644 index 00000000..129d51a6 --- /dev/null +++ b/src/tower/tower_api_client/models/featurebase_identity.py @@ -0,0 +1,50 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="FeaturebaseIdentity") + + +@_attrs_define +class FeaturebaseIdentity: + """ + Attributes: + company_hash (str): + user_hash (str): + """ + + company_hash: str + user_hash: str + + def to_dict(self) -> dict[str, Any]: + company_hash = self.company_hash + + user_hash = self.user_hash + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "company_hash": company_hash, + "user_hash": user_hash, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + company_hash = d.pop("company_hash") + + user_hash = d.pop("user_hash") + + featurebase_identity = cls( + company_hash=company_hash, + user_hash=user_hash, + ) + + return featurebase_identity diff --git a/src/tower/tower_api_client/models/generate_app_statistics_response.py b/src/tower/tower_api_client/models/generate_app_statistics_response.py new file mode 100644 index 00000000..ecfca9f5 --- /dev/null +++ b/src/tower/tower_api_client/models/generate_app_statistics_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.app_statistics import AppStatistics + + +T = TypeVar("T", bound="GenerateAppStatisticsResponse") + + +@_attrs_define +class GenerateAppStatisticsResponse: + """ + Attributes: + statistics (AppStatistics): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/GenerateAppStatisticsResponse.json. + """ + + statistics: AppStatistics + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + statistics = self.statistics.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "statistics": statistics, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.app_statistics import AppStatistics + + d = dict(src_dict) + statistics = AppStatistics.from_dict(d.pop("statistics")) + + schema = d.pop("$schema", UNSET) + + generate_app_statistics_response = cls( + statistics=statistics, + schema=schema, + ) + + return generate_app_statistics_response diff --git a/src/tower/tower_api_client/models/generate_organization_usage_time_series_response.py b/src/tower/tower_api_client/models/generate_organization_usage_time_series_response.py new file mode 100644 index 00000000..72d5a040 --- /dev/null +++ b/src/tower/tower_api_client/models/generate_organization_usage_time_series_response.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.usage_metric_time_series_point import UsageMetricTimeSeriesPoint + + +T = TypeVar("T", bound="GenerateOrganizationUsageTimeSeriesResponse") + + +@_attrs_define +class GenerateOrganizationUsageTimeSeriesResponse: + """ + Attributes: + series (list[UsageMetricTimeSeriesPoint]): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/GenerateOrganizationUsageTimeSeriesResponse.json. + """ + + series: list[UsageMetricTimeSeriesPoint] + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + series = [] + for series_item_data in self.series: + series_item = series_item_data.to_dict() + series.append(series_item) + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "series": series, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.usage_metric_time_series_point import UsageMetricTimeSeriesPoint + + d = dict(src_dict) + series = [] + _series = d.pop("series") + for series_item_data in _series: + series_item = UsageMetricTimeSeriesPoint.from_dict(series_item_data) + + series.append(series_item) + + schema = d.pop("$schema", UNSET) + + generate_organization_usage_time_series_response = cls( + series=series, + schema=schema, + ) + + return generate_organization_usage_time_series_response diff --git a/src/tower/tower_api_client/models/generate_run_statistics_response.py b/src/tower/tower_api_client/models/generate_run_statistics_response.py new file mode 100644 index 00000000..3224b33f --- /dev/null +++ b/src/tower/tower_api_client/models/generate_run_statistics_response.py @@ -0,0 +1,88 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.run_statistics import RunStatistics + from ..models.run_timeseries_point import RunTimeseriesPoint + from ..models.statistics_settings import StatisticsSettings + + +T = TypeVar("T", bound="GenerateRunStatisticsResponse") + + +@_attrs_define +class GenerateRunStatisticsResponse: + """ + Attributes: + series (list[RunTimeseriesPoint]): + settings (StatisticsSettings): + stats (RunStatistics): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/GenerateRunStatisticsResponse.json. + """ + + series: list[RunTimeseriesPoint] + settings: StatisticsSettings + stats: RunStatistics + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + series = [] + for series_item_data in self.series: + series_item = series_item_data.to_dict() + series.append(series_item) + + settings = self.settings.to_dict() + + stats = self.stats.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "series": series, + "settings": settings, + "stats": stats, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.run_statistics import RunStatistics + from ..models.run_timeseries_point import RunTimeseriesPoint + from ..models.statistics_settings import StatisticsSettings + + d = dict(src_dict) + series = [] + _series = d.pop("series") + for series_item_data in _series: + series_item = RunTimeseriesPoint.from_dict(series_item_data) + + series.append(series_item) + + settings = StatisticsSettings.from_dict(d.pop("settings")) + + stats = RunStatistics.from_dict(d.pop("stats")) + + schema = d.pop("$schema", UNSET) + + generate_run_statistics_response = cls( + series=series, + settings=settings, + stats=stats, + schema=schema, + ) + + return generate_run_statistics_response diff --git a/src/tower/tower_api_client/models/generate_run_statistics_status_item.py b/src/tower/tower_api_client/models/generate_run_statistics_status_item.py new file mode 100644 index 00000000..3c11c0e1 --- /dev/null +++ b/src/tower/tower_api_client/models/generate_run_statistics_status_item.py @@ -0,0 +1,15 @@ +from enum import Enum + + +class GenerateRunStatisticsStatusItem(str, Enum): + CANCELLED = "cancelled" + CRASHED = "crashed" + ERRORED = "errored" + EXITED = "exited" + PENDING = "pending" + RETRYING = "retrying" + RUNNING = "running" + STARTING = "starting" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/generate_runner_credentials_response.py b/src/tower/tower_api_client/models/generate_runner_credentials_response.py new file mode 100644 index 00000000..9a968308 --- /dev/null +++ b/src/tower/tower_api_client/models/generate_runner_credentials_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.runner_credentials import RunnerCredentials + + +T = TypeVar("T", bound="GenerateRunnerCredentialsResponse") + + +@_attrs_define +class GenerateRunnerCredentialsResponse: + """ + Attributes: + credentials (RunnerCredentials): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/GenerateRunnerCredentialsResponse.json. + """ + + credentials: RunnerCredentials + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + credentials = self.credentials.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "credentials": credentials, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.runner_credentials import RunnerCredentials + + d = dict(src_dict) + credentials = RunnerCredentials.from_dict(d.pop("credentials")) + + schema = d.pop("$schema", UNSET) + + generate_runner_credentials_response = cls( + credentials=credentials, + schema=schema, + ) + + return generate_runner_credentials_response diff --git a/src/tower/tower_api_client/models/get_feature_flag_response_body.py b/src/tower/tower_api_client/models/get_feature_flag_response_body.py new file mode 100644 index 00000000..585f1db2 --- /dev/null +++ b/src/tower/tower_api_client/models/get_feature_flag_response_body.py @@ -0,0 +1,81 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.get_feature_flag_response_body_value_type import ( + GetFeatureFlagResponseBodyValueType, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="GetFeatureFlagResponseBody") + + +@_attrs_define +class GetFeatureFlagResponseBody: + """ + Attributes: + enabled (bool): Whether the flag is enabled + key (str): The feature flag key + value (Any): The flag value (type depends on value_type) + value_type (GetFeatureFlagResponseBodyValueType): The type of the value + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/GetFeatureFlagResponseBody.json. + """ + + enabled: bool + key: str + value: Any + value_type: GetFeatureFlagResponseBodyValueType + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + enabled = self.enabled + + key = self.key + + value = self.value + + value_type = self.value_type.value + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "enabled": enabled, + "key": key, + "value": value, + "value_type": value_type, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + enabled = d.pop("enabled") + + key = d.pop("key") + + value = d.pop("value") + + value_type = GetFeatureFlagResponseBodyValueType(d.pop("value_type")) + + schema = d.pop("$schema", UNSET) + + get_feature_flag_response_body = cls( + enabled=enabled, + key=key, + value=value, + value_type=value_type, + schema=schema, + ) + + return get_feature_flag_response_body diff --git a/src/tower/tower_api_client/models/get_feature_flag_response_body_value_type.py b/src/tower/tower_api_client/models/get_feature_flag_response_body_value_type.py new file mode 100644 index 00000000..20e19b5d --- /dev/null +++ b/src/tower/tower_api_client/models/get_feature_flag_response_body_value_type.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class GetFeatureFlagResponseBodyValueType(str, Enum): + BOOLEAN = "boolean" + NUMBER = "number" + OBJECT = "object" + STRING = "string" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/guest.py b/src/tower/tower_api_client/models/guest.py new file mode 100644 index 00000000..c8859768 --- /dev/null +++ b/src/tower/tower_api_client/models/guest.py @@ -0,0 +1,71 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="Guest") + + +@_attrs_define +class Guest: + """ + Attributes: + app (str): The name of the app this guest can access. + created_at (datetime.datetime): When the guest was created. + id (str): The unique identifier for the guest. + name (str | Unset): Optional display name for the guest. + """ + + app: str + created_at: datetime.datetime + id: str + name: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + app = self.app + + created_at = self.created_at.isoformat() + + id = self.id + + name = self.name + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "app": app, + "created_at": created_at, + "id": id, + } + ) + if name is not UNSET: + field_dict["name"] = name + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + app = d.pop("app") + + created_at = isoparse(d.pop("created_at")) + + id = d.pop("id") + + name = d.pop("name", UNSET) + + guest = cls( + app=app, + created_at=created_at, + id=id, + name=name, + ) + + return guest diff --git a/src/tower/tower_api_client/models/invite_team_member_params.py b/src/tower/tower_api_client/models/invite_team_member_params.py new file mode 100644 index 00000000..2eb7b30b --- /dev/null +++ b/src/tower/tower_api_client/models/invite_team_member_params.py @@ -0,0 +1,74 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.invite_team_member_params_role import InviteTeamMemberParamsRole +from ..types import UNSET, Unset + +T = TypeVar("T", bound="InviteTeamMemberParams") + + +@_attrs_define +class InviteTeamMemberParams: + """ + Attributes: + emails (str): 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 + role (InviteTeamMemberParamsRole): The role to assign to the invitations Default: + InviteTeamMemberParamsRole.DEVELOPER. + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/InviteTeamMemberParams.json. + message (str | Unset): Optional message to include in the invite email + """ + + emails: str + role: InviteTeamMemberParamsRole = InviteTeamMemberParamsRole.DEVELOPER + schema: str | Unset = UNSET + message: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + emails = self.emails + + role = self.role.value + + schema = self.schema + + message = self.message + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "emails": emails, + "role": role, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + if message is not UNSET: + field_dict["message"] = message + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + emails = d.pop("emails") + + role = InviteTeamMemberParamsRole(d.pop("role")) + + schema = d.pop("$schema", UNSET) + + message = d.pop("message", UNSET) + + invite_team_member_params = cls( + emails=emails, + role=role, + schema=schema, + message=message, + ) + + return invite_team_member_params diff --git a/src/tower/tower_api_client/models/invite_team_member_params_role.py b/src/tower/tower_api_client/models/invite_team_member_params_role.py new file mode 100644 index 00000000..d238fd86 --- /dev/null +++ b/src/tower/tower_api_client/models/invite_team_member_params_role.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class InviteTeamMemberParamsRole(str, Enum): + ADMIN = "admin" + DEVELOPER = "developer" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/invite_team_member_response.py b/src/tower/tower_api_client/models/invite_team_member_response.py new file mode 100644 index 00000000..8535d83a --- /dev/null +++ b/src/tower/tower_api_client/models/invite_team_member_response.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.team_invitation import TeamInvitation + + +T = TypeVar("T", bound="InviteTeamMemberResponse") + + +@_attrs_define +class InviteTeamMemberResponse: + """ + Attributes: + team_invitations (list[TeamInvitation]): The team invitation that you created + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/InviteTeamMemberResponse.json. + """ + + team_invitations: list[TeamInvitation] + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + team_invitations = [] + for team_invitations_item_data in self.team_invitations: + team_invitations_item = team_invitations_item_data.to_dict() + team_invitations.append(team_invitations_item) + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "team_invitations": team_invitations, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.team_invitation import TeamInvitation + + d = dict(src_dict) + team_invitations = [] + _team_invitations = d.pop("team_invitations") + for team_invitations_item_data in _team_invitations: + team_invitations_item = TeamInvitation.from_dict(team_invitations_item_data) + + team_invitations.append(team_invitations_item) + + schema = d.pop("$schema", UNSET) + + invite_team_member_response = cls( + team_invitations=team_invitations, + schema=schema, + ) + + return invite_team_member_response diff --git a/src/tower/tower_api_client/models/leave_team_response.py b/src/tower/tower_api_client/models/leave_team_response.py new file mode 100644 index 00000000..85ec9246 --- /dev/null +++ b/src/tower/tower_api_client/models/leave_team_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.team import Team + + +T = TypeVar("T", bound="LeaveTeamResponse") + + +@_attrs_define +class LeaveTeamResponse: + """ + Attributes: + team (Team): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/LeaveTeamResponse.json. + """ + + team: Team + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + team = self.team.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "team": team, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.team import Team + + d = dict(src_dict) + team = Team.from_dict(d.pop("team")) + + schema = d.pop("$schema", UNSET) + + leave_team_response = cls( + team=team, + schema=schema, + ) + + return leave_team_response diff --git a/src/tower/tower_api_client/models/list_alerts_response.py b/src/tower/tower_api_client/models/list_alerts_response.py new file mode 100644 index 00000000..5b2ea4d9 --- /dev/null +++ b/src/tower/tower_api_client/models/list_alerts_response.py @@ -0,0 +1,78 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.alert import Alert + from ..models.pagination import Pagination + + +T = TypeVar("T", bound="ListAlertsResponse") + + +@_attrs_define +class ListAlertsResponse: + """ + Attributes: + alerts (list[Alert]): List of alerts + pages (Pagination): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/ListAlertsResponse.json. + """ + + alerts: list[Alert] + pages: Pagination + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + alerts = [] + for alerts_item_data in self.alerts: + alerts_item = alerts_item_data.to_dict() + alerts.append(alerts_item) + + pages = self.pages.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "alerts": alerts, + "pages": pages, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.alert import Alert + from ..models.pagination import Pagination + + d = dict(src_dict) + alerts = [] + _alerts = d.pop("alerts") + for alerts_item_data in _alerts: + alerts_item = Alert.from_dict(alerts_item_data) + + alerts.append(alerts_item) + + pages = Pagination.from_dict(d.pop("pages")) + + schema = d.pop("$schema", UNSET) + + list_alerts_response = cls( + alerts=alerts, + pages=pages, + schema=schema, + ) + + return list_alerts_response diff --git a/src/tower/tower_api_client/models/list_api_keys_response.py b/src/tower/tower_api_client/models/list_api_keys_response.py new file mode 100644 index 00000000..17522d1b --- /dev/null +++ b/src/tower/tower_api_client/models/list_api_keys_response.py @@ -0,0 +1,78 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.api_key import APIKey + from ..models.pagination import Pagination + + +T = TypeVar("T", bound="ListAPIKeysResponse") + + +@_attrs_define +class ListAPIKeysResponse: + """ + Attributes: + api_keys (list[APIKey]): List of API keys + pages (Pagination): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/ListAPIKeysResponse.json. + """ + + api_keys: list[APIKey] + pages: Pagination + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + api_keys = [] + for api_keys_item_data in self.api_keys: + api_keys_item = api_keys_item_data.to_dict() + api_keys.append(api_keys_item) + + pages = self.pages.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "api_keys": api_keys, + "pages": pages, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.api_key import APIKey + from ..models.pagination import Pagination + + d = dict(src_dict) + api_keys = [] + _api_keys = d.pop("api_keys") + for api_keys_item_data in _api_keys: + api_keys_item = APIKey.from_dict(api_keys_item_data) + + api_keys.append(api_keys_item) + + pages = Pagination.from_dict(d.pop("pages")) + + schema = d.pop("$schema", UNSET) + + list_api_keys_response = cls( + api_keys=api_keys, + pages=pages, + schema=schema, + ) + + return list_api_keys_response diff --git a/src/tower/tower_api_client/models/list_app_environments_response.py b/src/tower/tower_api_client/models/list_app_environments_response.py new file mode 100644 index 00000000..8ce1020e --- /dev/null +++ b/src/tower/tower_api_client/models/list_app_environments_response.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ListAppEnvironmentsResponse") + + +@_attrs_define +class ListAppEnvironmentsResponse: + """ + Attributes: + environments (list[str]): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/ListAppEnvironmentsResponse.json. + """ + + environments: list[str] + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + environments = self.environments + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "environments": environments, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + environments = cast(list[str], d.pop("environments")) + + schema = d.pop("$schema", UNSET) + + list_app_environments_response = cls( + environments=environments, + schema=schema, + ) + + return list_app_environments_response diff --git a/src/tower/tower_api_client/models/list_app_versions_response.py b/src/tower/tower_api_client/models/list_app_versions_response.py new file mode 100644 index 00000000..37be4742 --- /dev/null +++ b/src/tower/tower_api_client/models/list_app_versions_response.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.app_version import AppVersion + + +T = TypeVar("T", bound="ListAppVersionsResponse") + + +@_attrs_define +class ListAppVersionsResponse: + """ + Attributes: + versions (list[AppVersion]): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/ListAppVersionsResponse.json. + """ + + versions: list[AppVersion] + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + versions = [] + for versions_item_data in self.versions: + versions_item = versions_item_data.to_dict() + versions.append(versions_item) + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "versions": versions, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.app_version import AppVersion + + d = dict(src_dict) + versions = [] + _versions = d.pop("versions") + for versions_item_data in _versions: + versions_item = AppVersion.from_dict(versions_item_data) + + versions.append(versions_item) + + schema = d.pop("$schema", UNSET) + + list_app_versions_response = cls( + versions=versions, + schema=schema, + ) + + return list_app_versions_response diff --git a/src/tower/tower_api_client/models/list_apps_filter.py b/src/tower/tower_api_client/models/list_apps_filter.py new file mode 100644 index 00000000..491a047f --- /dev/null +++ b/src/tower/tower_api_client/models/list_apps_filter.py @@ -0,0 +1,12 @@ +from enum import Enum + + +class ListAppsFilter(str, Enum): + DISABLED = "disabled" + HEALTHY = "healthy" + RUNNING = "running" + SCHEDULED = "scheduled" + WITHWARNING = "withWarning" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/list_apps_response.py b/src/tower/tower_api_client/models/list_apps_response.py new file mode 100644 index 00000000..28da64ab --- /dev/null +++ b/src/tower/tower_api_client/models/list_apps_response.py @@ -0,0 +1,78 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.app_summary import AppSummary + from ..models.pagination import Pagination + + +T = TypeVar("T", bound="ListAppsResponse") + + +@_attrs_define +class ListAppsResponse: + """ + Attributes: + apps (list[AppSummary]): + pages (Pagination): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/ListAppsResponse.json. + """ + + apps: list[AppSummary] + pages: Pagination + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + apps = [] + for apps_item_data in self.apps: + apps_item = apps_item_data.to_dict() + apps.append(apps_item) + + pages = self.pages.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "apps": apps, + "pages": pages, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.app_summary import AppSummary + from ..models.pagination import Pagination + + d = dict(src_dict) + apps = [] + _apps = d.pop("apps") + for apps_item_data in _apps: + apps_item = AppSummary.from_dict(apps_item_data) + + apps.append(apps_item) + + pages = Pagination.from_dict(d.pop("pages")) + + schema = d.pop("$schema", UNSET) + + list_apps_response = cls( + apps=apps, + pages=pages, + schema=schema, + ) + + return list_apps_response diff --git a/src/tower/tower_api_client/models/list_apps_sort.py b/src/tower/tower_api_client/models/list_apps_sort.py new file mode 100644 index 00000000..862fe65a --- /dev/null +++ b/src/tower/tower_api_client/models/list_apps_sort.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class ListAppsSort(str, Enum): + A_TO_Z = "a_to_z" + CREATED_AT = "created_at" + MOST_RECENT_RUN = "most_recent_run" + UPDATED_AT = "updated_at" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/list_catalogs_response.py b/src/tower/tower_api_client/models/list_catalogs_response.py new file mode 100644 index 00000000..04518938 --- /dev/null +++ b/src/tower/tower_api_client/models/list_catalogs_response.py @@ -0,0 +1,78 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.catalog import Catalog + from ..models.pagination import Pagination + + +T = TypeVar("T", bound="ListCatalogsResponse") + + +@_attrs_define +class ListCatalogsResponse: + """ + Attributes: + catalogs (list[Catalog]): + pages (Pagination): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/ListCatalogsResponse.json. + """ + + catalogs: list[Catalog] + pages: Pagination + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + catalogs = [] + for catalogs_item_data in self.catalogs: + catalogs_item = catalogs_item_data.to_dict() + catalogs.append(catalogs_item) + + pages = self.pages.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "catalogs": catalogs, + "pages": pages, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.catalog import Catalog + from ..models.pagination import Pagination + + d = dict(src_dict) + catalogs = [] + _catalogs = d.pop("catalogs") + for catalogs_item_data in _catalogs: + catalogs_item = Catalog.from_dict(catalogs_item_data) + + catalogs.append(catalogs_item) + + pages = Pagination.from_dict(d.pop("pages")) + + schema = d.pop("$schema", UNSET) + + list_catalogs_response = cls( + catalogs=catalogs, + pages=pages, + schema=schema, + ) + + return list_catalogs_response diff --git a/src/tower/tower_api_client/models/list_environments_response.py b/src/tower/tower_api_client/models/list_environments_response.py new file mode 100644 index 00000000..73feff5e --- /dev/null +++ b/src/tower/tower_api_client/models/list_environments_response.py @@ -0,0 +1,78 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.environment import Environment + from ..models.pagination import Pagination + + +T = TypeVar("T", bound="ListEnvironmentsResponse") + + +@_attrs_define +class ListEnvironmentsResponse: + """ + Attributes: + environments (list[Environment]): + pages (Pagination): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/ListEnvironmentsResponse.json. + """ + + environments: list[Environment] + pages: Pagination + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + environments = [] + for environments_item_data in self.environments: + environments_item = environments_item_data.to_dict() + environments.append(environments_item) + + pages = self.pages.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "environments": environments, + "pages": pages, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.environment import Environment + from ..models.pagination import Pagination + + d = dict(src_dict) + environments = [] + _environments = d.pop("environments") + for environments_item_data in _environments: + environments_item = Environment.from_dict(environments_item_data) + + environments.append(environments_item) + + pages = Pagination.from_dict(d.pop("pages")) + + schema = d.pop("$schema", UNSET) + + list_environments_response = cls( + environments=environments, + pages=pages, + schema=schema, + ) + + return list_environments_response diff --git a/src/tower/tower_api_client/models/list_guests_response.py b/src/tower/tower_api_client/models/list_guests_response.py new file mode 100644 index 00000000..93fb1221 --- /dev/null +++ b/src/tower/tower_api_client/models/list_guests_response.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.guest import Guest + + +T = TypeVar("T", bound="ListGuestsResponse") + + +@_attrs_define +class ListGuestsResponse: + """ + Attributes: + guests (list[Guest]): List of guests. + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/ListGuestsResponse.json. + """ + + guests: list[Guest] + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + guests = [] + for guests_item_data in self.guests: + guests_item = guests_item_data.to_dict() + guests.append(guests_item) + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "guests": guests, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.guest import Guest + + d = dict(src_dict) + guests = [] + _guests = d.pop("guests") + for guests_item_data in _guests: + guests_item = Guest.from_dict(guests_item_data) + + guests.append(guests_item) + + schema = d.pop("$schema", UNSET) + + list_guests_response = cls( + guests=guests, + schema=schema, + ) + + return list_guests_response diff --git a/src/tower/tower_api_client/models/list_my_team_invitations_response.py b/src/tower/tower_api_client/models/list_my_team_invitations_response.py new file mode 100644 index 00000000..b6fc1a80 --- /dev/null +++ b/src/tower/tower_api_client/models/list_my_team_invitations_response.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.team_invitation import TeamInvitation + + +T = TypeVar("T", bound="ListMyTeamInvitationsResponse") + + +@_attrs_define +class ListMyTeamInvitationsResponse: + """ + Attributes: + team_invitations (list[TeamInvitation]): All of team invitations + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/ListMyTeamInvitationsResponse.json. + """ + + team_invitations: list[TeamInvitation] + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + team_invitations = [] + for team_invitations_item_data in self.team_invitations: + team_invitations_item = team_invitations_item_data.to_dict() + team_invitations.append(team_invitations_item) + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "team_invitations": team_invitations, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.team_invitation import TeamInvitation + + d = dict(src_dict) + team_invitations = [] + _team_invitations = d.pop("team_invitations") + for team_invitations_item_data in _team_invitations: + team_invitations_item = TeamInvitation.from_dict(team_invitations_item_data) + + team_invitations.append(team_invitations_item) + + schema = d.pop("$schema", UNSET) + + list_my_team_invitations_response = cls( + team_invitations=team_invitations, + schema=schema, + ) + + return list_my_team_invitations_response diff --git a/src/tower/tower_api_client/models/list_runners_response.py b/src/tower/tower_api_client/models/list_runners_response.py new file mode 100644 index 00000000..fc85d748 --- /dev/null +++ b/src/tower/tower_api_client/models/list_runners_response.py @@ -0,0 +1,78 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.pagination import Pagination + from ..models.runner import Runner + + +T = TypeVar("T", bound="ListRunnersResponse") + + +@_attrs_define +class ListRunnersResponse: + """ + Attributes: + pages (Pagination): + runners (list[Runner]): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/ListRunnersResponse.json. + """ + + pages: Pagination + runners: list[Runner] + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + pages = self.pages.to_dict() + + runners = [] + for runners_item_data in self.runners: + runners_item = runners_item_data.to_dict() + runners.append(runners_item) + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "pages": pages, + "runners": runners, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.pagination import Pagination + from ..models.runner import Runner + + d = dict(src_dict) + pages = Pagination.from_dict(d.pop("pages")) + + runners = [] + _runners = d.pop("runners") + for runners_item_data in _runners: + runners_item = Runner.from_dict(runners_item_data) + + runners.append(runners_item) + + schema = d.pop("$schema", UNSET) + + list_runners_response = cls( + pages=pages, + runners=runners, + schema=schema, + ) + + return list_runners_response diff --git a/src/tower/tower_api_client/models/list_runs_response.py b/src/tower/tower_api_client/models/list_runs_response.py new file mode 100644 index 00000000..75be46f1 --- /dev/null +++ b/src/tower/tower_api_client/models/list_runs_response.py @@ -0,0 +1,78 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.pagination import Pagination + from ..models.run import Run + + +T = TypeVar("T", bound="ListRunsResponse") + + +@_attrs_define +class ListRunsResponse: + """ + Attributes: + pages (Pagination): + runs (list[Run]): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/ListRunsResponse.json. + """ + + pages: Pagination + runs: list[Run] + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + pages = self.pages.to_dict() + + runs = [] + for runs_item_data in self.runs: + runs_item = runs_item_data.to_dict() + runs.append(runs_item) + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "pages": pages, + "runs": runs, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.pagination import Pagination + from ..models.run import Run + + d = dict(src_dict) + pages = Pagination.from_dict(d.pop("pages")) + + runs = [] + _runs = d.pop("runs") + for runs_item_data in _runs: + runs_item = Run.from_dict(runs_item_data) + + runs.append(runs_item) + + schema = d.pop("$schema", UNSET) + + list_runs_response = cls( + pages=pages, + runs=runs, + schema=schema, + ) + + return list_runs_response diff --git a/src/tower/tower_api_client/models/list_runs_status_item.py b/src/tower/tower_api_client/models/list_runs_status_item.py new file mode 100644 index 00000000..b05f9cca --- /dev/null +++ b/src/tower/tower_api_client/models/list_runs_status_item.py @@ -0,0 +1,15 @@ +from enum import Enum + + +class ListRunsStatusItem(str, Enum): + CANCELLED = "cancelled" + CRASHED = "crashed" + ERRORED = "errored" + EXITED = "exited" + PENDING = "pending" + RETRYING = "retrying" + RUNNING = "running" + STARTING = "starting" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/list_schedules_response.py b/src/tower/tower_api_client/models/list_schedules_response.py new file mode 100644 index 00000000..7670394f --- /dev/null +++ b/src/tower/tower_api_client/models/list_schedules_response.py @@ -0,0 +1,78 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.pagination import Pagination + from ..models.schedule import Schedule + + +T = TypeVar("T", bound="ListSchedulesResponse") + + +@_attrs_define +class ListSchedulesResponse: + """ + Attributes: + pages (Pagination): + schedules (list[Schedule]): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/ListSchedulesResponse.json. + """ + + pages: Pagination + schedules: list[Schedule] + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + pages = self.pages.to_dict() + + schedules = [] + for schedules_item_data in self.schedules: + schedules_item = schedules_item_data.to_dict() + schedules.append(schedules_item) + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "pages": pages, + "schedules": schedules, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.pagination import Pagination + from ..models.schedule import Schedule + + d = dict(src_dict) + pages = Pagination.from_dict(d.pop("pages")) + + schedules = [] + _schedules = d.pop("schedules") + for schedules_item_data in _schedules: + schedules_item = Schedule.from_dict(schedules_item_data) + + schedules.append(schedules_item) + + schema = d.pop("$schema", UNSET) + + list_schedules_response = cls( + pages=pages, + schedules=schedules, + schema=schema, + ) + + return list_schedules_response diff --git a/src/tower/tower_api_client/models/list_secret_environments_response.py b/src/tower/tower_api_client/models/list_secret_environments_response.py new file mode 100644 index 00000000..799a78eb --- /dev/null +++ b/src/tower/tower_api_client/models/list_secret_environments_response.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ListSecretEnvironmentsResponse") + + +@_attrs_define +class ListSecretEnvironmentsResponse: + """ + Attributes: + environments (list[str]): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/ListSecretEnvironmentsResponse.json. + """ + + environments: list[str] + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + environments = self.environments + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "environments": environments, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + environments = cast(list[str], d.pop("environments")) + + schema = d.pop("$schema", UNSET) + + list_secret_environments_response = cls( + environments=environments, + schema=schema, + ) + + return list_secret_environments_response diff --git a/src/tower/tower_api_client/models/list_secrets_response.py b/src/tower/tower_api_client/models/list_secrets_response.py new file mode 100644 index 00000000..d1a299ec --- /dev/null +++ b/src/tower/tower_api_client/models/list_secrets_response.py @@ -0,0 +1,78 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.pagination import Pagination + from ..models.secret import Secret + + +T = TypeVar("T", bound="ListSecretsResponse") + + +@_attrs_define +class ListSecretsResponse: + """ + Attributes: + pages (Pagination): + secrets (list[Secret]): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/ListSecretsResponse.json. + """ + + pages: Pagination + secrets: list[Secret] + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + pages = self.pages.to_dict() + + secrets = [] + for secrets_item_data in self.secrets: + secrets_item = secrets_item_data.to_dict() + secrets.append(secrets_item) + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "pages": pages, + "secrets": secrets, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.pagination import Pagination + from ..models.secret import Secret + + d = dict(src_dict) + pages = Pagination.from_dict(d.pop("pages")) + + secrets = [] + _secrets = d.pop("secrets") + for secrets_item_data in _secrets: + secrets_item = Secret.from_dict(secrets_item_data) + + secrets.append(secrets_item) + + schema = d.pop("$schema", UNSET) + + list_secrets_response = cls( + pages=pages, + secrets=secrets, + schema=schema, + ) + + return list_secrets_response diff --git a/src/tower/tower_api_client/models/list_team_invitations_response.py b/src/tower/tower_api_client/models/list_team_invitations_response.py new file mode 100644 index 00000000..0fd34e11 --- /dev/null +++ b/src/tower/tower_api_client/models/list_team_invitations_response.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.team_invitation import TeamInvitation + + +T = TypeVar("T", bound="ListTeamInvitationsResponse") + + +@_attrs_define +class ListTeamInvitationsResponse: + """ + Attributes: + team_invitations (list[TeamInvitation]): All of team invitations + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/ListTeamInvitationsResponse.json. + """ + + team_invitations: list[TeamInvitation] + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + team_invitations = [] + for team_invitations_item_data in self.team_invitations: + team_invitations_item = team_invitations_item_data.to_dict() + team_invitations.append(team_invitations_item) + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "team_invitations": team_invitations, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.team_invitation import TeamInvitation + + d = dict(src_dict) + team_invitations = [] + _team_invitations = d.pop("team_invitations") + for team_invitations_item_data in _team_invitations: + team_invitations_item = TeamInvitation.from_dict(team_invitations_item_data) + + team_invitations.append(team_invitations_item) + + schema = d.pop("$schema", UNSET) + + list_team_invitations_response = cls( + team_invitations=team_invitations, + schema=schema, + ) + + return list_team_invitations_response diff --git a/src/tower/tower_api_client/models/list_team_members_response.py b/src/tower/tower_api_client/models/list_team_members_response.py new file mode 100644 index 00000000..c20150f2 --- /dev/null +++ b/src/tower/tower_api_client/models/list_team_members_response.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.team_membership import TeamMembership + + +T = TypeVar("T", bound="ListTeamMembersResponse") + + +@_attrs_define +class ListTeamMembersResponse: + """ + Attributes: + team_members (list[TeamMembership]): All of the members of a team + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/ListTeamMembersResponse.json. + """ + + team_members: list[TeamMembership] + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + team_members = [] + for team_members_item_data in self.team_members: + team_members_item = team_members_item_data.to_dict() + team_members.append(team_members_item) + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "team_members": team_members, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.team_membership import TeamMembership + + d = dict(src_dict) + team_members = [] + _team_members = d.pop("team_members") + for team_members_item_data in _team_members: + team_members_item = TeamMembership.from_dict(team_members_item_data) + + team_members.append(team_members_item) + + schema = d.pop("$schema", UNSET) + + list_team_members_response = cls( + team_members=team_members, + schema=schema, + ) + + return list_team_members_response diff --git a/src/tower/tower_api_client/models/list_teams_response.py b/src/tower/tower_api_client/models/list_teams_response.py new file mode 100644 index 00000000..961554d6 --- /dev/null +++ b/src/tower/tower_api_client/models/list_teams_response.py @@ -0,0 +1,78 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.pagination import Pagination + from ..models.team import Team + + +T = TypeVar("T", bound="ListTeamsResponse") + + +@_attrs_define +class ListTeamsResponse: + """ + Attributes: + pages (Pagination): + teams (list[Team]): List of teams + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/ListTeamsResponse.json. + """ + + pages: Pagination + teams: list[Team] + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + pages = self.pages.to_dict() + + teams = [] + for teams_item_data in self.teams: + teams_item = teams_item_data.to_dict() + teams.append(teams_item) + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "pages": pages, + "teams": teams, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.pagination import Pagination + from ..models.team import Team + + d = dict(src_dict) + pages = Pagination.from_dict(d.pop("pages")) + + teams = [] + _teams = d.pop("teams") + for teams_item_data in _teams: + teams_item = Team.from_dict(teams_item_data) + + teams.append(teams_item) + + schema = d.pop("$schema", UNSET) + + list_teams_response = cls( + pages=pages, + teams=teams, + schema=schema, + ) + + return list_teams_response diff --git a/src/tower/tower_api_client/models/list_webhooks_response.py b/src/tower/tower_api_client/models/list_webhooks_response.py new file mode 100644 index 00000000..c6e55a66 --- /dev/null +++ b/src/tower/tower_api_client/models/list_webhooks_response.py @@ -0,0 +1,78 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.pagination import Pagination + from ..models.webhook import Webhook + + +T = TypeVar("T", bound="ListWebhooksResponse") + + +@_attrs_define +class ListWebhooksResponse: + """ + Attributes: + pages (Pagination): + webhooks (list[Webhook]): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/ListWebhooksResponse.json. + """ + + pages: Pagination + webhooks: list[Webhook] + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + pages = self.pages.to_dict() + + webhooks = [] + for webhooks_item_data in self.webhooks: + webhooks_item = webhooks_item_data.to_dict() + webhooks.append(webhooks_item) + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "pages": pages, + "webhooks": webhooks, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.pagination import Pagination + from ..models.webhook import Webhook + + d = dict(src_dict) + pages = Pagination.from_dict(d.pop("pages")) + + webhooks = [] + _webhooks = d.pop("webhooks") + for webhooks_item_data in _webhooks: + webhooks_item = Webhook.from_dict(webhooks_item_data) + + webhooks.append(webhooks_item) + + schema = d.pop("$schema", UNSET) + + list_webhooks_response = cls( + pages=pages, + webhooks=webhooks, + schema=schema, + ) + + return list_webhooks_response diff --git a/src/tower/tower_api_client/models/organization.py b/src/tower/tower_api_client/models/organization.py new file mode 100644 index 00000000..8fe5c4a3 --- /dev/null +++ b/src/tower/tower_api_client/models/organization.py @@ -0,0 +1,56 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +if TYPE_CHECKING: + from ..models.user import User + + +T = TypeVar("T", bound="Organization") + + +@_attrs_define +class Organization: + """ + Attributes: + name (str): The name of the organization + owner (User): + """ + + name: str + owner: User + + def to_dict(self) -> dict[str, Any]: + name = self.name + + owner = self.owner.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "name": name, + "owner": owner, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.user import User + + d = dict(src_dict) + name = d.pop("name") + + owner = User.from_dict(d.pop("owner")) + + organization = cls( + name=name, + owner=owner, + ) + + return organization diff --git a/src/tower/tower_api_client/models/organization_usage.py b/src/tower/tower_api_client/models/organization_usage.py new file mode 100644 index 00000000..a1d98ca3 --- /dev/null +++ b/src/tower/tower_api_client/models/organization_usage.py @@ -0,0 +1,108 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.usage_limit import UsageLimit + + +T = TypeVar("T", bound="OrganizationUsage") + + +@_attrs_define +class OrganizationUsage: + """ + Attributes: + active_schedules (UsageLimit): + apps (UsageLimit): + base_plan_name (str): The name of the organization's base plan. + compute_minutes (UsageLimit): + members (UsageLimit): + organization_name (str): The name of the organization. + self_hosted_runners (UsageLimit): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/OrganizationUsage.json. + """ + + active_schedules: UsageLimit + apps: UsageLimit + base_plan_name: str + compute_minutes: UsageLimit + members: UsageLimit + organization_name: str + self_hosted_runners: UsageLimit + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + active_schedules = self.active_schedules.to_dict() + + apps = self.apps.to_dict() + + base_plan_name = self.base_plan_name + + compute_minutes = self.compute_minutes.to_dict() + + members = self.members.to_dict() + + organization_name = self.organization_name + + self_hosted_runners = self.self_hosted_runners.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "active_schedules": active_schedules, + "apps": apps, + "base_plan_name": base_plan_name, + "compute_minutes": compute_minutes, + "members": members, + "organization_name": organization_name, + "self_hosted_runners": self_hosted_runners, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.usage_limit import UsageLimit + + d = dict(src_dict) + active_schedules = UsageLimit.from_dict(d.pop("active_schedules")) + + apps = UsageLimit.from_dict(d.pop("apps")) + + base_plan_name = d.pop("base_plan_name") + + compute_minutes = UsageLimit.from_dict(d.pop("compute_minutes")) + + members = UsageLimit.from_dict(d.pop("members")) + + organization_name = d.pop("organization_name") + + self_hosted_runners = UsageLimit.from_dict(d.pop("self_hosted_runners")) + + schema = d.pop("$schema", UNSET) + + organization_usage = cls( + active_schedules=active_schedules, + apps=apps, + base_plan_name=base_plan_name, + compute_minutes=compute_minutes, + members=members, + organization_name=organization_name, + self_hosted_runners=self_hosted_runners, + schema=schema, + ) + + return organization_usage diff --git a/src/tower/tower_api_client/models/pagination.py b/src/tower/tower_api_client/models/pagination.py new file mode 100644 index 00000000..70bef512 --- /dev/null +++ b/src/tower/tower_api_client/models/pagination.py @@ -0,0 +1,66 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="Pagination") + + +@_attrs_define +class Pagination: + """ + Attributes: + num_pages (int): + page (int): + page_size (int): + total (int): + """ + + num_pages: int + page: int + page_size: int + total: int + + def to_dict(self) -> dict[str, Any]: + num_pages = self.num_pages + + page = self.page + + page_size = self.page_size + + total = self.total + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "num_pages": num_pages, + "page": page, + "page_size": page_size, + "total": total, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + num_pages = d.pop("num_pages") + + page = d.pop("page") + + page_size = d.pop("page_size") + + total = d.pop("total") + + pagination = cls( + num_pages=num_pages, + page=page, + page_size=page_size, + total=total, + ) + + return pagination diff --git a/src/tower/tower_api_client/models/parameter.py b/src/tower/tower_api_client/models/parameter.py new file mode 100644 index 00000000..131d5881 --- /dev/null +++ b/src/tower/tower_api_client/models/parameter.py @@ -0,0 +1,69 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="Parameter") + + +@_attrs_define +class Parameter: + """ + Attributes: + default (str): + description (str): + name (str): + hidden (bool | Unset): Whether this parameter is hidden/secret. Defaults to false. Default: False. + """ + + default: str + description: str + name: str + hidden: bool | Unset = False + + def to_dict(self) -> dict[str, Any]: + default = self.default + + description = self.description + + name = self.name + + hidden = self.hidden + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "default": default, + "description": description, + "name": name, + } + ) + if hidden is not UNSET: + field_dict["hidden"] = hidden + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + default = d.pop("default") + + description = d.pop("description") + + name = d.pop("name") + + hidden = d.pop("hidden", UNSET) + + parameter = cls( + default=default, + description=description, + name=name, + hidden=hidden, + ) + + return parameter diff --git a/src/tower/tower_api_client/models/plan.py b/src/tower/tower_api_client/models/plan.py new file mode 100644 index 00000000..83476e8c --- /dev/null +++ b/src/tower/tower_api_client/models/plan.py @@ -0,0 +1,129 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.feature import Feature + + +T = TypeVar("T", bound="Plan") + + +@_attrs_define +class Plan: + """ + Attributes: + base_plan_name (str): + created_at (datetime.datetime): + features (list[Feature]): + id (str): + start_at (datetime.datetime): + end_at (datetime.datetime | Unset): + extras (list[Feature] | Unset): + """ + + base_plan_name: str + created_at: datetime.datetime + features: list[Feature] + id: str + start_at: datetime.datetime + end_at: datetime.datetime | Unset = UNSET + extras: list[Feature] | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + base_plan_name = self.base_plan_name + + created_at = self.created_at.isoformat() + + features = [] + for features_item_data in self.features: + features_item = features_item_data.to_dict() + features.append(features_item) + + id = self.id + + start_at = self.start_at.isoformat() + + end_at: str | Unset = UNSET + if not isinstance(self.end_at, Unset): + end_at = self.end_at.isoformat() + + extras: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.extras, Unset): + extras = [] + for extras_item_data in self.extras: + extras_item = extras_item_data.to_dict() + extras.append(extras_item) + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "base_plan_name": base_plan_name, + "created_at": created_at, + "features": features, + "id": id, + "start_at": start_at, + } + ) + if end_at is not UNSET: + field_dict["end_at"] = end_at + if extras is not UNSET: + field_dict["extras"] = extras + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.feature import Feature + + d = dict(src_dict) + base_plan_name = d.pop("base_plan_name") + + created_at = isoparse(d.pop("created_at")) + + features = [] + _features = d.pop("features") + for features_item_data in _features: + features_item = Feature.from_dict(features_item_data) + + features.append(features_item) + + id = d.pop("id") + + start_at = isoparse(d.pop("start_at")) + + _end_at = d.pop("end_at", UNSET) + end_at: datetime.datetime | Unset + if isinstance(_end_at, Unset): + end_at = UNSET + else: + end_at = isoparse(_end_at) + + _extras = d.pop("extras", UNSET) + extras: list[Feature] | Unset = UNSET + if _extras is not UNSET: + extras = [] + for extras_item_data in _extras: + extras_item = Feature.from_dict(extras_item_data) + + extras.append(extras_item) + + plan = cls( + base_plan_name=base_plan_name, + created_at=created_at, + features=features, + id=id, + start_at=start_at, + end_at=end_at, + extras=extras, + ) + + return plan diff --git a/src/tower/tower_api_client/models/refresh_session_params.py b/src/tower/tower_api_client/models/refresh_session_params.py new file mode 100644 index 00000000..eda44ee8 --- /dev/null +++ b/src/tower/tower_api_client/models/refresh_session_params.py @@ -0,0 +1,52 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="RefreshSessionParams") + + +@_attrs_define +class RefreshSessionParams: + """ + Attributes: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/RefreshSessionParams.json. + refresh_token (str | Unset): The refresh token associated with the session to refresh. + """ + + schema: str | Unset = UNSET + refresh_token: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + schema = self.schema + + refresh_token = self.refresh_token + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if schema is not UNSET: + field_dict["$schema"] = schema + if refresh_token is not UNSET: + field_dict["refresh_token"] = refresh_token + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + schema = d.pop("$schema", UNSET) + + refresh_token = d.pop("refresh_token", UNSET) + + refresh_session_params = cls( + schema=schema, + refresh_token=refresh_token, + ) + + return refresh_session_params diff --git a/src/tower/tower_api_client/models/refresh_session_response.py b/src/tower/tower_api_client/models/refresh_session_response.py new file mode 100644 index 00000000..6a89f6f6 --- /dev/null +++ b/src/tower/tower_api_client/models/refresh_session_response.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.session import Session + + +T = TypeVar("T", bound="RefreshSessionResponse") + + +@_attrs_define +class RefreshSessionResponse: + """ + Attributes: + refreshed_at (datetime.datetime): A timestamp that indicates the last time the session data was refreshed. + session (Session): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/RefreshSessionResponse.json. + """ + + refreshed_at: datetime.datetime + session: Session + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + refreshed_at = self.refreshed_at.isoformat() + + session = self.session.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "refreshed_at": refreshed_at, + "session": session, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.session import Session + + d = dict(src_dict) + refreshed_at = isoparse(d.pop("refreshed_at")) + + session = Session.from_dict(d.pop("session")) + + schema = d.pop("$schema", UNSET) + + refresh_session_response = cls( + refreshed_at=refreshed_at, + session=session, + schema=schema, + ) + + return refresh_session_response diff --git a/src/tower/tower_api_client/models/regenerate_guest_login_url_params.py b/src/tower/tower_api_client/models/regenerate_guest_login_url_params.py new file mode 100644 index 00000000..19df8977 --- /dev/null +++ b/src/tower/tower_api_client/models/regenerate_guest_login_url_params.py @@ -0,0 +1,62 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="RegenerateGuestLoginURLParams") + + +@_attrs_define +class RegenerateGuestLoginURLParams: + """ + Attributes: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/RegenerateGuestLoginURLParams.json. + expires_in (int | Unset): The number of seconds the guest session should last. Defaults to 72 hours. Default: + 259200. + redirect_url (str | Unset): Where to redirect the guest after they log in. + """ + + schema: str | Unset = UNSET + expires_in: int | Unset = 259200 + redirect_url: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + schema = self.schema + + expires_in = self.expires_in + + redirect_url = self.redirect_url + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if schema is not UNSET: + field_dict["$schema"] = schema + if expires_in is not UNSET: + field_dict["expires_in"] = expires_in + if redirect_url is not UNSET: + field_dict["redirect_url"] = redirect_url + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + schema = d.pop("$schema", UNSET) + + expires_in = d.pop("expires_in", UNSET) + + redirect_url = d.pop("redirect_url", UNSET) + + regenerate_guest_login_url_params = cls( + schema=schema, + expires_in=expires_in, + redirect_url=redirect_url, + ) + + return regenerate_guest_login_url_params diff --git a/src/tower/tower_api_client/models/regenerate_guest_login_url_response.py b/src/tower/tower_api_client/models/regenerate_guest_login_url_response.py new file mode 100644 index 00000000..e88cb120 --- /dev/null +++ b/src/tower/tower_api_client/models/regenerate_guest_login_url_response.py @@ -0,0 +1,64 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="RegenerateGuestLoginURLResponse") + + +@_attrs_define +class RegenerateGuestLoginURLResponse: + """ + Attributes: + login_url (str): The new login URL to share with the guest. + login_url_expires_at (datetime.datetime): When the login URL expires. + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/RegenerateGuestLoginURLResponse.json. + """ + + login_url: str + login_url_expires_at: datetime.datetime + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + login_url = self.login_url + + login_url_expires_at = self.login_url_expires_at.isoformat() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "login_url": login_url, + "login_url_expires_at": login_url_expires_at, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + login_url = d.pop("login_url") + + login_url_expires_at = isoparse(d.pop("login_url_expires_at")) + + schema = d.pop("$schema", UNSET) + + regenerate_guest_login_url_response = cls( + login_url=login_url, + login_url_expires_at=login_url_expires_at, + schema=schema, + ) + + return regenerate_guest_login_url_response diff --git a/src/tower/tower_api_client/models/remove_team_member_params.py b/src/tower/tower_api_client/models/remove_team_member_params.py new file mode 100644 index 00000000..b852edc7 --- /dev/null +++ b/src/tower/tower_api_client/models/remove_team_member_params.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="RemoveTeamMemberParams") + + +@_attrs_define +class RemoveTeamMemberParams: + """ + Attributes: + email (str): The email address of the team member to remove + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/RemoveTeamMemberParams.json. + """ + + email: str + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + email = self.email + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "email": email, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + email = d.pop("email") + + schema = d.pop("$schema", UNSET) + + remove_team_member_params = cls( + email=email, + schema=schema, + ) + + return remove_team_member_params diff --git a/src/tower/tower_api_client/models/remove_team_member_response.py b/src/tower/tower_api_client/models/remove_team_member_response.py new file mode 100644 index 00000000..cbcb1551 --- /dev/null +++ b/src/tower/tower_api_client/models/remove_team_member_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.user import User + + +T = TypeVar("T", bound="RemoveTeamMemberResponse") + + +@_attrs_define +class RemoveTeamMemberResponse: + """ + Attributes: + team_member (User): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/RemoveTeamMemberResponse.json. + """ + + team_member: User + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + team_member = self.team_member.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "team_member": team_member, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.user import User + + d = dict(src_dict) + team_member = User.from_dict(d.pop("team_member")) + + schema = d.pop("$schema", UNSET) + + remove_team_member_response = cls( + team_member=team_member, + schema=schema, + ) + + return remove_team_member_response diff --git a/src/tower/tower_api_client/models/resend_team_invitation_params.py b/src/tower/tower_api_client/models/resend_team_invitation_params.py new file mode 100644 index 00000000..3a9db89e --- /dev/null +++ b/src/tower/tower_api_client/models/resend_team_invitation_params.py @@ -0,0 +1,63 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ResendTeamInvitationParams") + + +@_attrs_define +class ResendTeamInvitationParams: + """ + Attributes: + email (str): The email address of team invitation to resend + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/ResendTeamInvitationParams.json. + message (str | Unset): Optional message to include in the invite email + """ + + email: str + schema: str | Unset = UNSET + message: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + email = self.email + + schema = self.schema + + message = self.message + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "email": email, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + if message is not UNSET: + field_dict["message"] = message + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + email = d.pop("email") + + schema = d.pop("$schema", UNSET) + + message = d.pop("message", UNSET) + + resend_team_invitation_params = cls( + email=email, + schema=schema, + message=message, + ) + + return resend_team_invitation_params diff --git a/src/tower/tower_api_client/models/resend_team_invitation_response.py b/src/tower/tower_api_client/models/resend_team_invitation_response.py new file mode 100644 index 00000000..4f7bf899 --- /dev/null +++ b/src/tower/tower_api_client/models/resend_team_invitation_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.team_invitation import TeamInvitation + + +T = TypeVar("T", bound="ResendTeamInvitationResponse") + + +@_attrs_define +class ResendTeamInvitationResponse: + """ + Attributes: + team_invitation (TeamInvitation): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/ResendTeamInvitationResponse.json. + """ + + team_invitation: TeamInvitation + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + team_invitation = self.team_invitation.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "team_invitation": team_invitation, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.team_invitation import TeamInvitation + + d = dict(src_dict) + team_invitation = TeamInvitation.from_dict(d.pop("team_invitation")) + + schema = d.pop("$schema", UNSET) + + resend_team_invitation_response = cls( + team_invitation=team_invitation, + schema=schema, + ) + + return resend_team_invitation_response diff --git a/src/tower/tower_api_client/models/run.py b/src/tower/tower_api_client/models/run.py new file mode 100644 index 00000000..748503d9 --- /dev/null +++ b/src/tower/tower_api_client/models/run.py @@ -0,0 +1,363 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.run_status import RunStatus +from ..models.run_status_group import RunStatusGroup +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.run_attempt import RunAttempt + from ..models.run_initiator import RunInitiator + from ..models.run_parameter import RunParameter + from ..models.run_retry_policy import RunRetryPolicy + + +T = TypeVar("T", bound="Run") + + +@_attrs_define +class Run: + """ + Attributes: + link (str): $link is deprecated. Individual responses include links. + app_name (str): + app_version (str): + cancelled_at (datetime.datetime | None): + created_at (datetime.datetime): + ended_at (datetime.datetime | None): + environment (str): + exit_code (int | None): Exit code of the run, if the run is completed. Null if there is no exit code + initiator (RunInitiator): + is_scheduled (bool): Whether this run was triggered by a schedule (true) or on-demand (false). Historical + records default to false. + num_attempts (int): Number of attempts for this run (1 = original, 2+ = retries). + number (int): + parameters (list[RunParameter]): Parameters used to invoke this run. + run_id (str): + scheduled_at (datetime.datetime): + started_at (datetime.datetime | None): When the run started executing your code. + starting_at (datetime.datetime | None): When the runner environment started to get setup. + status (RunStatus): + status_group (RunStatusGroup): + app_slug (str | Unset): This property is deprecated. Use app_name instead. + attempts (list[RunAttempt] | Unset): Previous attempt details. Populated on describe, omitted on list. + hostname (str | Unset): hostname is deprecated, use subdomain + retry_policy (RunRetryPolicy | Unset): + subdomain (None | str | Unset): If app is externally accessible, then you can access this run with this + hostname. + """ + + link: str + app_name: str + app_version: str + cancelled_at: datetime.datetime | None + created_at: datetime.datetime + ended_at: datetime.datetime | None + environment: str + exit_code: int | None + initiator: RunInitiator + is_scheduled: bool + num_attempts: int + number: int + parameters: list[RunParameter] + run_id: str + scheduled_at: datetime.datetime + started_at: datetime.datetime | None + starting_at: datetime.datetime | None + status: RunStatus + status_group: RunStatusGroup + app_slug: str | Unset = UNSET + attempts: list[RunAttempt] | Unset = UNSET + hostname: str | Unset = UNSET + retry_policy: RunRetryPolicy | Unset = UNSET + subdomain: None | str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + link = self.link + + app_name = self.app_name + + app_version = self.app_version + + cancelled_at: None | str + if isinstance(self.cancelled_at, datetime.datetime): + cancelled_at = self.cancelled_at.isoformat() + else: + cancelled_at = self.cancelled_at + + created_at = self.created_at.isoformat() + + ended_at: None | str + if isinstance(self.ended_at, datetime.datetime): + ended_at = self.ended_at.isoformat() + else: + ended_at = self.ended_at + + environment = self.environment + + exit_code: int | None + exit_code = self.exit_code + + initiator = self.initiator.to_dict() + + is_scheduled = self.is_scheduled + + num_attempts = self.num_attempts + + number = self.number + + parameters = [] + for parameters_item_data in self.parameters: + parameters_item = parameters_item_data.to_dict() + parameters.append(parameters_item) + + run_id = self.run_id + + scheduled_at = self.scheduled_at.isoformat() + + started_at: None | str + if isinstance(self.started_at, datetime.datetime): + started_at = self.started_at.isoformat() + else: + started_at = self.started_at + + starting_at: None | str + if isinstance(self.starting_at, datetime.datetime): + starting_at = self.starting_at.isoformat() + else: + starting_at = self.starting_at + + status = self.status.value + + status_group = self.status_group.value + + app_slug = self.app_slug + + attempts: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.attempts, Unset): + attempts = [] + for attempts_item_data in self.attempts: + attempts_item = attempts_item_data.to_dict() + attempts.append(attempts_item) + + hostname = self.hostname + + retry_policy: dict[str, Any] | Unset = UNSET + if not isinstance(self.retry_policy, Unset): + retry_policy = self.retry_policy.to_dict() + + subdomain: None | str | Unset + if isinstance(self.subdomain, Unset): + subdomain = UNSET + else: + subdomain = self.subdomain + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "$link": link, + "app_name": app_name, + "app_version": app_version, + "cancelled_at": cancelled_at, + "created_at": created_at, + "ended_at": ended_at, + "environment": environment, + "exit_code": exit_code, + "initiator": initiator, + "is_scheduled": is_scheduled, + "num_attempts": num_attempts, + "number": number, + "parameters": parameters, + "run_id": run_id, + "scheduled_at": scheduled_at, + "started_at": started_at, + "starting_at": starting_at, + "status": status, + "status_group": status_group, + } + ) + if app_slug is not UNSET: + field_dict["app_slug"] = app_slug + if attempts is not UNSET: + field_dict["attempts"] = attempts + if hostname is not UNSET: + field_dict["hostname"] = hostname + if retry_policy is not UNSET: + field_dict["retry_policy"] = retry_policy + if subdomain is not UNSET: + field_dict["subdomain"] = subdomain + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.run_attempt import RunAttempt + from ..models.run_initiator import RunInitiator + from ..models.run_parameter import RunParameter + from ..models.run_retry_policy import RunRetryPolicy + + d = dict(src_dict) + link = d.pop("$link") + + app_name = d.pop("app_name") + + app_version = d.pop("app_version") + + def _parse_cancelled_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + cancelled_at_type_0 = isoparse(data) + + return cancelled_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + cancelled_at = _parse_cancelled_at(d.pop("cancelled_at")) + + created_at = isoparse(d.pop("created_at")) + + def _parse_ended_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + ended_at_type_0 = isoparse(data) + + return ended_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + ended_at = _parse_ended_at(d.pop("ended_at")) + + environment = d.pop("environment") + + def _parse_exit_code(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + exit_code = _parse_exit_code(d.pop("exit_code")) + + initiator = RunInitiator.from_dict(d.pop("initiator")) + + is_scheduled = d.pop("is_scheduled") + + num_attempts = d.pop("num_attempts") + + number = d.pop("number") + + parameters = [] + _parameters = d.pop("parameters") + for parameters_item_data in _parameters: + parameters_item = RunParameter.from_dict(parameters_item_data) + + parameters.append(parameters_item) + + run_id = d.pop("run_id") + + scheduled_at = isoparse(d.pop("scheduled_at")) + + def _parse_started_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + started_at_type_0 = isoparse(data) + + return started_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + started_at = _parse_started_at(d.pop("started_at")) + + def _parse_starting_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + starting_at_type_0 = isoparse(data) + + return starting_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + starting_at = _parse_starting_at(d.pop("starting_at")) + + status = RunStatus(d.pop("status")) + + status_group = RunStatusGroup(d.pop("status_group")) + + app_slug = d.pop("app_slug", UNSET) + + _attempts = d.pop("attempts", UNSET) + attempts: list[RunAttempt] | Unset = UNSET + if _attempts is not UNSET: + attempts = [] + for attempts_item_data in _attempts: + attempts_item = RunAttempt.from_dict(attempts_item_data) + + attempts.append(attempts_item) + + hostname = d.pop("hostname", UNSET) + + _retry_policy = d.pop("retry_policy", UNSET) + retry_policy: RunRetryPolicy | Unset + if isinstance(_retry_policy, Unset): + retry_policy = UNSET + else: + retry_policy = RunRetryPolicy.from_dict(_retry_policy) + + def _parse_subdomain(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + subdomain = _parse_subdomain(d.pop("subdomain", UNSET)) + + run = cls( + link=link, + app_name=app_name, + app_version=app_version, + cancelled_at=cancelled_at, + created_at=created_at, + ended_at=ended_at, + environment=environment, + exit_code=exit_code, + initiator=initiator, + is_scheduled=is_scheduled, + num_attempts=num_attempts, + number=number, + parameters=parameters, + run_id=run_id, + scheduled_at=scheduled_at, + started_at=started_at, + starting_at=starting_at, + status=status, + status_group=status_group, + app_slug=app_slug, + attempts=attempts, + hostname=hostname, + retry_policy=retry_policy, + subdomain=subdomain, + ) + + return run diff --git a/src/tower/tower_api_client/models/run_app_initiator_data.py b/src/tower/tower_api_client/models/run_app_initiator_data.py new file mode 100644 index 00000000..36a382bd --- /dev/null +++ b/src/tower/tower_api_client/models/run_app_initiator_data.py @@ -0,0 +1,44 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.run_app_initiator_data_type import RunAppInitiatorDataType + +T = TypeVar("T", bound="RunAppInitiatorData") + + +@_attrs_define +class RunAppInitiatorData: + """ + Attributes: + type_ (RunAppInitiatorDataType): The type of the initiator for this run. + """ + + type_: RunAppInitiatorDataType + + def to_dict(self) -> dict[str, Any]: + type_ = self.type_.value + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "type": type_, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + type_ = RunAppInitiatorDataType(d.pop("type")) + + run_app_initiator_data = cls( + type_=type_, + ) + + return run_app_initiator_data diff --git a/src/tower/tower_api_client/models/run_app_initiator_data_type.py b/src/tower/tower_api_client/models/run_app_initiator_data_type.py new file mode 100644 index 00000000..eb4a1b8b --- /dev/null +++ b/src/tower/tower_api_client/models/run_app_initiator_data_type.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class RunAppInitiatorDataType(str, Enum): + TOWER_CLI = "tower_cli" + TOWER_RUN = "tower_run" + TOWER_UI = "tower_ui" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/run_app_params.py b/src/tower/tower_api_client/models/run_app_params.py new file mode 100644 index 00000000..f403796f --- /dev/null +++ b/src/tower/tower_api_client/models/run_app_params.py @@ -0,0 +1,125 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.run_app_initiator_data import RunAppInitiatorData + from ..models.run_app_params_parameters import RunAppParamsParameters + from ..models.run_retry_policy import RunRetryPolicy + + +T = TypeVar("T", bound="RunAppParams") + + +@_attrs_define +class RunAppParams: + """ + Attributes: + environment (str): The environment to run this app in. + parameters (RunAppParamsParameters): The parameters to pass into this app. + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/RunAppParams.json. + initiator (RunAppInitiatorData | Unset): + parent_run_id (None | str | Unset): The ID of the run that invoked this run, if relevant. Should be null, if + none. + retry_policy (RunRetryPolicy | Unset): + """ + + environment: str + parameters: RunAppParamsParameters + schema: str | Unset = UNSET + initiator: RunAppInitiatorData | Unset = UNSET + parent_run_id: None | str | Unset = UNSET + retry_policy: RunRetryPolicy | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + environment = self.environment + + parameters = self.parameters.to_dict() + + schema = self.schema + + initiator: dict[str, Any] | Unset = UNSET + if not isinstance(self.initiator, Unset): + initiator = self.initiator.to_dict() + + parent_run_id: None | str | Unset + if isinstance(self.parent_run_id, Unset): + parent_run_id = UNSET + else: + parent_run_id = self.parent_run_id + + retry_policy: dict[str, Any] | Unset = UNSET + if not isinstance(self.retry_policy, Unset): + retry_policy = self.retry_policy.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "environment": environment, + "parameters": parameters, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + if initiator is not UNSET: + field_dict["initiator"] = initiator + if parent_run_id is not UNSET: + field_dict["parent_run_id"] = parent_run_id + if retry_policy is not UNSET: + field_dict["retry_policy"] = retry_policy + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.run_app_initiator_data import RunAppInitiatorData + from ..models.run_app_params_parameters import RunAppParamsParameters + from ..models.run_retry_policy import RunRetryPolicy + + d = dict(src_dict) + environment = d.pop("environment") + + parameters = RunAppParamsParameters.from_dict(d.pop("parameters")) + + schema = d.pop("$schema", UNSET) + + _initiator = d.pop("initiator", UNSET) + initiator: RunAppInitiatorData | Unset + if isinstance(_initiator, Unset): + initiator = UNSET + else: + initiator = RunAppInitiatorData.from_dict(_initiator) + + def _parse_parent_run_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + parent_run_id = _parse_parent_run_id(d.pop("parent_run_id", UNSET)) + + _retry_policy = d.pop("retry_policy", UNSET) + retry_policy: RunRetryPolicy | Unset + if isinstance(_retry_policy, Unset): + retry_policy = UNSET + else: + retry_policy = RunRetryPolicy.from_dict(_retry_policy) + + run_app_params = cls( + environment=environment, + parameters=parameters, + schema=schema, + initiator=initiator, + parent_run_id=parent_run_id, + retry_policy=retry_policy, + ) + + return run_app_params diff --git a/src/tower/tower_api_client/models/run_app_params_parameters.py b/src/tower/tower_api_client/models/run_app_params_parameters.py new file mode 100644 index 00000000..fff7dd8f --- /dev/null +++ b/src/tower/tower_api_client/models/run_app_params_parameters.py @@ -0,0 +1,46 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="RunAppParamsParameters") + + +@_attrs_define +class RunAppParamsParameters: + """The parameters to pass into this app.""" + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + run_app_params_parameters = cls() + + run_app_params_parameters.additional_properties = d + return run_app_params_parameters + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/tower/tower_api_client/models/run_app_response.py b/src/tower/tower_api_client/models/run_app_response.py new file mode 100644 index 00000000..87686714 --- /dev/null +++ b/src/tower/tower_api_client/models/run_app_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.run import Run + + +T = TypeVar("T", bound="RunAppResponse") + + +@_attrs_define +class RunAppResponse: + """ + Attributes: + run (Run): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/RunAppResponse.json. + """ + + run: Run + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + run = self.run.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "run": run, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.run import Run + + d = dict(src_dict) + run = Run.from_dict(d.pop("run")) + + schema = d.pop("$schema", UNSET) + + run_app_response = cls( + run=run, + schema=schema, + ) + + return run_app_response diff --git a/src/tower/tower_api_client/models/run_attempt.py b/src/tower/tower_api_client/models/run_attempt.py new file mode 100644 index 00000000..bcc3bff9 --- /dev/null +++ b/src/tower/tower_api_client/models/run_attempt.py @@ -0,0 +1,142 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +T = TypeVar("T", bound="RunAttempt") + + +@_attrs_define +class RunAttempt: + """ + Attributes: + ended_at (datetime.datetime | None): When this attempt ended. + exit_code (int | None): Exit code for this attempt. + seq (int): 1-based attempt number. + started_at (datetime.datetime | None): When the run started executing your code. + starting_at (datetime.datetime | None): When the runner environment started to get setup. + status (str): Terminal status of this attempt. + """ + + ended_at: datetime.datetime | None + exit_code: int | None + seq: int + started_at: datetime.datetime | None + starting_at: datetime.datetime | None + status: str + + def to_dict(self) -> dict[str, Any]: + ended_at: None | str + if isinstance(self.ended_at, datetime.datetime): + ended_at = self.ended_at.isoformat() + else: + ended_at = self.ended_at + + exit_code: int | None + exit_code = self.exit_code + + seq = self.seq + + started_at: None | str + if isinstance(self.started_at, datetime.datetime): + started_at = self.started_at.isoformat() + else: + started_at = self.started_at + + starting_at: None | str + if isinstance(self.starting_at, datetime.datetime): + starting_at = self.starting_at.isoformat() + else: + starting_at = self.starting_at + + status = self.status + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "ended_at": ended_at, + "exit_code": exit_code, + "seq": seq, + "started_at": started_at, + "starting_at": starting_at, + "status": status, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + + def _parse_ended_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + ended_at_type_0 = isoparse(data) + + return ended_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + ended_at = _parse_ended_at(d.pop("ended_at")) + + def _parse_exit_code(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + exit_code = _parse_exit_code(d.pop("exit_code")) + + seq = d.pop("seq") + + def _parse_started_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + started_at_type_0 = isoparse(data) + + return started_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + started_at = _parse_started_at(d.pop("started_at")) + + def _parse_starting_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + starting_at_type_0 = isoparse(data) + + return starting_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + starting_at = _parse_starting_at(d.pop("starting_at")) + + status = d.pop("status") + + run_attempt = cls( + ended_at=ended_at, + exit_code=exit_code, + seq=seq, + started_at=started_at, + starting_at=starting_at, + status=status, + ) + + return run_attempt diff --git a/src/tower/tower_api_client/models/run_failure_alert.py b/src/tower/tower_api_client/models/run_failure_alert.py new file mode 100644 index 00000000..6a799b4b --- /dev/null +++ b/src/tower/tower_api_client/models/run_failure_alert.py @@ -0,0 +1,66 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +if TYPE_CHECKING: + from ..models.app import App + from ..models.run import Run + + +T = TypeVar("T", bound="RunFailureAlert") + + +@_attrs_define +class RunFailureAlert: + """ + Attributes: + app (App): + environment (str): Environment this run was in + run (Run): + """ + + app: App + environment: str + run: Run + + def to_dict(self) -> dict[str, Any]: + app = self.app.to_dict() + + environment = self.environment + + run = self.run.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "app": app, + "environment": environment, + "run": run, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.app import App + from ..models.run import Run + + d = dict(src_dict) + app = App.from_dict(d.pop("app")) + + environment = d.pop("environment") + + run = Run.from_dict(d.pop("run")) + + run_failure_alert = cls( + app=app, + environment=environment, + run=run, + ) + + return run_failure_alert diff --git a/src/tower/tower_api_client/models/run_graph_node.py b/src/tower/tower_api_client/models/run_graph_node.py new file mode 100644 index 00000000..4c94b26a --- /dev/null +++ b/src/tower/tower_api_client/models/run_graph_node.py @@ -0,0 +1,56 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +if TYPE_CHECKING: + from ..models.run_graph_run_id import RunGraphRunID + + +T = TypeVar("T", bound="RunGraphNode") + + +@_attrs_define +class RunGraphNode: + """ + Attributes: + id (RunGraphRunID): + parent_id (RunGraphRunID): + """ + + id: RunGraphRunID + parent_id: RunGraphRunID + + def to_dict(self) -> dict[str, Any]: + id = self.id.to_dict() + + parent_id = self.parent_id.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "id": id, + "parent_id": parent_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.run_graph_run_id import RunGraphRunID + + d = dict(src_dict) + id = RunGraphRunID.from_dict(d.pop("id")) + + parent_id = RunGraphRunID.from_dict(d.pop("parent_id")) + + run_graph_node = cls( + id=id, + parent_id=parent_id, + ) + + return run_graph_node diff --git a/src/tower/tower_api_client/models/run_graph_run_id.py b/src/tower/tower_api_client/models/run_graph_run_id.py new file mode 100644 index 00000000..d9c503a8 --- /dev/null +++ b/src/tower/tower_api_client/models/run_graph_run_id.py @@ -0,0 +1,50 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="RunGraphRunID") + + +@_attrs_define +class RunGraphRunID: + """ + Attributes: + app_name (str): + number (int): + """ + + app_name: str + number: int + + def to_dict(self) -> dict[str, Any]: + app_name = self.app_name + + number = self.number + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "app_name": app_name, + "number": number, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + app_name = d.pop("app_name") + + number = d.pop("number") + + run_graph_run_id = cls( + app_name=app_name, + number=number, + ) + + return run_graph_run_id diff --git a/src/tower/tower_api_client/models/run_initiator.py b/src/tower/tower_api_client/models/run_initiator.py new file mode 100644 index 00000000..e0df03d9 --- /dev/null +++ b/src/tower/tower_api_client/models/run_initiator.py @@ -0,0 +1,89 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define + +if TYPE_CHECKING: + from ..models.run_run_initiator_details import RunRunInitiatorDetails + from ..models.schedule_run_initiator_details import ScheduleRunInitiatorDetails + + +T = TypeVar("T", bound="RunInitiator") + + +@_attrs_define +class RunInitiator: + """ + Attributes: + details (RunRunInitiatorDetails | ScheduleRunInitiatorDetails): Additional information about the initiator of a + run. + type_ (None | str): The type of initiator for this run. Null if none or unknown. + """ + + details: RunRunInitiatorDetails | ScheduleRunInitiatorDetails + type_: None | str + + def to_dict(self) -> dict[str, Any]: + from ..models.schedule_run_initiator_details import ScheduleRunInitiatorDetails + + details: dict[str, Any] + if isinstance(self.details, ScheduleRunInitiatorDetails): + details = self.details.to_dict() + else: + details = self.details.to_dict() + + type_: None | str + type_ = self.type_ + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "details": details, + "type": type_, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.run_run_initiator_details import RunRunInitiatorDetails + from ..models.schedule_run_initiator_details import ScheduleRunInitiatorDetails + + d = dict(src_dict) + + def _parse_details( + data: object, + ) -> RunRunInitiatorDetails | ScheduleRunInitiatorDetails: + try: + if not isinstance(data, dict): + raise TypeError() + details_type_0 = ScheduleRunInitiatorDetails.from_dict(data) + + return details_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + details_type_1 = RunRunInitiatorDetails.from_dict(data) + + return details_type_1 + + details = _parse_details(d.pop("details")) + + def _parse_type_(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + type_ = _parse_type_(d.pop("type")) + + run_initiator = cls( + details=details, + type_=type_, + ) + + return run_initiator diff --git a/src/tower/tower_api_client/models/run_log_line.py b/src/tower/tower_api_client/models/run_log_line.py new file mode 100644 index 00000000..01ecc67c --- /dev/null +++ b/src/tower/tower_api_client/models/run_log_line.py @@ -0,0 +1,113 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.run_log_line_channel import RunLogLineChannel +from ..types import UNSET, Unset + +T = TypeVar("T", bound="RunLogLine") + + +@_attrs_define +class RunLogLine: + """ + Attributes: + attempt_seq (int): The attempt number this log line belongs to (1-based). Attempt 1 is the original execution; + 2+ are retries. + channel (RunLogLineChannel): The channel this log line belongs to. + content (str): Contents of the log message. + line_num (int): Line number. + reported_at (datetime.datetime): Timestamp of the log line. + run_id (str): The uuid of the Run. + message (str | Unset): This property is deprecated. Use content instead. + timestamp (datetime.datetime | Unset): This property is deprecated. Use reported_at instead. + """ + + attempt_seq: int + channel: RunLogLineChannel + content: str + line_num: int + reported_at: datetime.datetime + run_id: str + message: str | Unset = UNSET + timestamp: datetime.datetime | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + attempt_seq = self.attempt_seq + + channel = self.channel.value + + content = self.content + + line_num = self.line_num + + reported_at = self.reported_at.isoformat() + + run_id = self.run_id + + message = self.message + + timestamp: str | Unset = UNSET + if not isinstance(self.timestamp, Unset): + timestamp = self.timestamp.isoformat() + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "attempt_seq": attempt_seq, + "channel": channel, + "content": content, + "line_num": line_num, + "reported_at": reported_at, + "run_id": run_id, + } + ) + if message is not UNSET: + field_dict["message"] = message + if timestamp is not UNSET: + field_dict["timestamp"] = timestamp + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + attempt_seq = d.pop("attempt_seq") + + channel = RunLogLineChannel(d.pop("channel")) + + content = d.pop("content") + + line_num = d.pop("line_num") + + reported_at = isoparse(d.pop("reported_at")) + + run_id = d.pop("run_id") + + message = d.pop("message", UNSET) + + _timestamp = d.pop("timestamp", UNSET) + timestamp: datetime.datetime | Unset + if isinstance(_timestamp, Unset): + timestamp = UNSET + else: + timestamp = isoparse(_timestamp) + + run_log_line = cls( + attempt_seq=attempt_seq, + channel=channel, + content=content, + line_num=line_num, + reported_at=reported_at, + run_id=run_id, + message=message, + timestamp=timestamp, + ) + + return run_log_line diff --git a/src/tower/tower_api_client/models/run_log_line_channel.py b/src/tower/tower_api_client/models/run_log_line_channel.py new file mode 100644 index 00000000..547ca73c --- /dev/null +++ b/src/tower/tower_api_client/models/run_log_line_channel.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class RunLogLineChannel(str, Enum): + PROGRAM = "program" + SETUP = "setup" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/run_parameter.py b/src/tower/tower_api_client/models/run_parameter.py new file mode 100644 index 00000000..b58232f3 --- /dev/null +++ b/src/tower/tower_api_client/models/run_parameter.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="RunParameter") + + +@_attrs_define +class RunParameter: + """ + Attributes: + is_override (bool): Whether this parameter's value was supplied as an override at run/schedule creation time + (true) or comes from the app version's default (false). Default: False. + name (str): + value (str): + hidden (bool | Unset): Whether this parameter is hidden/secret. Defaults to false. Default: False. + """ + + name: str + value: str + is_override: bool = False + hidden: bool | Unset = False + + def to_dict(self) -> dict[str, Any]: + is_override = self.is_override + + name = self.name + + value = self.value + + hidden = self.hidden + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "is_override": is_override, + "name": name, + "value": value, + } + ) + if hidden is not UNSET: + field_dict["hidden"] = hidden + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + is_override = d.pop("is_override") + + name = d.pop("name") + + value = d.pop("value") + + hidden = d.pop("hidden", UNSET) + + run_parameter = cls( + is_override=is_override, + name=name, + value=value, + hidden=hidden, + ) + + return run_parameter diff --git a/src/tower/tower_api_client/models/run_parameter_input.py b/src/tower/tower_api_client/models/run_parameter_input.py new file mode 100644 index 00000000..ee6b3028 --- /dev/null +++ b/src/tower/tower_api_client/models/run_parameter_input.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="RunParameterInput") + + +@_attrs_define +class RunParameterInput: + """ + Attributes: + name (str): + value (str): + hidden (bool | Unset): Whether this parameter is hidden/secret. Defaults to false. Default: False. + """ + + name: str + value: str + hidden: bool | Unset = False + + def to_dict(self) -> dict[str, Any]: + name = self.name + + value = self.value + + hidden = self.hidden + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "name": name, + "value": value, + } + ) + if hidden is not UNSET: + field_dict["hidden"] = hidden + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + value = d.pop("value") + + hidden = d.pop("hidden", UNSET) + + run_parameter_input = cls( + name=name, + value=value, + hidden=hidden, + ) + + return run_parameter_input diff --git a/src/tower/tower_api_client/models/run_results.py b/src/tower/tower_api_client/models/run_results.py new file mode 100644 index 00000000..9cdc3f01 --- /dev/null +++ b/src/tower/tower_api_client/models/run_results.py @@ -0,0 +1,98 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="RunResults") + + +@_attrs_define +class RunResults: + """ + Attributes: + cancelled (int): + crashed (int): + errored (int): + exited (int): + pending (int): + retrying (int): + running (int): + starting (int): + """ + + cancelled: int + crashed: int + errored: int + exited: int + pending: int + retrying: int + running: int + starting: int + + def to_dict(self) -> dict[str, Any]: + cancelled = self.cancelled + + crashed = self.crashed + + errored = self.errored + + exited = self.exited + + pending = self.pending + + retrying = self.retrying + + running = self.running + + starting = self.starting + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "cancelled": cancelled, + "crashed": crashed, + "errored": errored, + "exited": exited, + "pending": pending, + "retrying": retrying, + "running": running, + "starting": starting, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + cancelled = d.pop("cancelled") + + crashed = d.pop("crashed") + + errored = d.pop("errored") + + exited = d.pop("exited") + + pending = d.pop("pending") + + retrying = d.pop("retrying") + + running = d.pop("running") + + starting = d.pop("starting") + + run_results = cls( + cancelled=cancelled, + crashed=crashed, + errored=errored, + exited=exited, + pending=pending, + retrying=retrying, + running=running, + starting=starting, + ) + + return run_results diff --git a/src/tower/tower_api_client/models/run_retry_policy.py b/src/tower/tower_api_client/models/run_retry_policy.py new file mode 100644 index 00000000..bcc3db09 --- /dev/null +++ b/src/tower/tower_api_client/models/run_retry_policy.py @@ -0,0 +1,58 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="RunRetryPolicy") + + +@_attrs_define +class RunRetryPolicy: + """ + Attributes: + max_retries (int): + retry_delay_seconds (int): + use_exponential_backoff (bool): + """ + + max_retries: int + retry_delay_seconds: int + use_exponential_backoff: bool + + def to_dict(self) -> dict[str, Any]: + max_retries = self.max_retries + + retry_delay_seconds = self.retry_delay_seconds + + use_exponential_backoff = self.use_exponential_backoff + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "max_retries": max_retries, + "retry_delay_seconds": retry_delay_seconds, + "use_exponential_backoff": use_exponential_backoff, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + max_retries = d.pop("max_retries") + + retry_delay_seconds = d.pop("retry_delay_seconds") + + use_exponential_backoff = d.pop("use_exponential_backoff") + + run_retry_policy = cls( + max_retries=max_retries, + retry_delay_seconds=retry_delay_seconds, + use_exponential_backoff=use_exponential_backoff, + ) + + return run_retry_policy diff --git a/src/tower/tower_api_client/models/run_run_initiator_details.py b/src/tower/tower_api_client/models/run_run_initiator_details.py new file mode 100644 index 00000000..a111d53d --- /dev/null +++ b/src/tower/tower_api_client/models/run_run_initiator_details.py @@ -0,0 +1,51 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="RunRunInitiatorDetails") + + +@_attrs_define +class RunRunInitiatorDetails: + """ + Attributes: + run_app_name (str | Unset): The name of the app that initiated this run, if type is 'tower_run' + run_number (int | Unset): The number of the run that initaited this run, if type is 'tower_run' + """ + + run_app_name: str | Unset = UNSET + run_number: int | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + run_app_name = self.run_app_name + + run_number = self.run_number + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if run_app_name is not UNSET: + field_dict["run_app_name"] = run_app_name + if run_number is not UNSET: + field_dict["run_number"] = run_number + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + run_app_name = d.pop("run_app_name", UNSET) + + run_number = d.pop("run_number", UNSET) + + run_run_initiator_details = cls( + run_app_name=run_app_name, + run_number=run_number, + ) + + return run_run_initiator_details diff --git a/src/tower/tower_api_client/models/run_statistics.py b/src/tower/tower_api_client/models/run_statistics.py new file mode 100644 index 00000000..92e20b21 --- /dev/null +++ b/src/tower/tower_api_client/models/run_statistics.py @@ -0,0 +1,82 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="RunStatistics") + + +@_attrs_define +class RunStatistics: + """ + Attributes: + cancelled_runs (int): + crashed_runs (int): + errored_runs (int): + exited_runs (int): + running_runs (int): + total_runs (int): + """ + + cancelled_runs: int + crashed_runs: int + errored_runs: int + exited_runs: int + running_runs: int + total_runs: int + + def to_dict(self) -> dict[str, Any]: + cancelled_runs = self.cancelled_runs + + crashed_runs = self.crashed_runs + + errored_runs = self.errored_runs + + exited_runs = self.exited_runs + + running_runs = self.running_runs + + total_runs = self.total_runs + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "cancelled_runs": cancelled_runs, + "crashed_runs": crashed_runs, + "errored_runs": errored_runs, + "exited_runs": exited_runs, + "running_runs": running_runs, + "total_runs": total_runs, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + cancelled_runs = d.pop("cancelled_runs") + + crashed_runs = d.pop("crashed_runs") + + errored_runs = d.pop("errored_runs") + + exited_runs = d.pop("exited_runs") + + running_runs = d.pop("running_runs") + + total_runs = d.pop("total_runs") + + run_statistics = cls( + cancelled_runs=cancelled_runs, + crashed_runs=crashed_runs, + errored_runs=errored_runs, + exited_runs=exited_runs, + running_runs=running_runs, + total_runs=total_runs, + ) + + return run_statistics diff --git a/src/tower/tower_api_client/models/run_status.py b/src/tower/tower_api_client/models/run_status.py new file mode 100644 index 00000000..99e6d8aa --- /dev/null +++ b/src/tower/tower_api_client/models/run_status.py @@ -0,0 +1,16 @@ +from enum import Enum + + +class RunStatus(str, Enum): + CANCELLED = "cancelled" + CRASHED = "crashed" + ERRORED = "errored" + EXITED = "exited" + PENDING = "pending" + RETRYING = "retrying" + RUNNING = "running" + SCHEDULED = "scheduled" + STARTING = "starting" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/run_status_group.py b/src/tower/tower_api_client/models/run_status_group.py new file mode 100644 index 00000000..942edb5f --- /dev/null +++ b/src/tower/tower_api_client/models/run_status_group.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class RunStatusGroup(str, Enum): + FAILED = "failed" + SUCCESSFUL = "successful" + VALUE_2 = "" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/run_timeseries_point.py b/src/tower/tower_api_client/models/run_timeseries_point.py new file mode 100644 index 00000000..99b5bc63 --- /dev/null +++ b/src/tower/tower_api_client/models/run_timeseries_point.py @@ -0,0 +1,116 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +T = TypeVar("T", bound="RunTimeseriesPoint") + + +@_attrs_define +class RunTimeseriesPoint: + """ + Attributes: + cancelled (int): + crashed (int): + errored (int): + exited (int): + pending (int): + period (datetime.datetime): The period of the timeseries point, typically the start of the period. + retrying (int): + running (int): + scheduled (int): + starting (int): + """ + + cancelled: int + crashed: int + errored: int + exited: int + pending: int + period: datetime.datetime + retrying: int + running: int + scheduled: int + starting: int + + def to_dict(self) -> dict[str, Any]: + cancelled = self.cancelled + + crashed = self.crashed + + errored = self.errored + + exited = self.exited + + pending = self.pending + + period = self.period.isoformat() + + retrying = self.retrying + + running = self.running + + scheduled = self.scheduled + + starting = self.starting + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "cancelled": cancelled, + "crashed": crashed, + "errored": errored, + "exited": exited, + "pending": pending, + "period": period, + "retrying": retrying, + "running": running, + "scheduled": scheduled, + "starting": starting, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + cancelled = d.pop("cancelled") + + crashed = d.pop("crashed") + + errored = d.pop("errored") + + exited = d.pop("exited") + + pending = d.pop("pending") + + period = isoparse(d.pop("period")) + + retrying = d.pop("retrying") + + running = d.pop("running") + + scheduled = d.pop("scheduled") + + starting = d.pop("starting") + + run_timeseries_point = cls( + cancelled=cancelled, + crashed=crashed, + errored=errored, + exited=exited, + pending=pending, + period=period, + retrying=retrying, + running=running, + scheduled=scheduled, + starting=starting, + ) + + return run_timeseries_point diff --git a/src/tower/tower_api_client/models/runner.py b/src/tower/tower_api_client/models/runner.py new file mode 100644 index 00000000..668afb5d --- /dev/null +++ b/src/tower/tower_api_client/models/runner.py @@ -0,0 +1,116 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.run import Run + + +T = TypeVar("T", bound="Runner") + + +@_attrs_define +class Runner: + """ + Attributes: + active_runs (list[Run]): + created_at (str): + id (str): + max_concurrent_apps (int): + num_runs (int): + status (str): + last_health_check_at (str | Unset): + name (str | Unset): Optional human-readable name for the runner + """ + + active_runs: list[Run] + created_at: str + id: str + max_concurrent_apps: int + num_runs: int + status: str + last_health_check_at: str | Unset = UNSET + name: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + active_runs = [] + for active_runs_item_data in self.active_runs: + active_runs_item = active_runs_item_data.to_dict() + active_runs.append(active_runs_item) + + created_at = self.created_at + + id = self.id + + max_concurrent_apps = self.max_concurrent_apps + + num_runs = self.num_runs + + status = self.status + + last_health_check_at = self.last_health_check_at + + name = self.name + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "active_runs": active_runs, + "created_at": created_at, + "id": id, + "max_concurrent_apps": max_concurrent_apps, + "num_runs": num_runs, + "status": status, + } + ) + if last_health_check_at is not UNSET: + field_dict["last_health_check_at"] = last_health_check_at + if name is not UNSET: + field_dict["name"] = name + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.run import Run + + d = dict(src_dict) + active_runs = [] + _active_runs = d.pop("active_runs") + for active_runs_item_data in _active_runs: + active_runs_item = Run.from_dict(active_runs_item_data) + + active_runs.append(active_runs_item) + + created_at = d.pop("created_at") + + id = d.pop("id") + + max_concurrent_apps = d.pop("max_concurrent_apps") + + num_runs = d.pop("num_runs") + + status = d.pop("status") + + last_health_check_at = d.pop("last_health_check_at", UNSET) + + name = d.pop("name", UNSET) + + runner = cls( + active_runs=active_runs, + created_at=created_at, + id=id, + max_concurrent_apps=max_concurrent_apps, + num_runs=num_runs, + status=status, + last_health_check_at=last_health_check_at, + name=name, + ) + + return runner diff --git a/src/tower/tower_api_client/models/runner_credentials.py b/src/tower/tower_api_client/models/runner_credentials.py new file mode 100644 index 00000000..a04a5e82 --- /dev/null +++ b/src/tower/tower_api_client/models/runner_credentials.py @@ -0,0 +1,74 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="RunnerCredentials") + + +@_attrs_define +class RunnerCredentials: + """ + Attributes: + certificate (str): The signed certificate used by the runner to authenticate itself to Tower. + private_key (str): The private key used by the runner to authenticate itself to Tower. + root_ca (None | str): The PEM encoded root CA certificate that is used to verify the runner's certificate when + Tower is responsible for signing server certs. + runner_service_url (str): The host of the runner service that this runner will connect to. This is typically the + Tower service host. + """ + + certificate: str + private_key: str + root_ca: None | str + runner_service_url: str + + def to_dict(self) -> dict[str, Any]: + certificate = self.certificate + + private_key = self.private_key + + root_ca: None | str + root_ca = self.root_ca + + runner_service_url = self.runner_service_url + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "certificate": certificate, + "private_key": private_key, + "root_ca": root_ca, + "runner_service_url": runner_service_url, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + certificate = d.pop("certificate") + + private_key = d.pop("private_key") + + def _parse_root_ca(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + root_ca = _parse_root_ca(d.pop("root_ca")) + + runner_service_url = d.pop("runner_service_url") + + runner_credentials = cls( + certificate=certificate, + private_key=private_key, + root_ca=root_ca, + runner_service_url=runner_service_url, + ) + + return runner_credentials diff --git a/src/tower/tower_api_client/models/schedule.py b/src/tower/tower_api_client/models/schedule.py new file mode 100644 index 00000000..d34ea239 --- /dev/null +++ b/src/tower/tower_api_client/models/schedule.py @@ -0,0 +1,167 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.schedule_app_status import ScheduleAppStatus +from ..models.schedule_overlap_policy import ScheduleOverlapPolicy +from ..models.schedule_status import ScheduleStatus +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.run_parameter import RunParameter + + +T = TypeVar("T", bound="Schedule") + + +@_attrs_define +class Schedule: + """ + Attributes: + app_name (str): The name of the app that will be executed + app_status (ScheduleAppStatus): The status of the app + created_at (datetime.datetime): The timestamp when the schedule was created + cron (str): The cron expression defining when the app should run + environment (str): The environment to run the app in + id (str): The unique identifier for the schedule + name (str): The name of this schedule + overlap_policy (ScheduleOverlapPolicy): The policy for handling overlapping runs + status (ScheduleStatus): The status of the schedule + timezone (str): The IANA timezone identifier that the cron expression is evaluated in (e.g., 'America/New_York', + 'Europe/London'). Defaults to 'UTC'. + updated_at (datetime.datetime): The timestamp when the schedule was last updated + app_version (str | Unset): This property is deprecated. Schedules inherit the version from their environment. + This field returns the environment's current version. + parameters (list[RunParameter] | Unset): The parameters to pass when running the app + """ + + app_name: str + app_status: ScheduleAppStatus + created_at: datetime.datetime + cron: str + environment: str + id: str + name: str + overlap_policy: ScheduleOverlapPolicy + status: ScheduleStatus + timezone: str + updated_at: datetime.datetime + app_version: str | Unset = UNSET + parameters: list[RunParameter] | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + app_name = self.app_name + + app_status = self.app_status.value + + created_at = self.created_at.isoformat() + + cron = self.cron + + environment = self.environment + + id = self.id + + name = self.name + + overlap_policy = self.overlap_policy.value + + status = self.status.value + + timezone = self.timezone + + updated_at = self.updated_at.isoformat() + + app_version = self.app_version + + parameters: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.parameters, Unset): + parameters = [] + for parameters_item_data in self.parameters: + parameters_item = parameters_item_data.to_dict() + parameters.append(parameters_item) + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "app_name": app_name, + "app_status": app_status, + "created_at": created_at, + "cron": cron, + "environment": environment, + "id": id, + "name": name, + "overlap_policy": overlap_policy, + "status": status, + "timezone": timezone, + "updated_at": updated_at, + } + ) + if app_version is not UNSET: + field_dict["app_version"] = app_version + if parameters is not UNSET: + field_dict["parameters"] = parameters + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.run_parameter import RunParameter + + d = dict(src_dict) + app_name = d.pop("app_name") + + app_status = ScheduleAppStatus(d.pop("app_status")) + + created_at = isoparse(d.pop("created_at")) + + cron = d.pop("cron") + + environment = d.pop("environment") + + id = d.pop("id") + + name = d.pop("name") + + overlap_policy = ScheduleOverlapPolicy(d.pop("overlap_policy")) + + status = ScheduleStatus(d.pop("status")) + + timezone = d.pop("timezone") + + updated_at = isoparse(d.pop("updated_at")) + + app_version = d.pop("app_version", UNSET) + + _parameters = d.pop("parameters", UNSET) + parameters: list[RunParameter] | Unset = UNSET + if _parameters is not UNSET: + parameters = [] + for parameters_item_data in _parameters: + parameters_item = RunParameter.from_dict(parameters_item_data) + + parameters.append(parameters_item) + + schedule = cls( + app_name=app_name, + app_status=app_status, + created_at=created_at, + cron=cron, + environment=environment, + id=id, + name=name, + overlap_policy=overlap_policy, + status=status, + timezone=timezone, + updated_at=updated_at, + app_version=app_version, + parameters=parameters, + ) + + return schedule diff --git a/src/tower/tower_api_client/models/schedule_app_status.py b/src/tower/tower_api_client/models/schedule_app_status.py new file mode 100644 index 00000000..cc79ba66 --- /dev/null +++ b/src/tower/tower_api_client/models/schedule_app_status.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class ScheduleAppStatus(str, Enum): + ACTIVE = "active" + DISABLED = "disabled" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/schedule_overlap_policy.py b/src/tower/tower_api_client/models/schedule_overlap_policy.py new file mode 100644 index 00000000..2f4c0e12 --- /dev/null +++ b/src/tower/tower_api_client/models/schedule_overlap_policy.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class ScheduleOverlapPolicy(str, Enum): + ALLOW = "allow" + SKIP = "skip" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/schedule_run_initiator_details.py b/src/tower/tower_api_client/models/schedule_run_initiator_details.py new file mode 100644 index 00000000..ccb85ded --- /dev/null +++ b/src/tower/tower_api_client/models/schedule_run_initiator_details.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ScheduleRunInitiatorDetails") + + +@_attrs_define +class ScheduleRunInitiatorDetails: + """ + Attributes: + schedule_name (str | Unset): The name of the schedule that initiated this run, if type is 'tower_schedule' + """ + + schedule_name: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + schedule_name = self.schedule_name + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if schedule_name is not UNSET: + field_dict["schedule_name"] = schedule_name + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + schedule_name = d.pop("schedule_name", UNSET) + + schedule_run_initiator_details = cls( + schedule_name=schedule_name, + ) + + return schedule_run_initiator_details diff --git a/src/tower/tower_api_client/models/schedule_status.py b/src/tower/tower_api_client/models/schedule_status.py new file mode 100644 index 00000000..20e02959 --- /dev/null +++ b/src/tower/tower_api_client/models/schedule_status.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class ScheduleStatus(str, Enum): + ACTIVE = "active" + DISABLED = "disabled" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/search_runs_response.py b/src/tower/tower_api_client/models/search_runs_response.py new file mode 100644 index 00000000..978416c3 --- /dev/null +++ b/src/tower/tower_api_client/models/search_runs_response.py @@ -0,0 +1,78 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.pagination import Pagination + from ..models.run import Run + + +T = TypeVar("T", bound="SearchRunsResponse") + + +@_attrs_define +class SearchRunsResponse: + """ + Attributes: + pages (Pagination): + runs (list[Run]): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/SearchRunsResponse.json. + """ + + pages: Pagination + runs: list[Run] + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + pages = self.pages.to_dict() + + runs = [] + for runs_item_data in self.runs: + runs_item = runs_item_data.to_dict() + runs.append(runs_item) + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "pages": pages, + "runs": runs, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.pagination import Pagination + from ..models.run import Run + + d = dict(src_dict) + pages = Pagination.from_dict(d.pop("pages")) + + runs = [] + _runs = d.pop("runs") + for runs_item_data in _runs: + runs_item = Run.from_dict(runs_item_data) + + runs.append(runs_item) + + schema = d.pop("$schema", UNSET) + + search_runs_response = cls( + pages=pages, + runs=runs, + schema=schema, + ) + + return search_runs_response diff --git a/src/tower/tower_api_client/models/search_runs_status_item.py b/src/tower/tower_api_client/models/search_runs_status_item.py new file mode 100644 index 00000000..b1b65541 --- /dev/null +++ b/src/tower/tower_api_client/models/search_runs_status_item.py @@ -0,0 +1,15 @@ +from enum import Enum + + +class SearchRunsStatusItem(str, Enum): + CANCELLED = "cancelled" + CRASHED = "crashed" + ERRORED = "errored" + EXITED = "exited" + PENDING = "pending" + RETRYING = "retrying" + RUNNING = "running" + STARTING = "starting" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/secret.py b/src/tower/tower_api_client/models/secret.py new file mode 100644 index 00000000..acac2b20 --- /dev/null +++ b/src/tower/tower_api_client/models/secret.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +T = TypeVar("T", bound="Secret") + + +@_attrs_define +class Secret: + """ + Attributes: + created_at (datetime.datetime): + environment (str): + name (str): + preview (str): + """ + + created_at: datetime.datetime + environment: str + name: str + preview: str + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + environment = self.environment + + name = self.name + + preview = self.preview + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "created_at": created_at, + "environment": environment, + "name": name, + "preview": preview, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + environment = d.pop("environment") + + name = d.pop("name") + + preview = d.pop("preview") + + secret = cls( + created_at=created_at, + environment=environment, + name=name, + preview=preview, + ) + + return secret diff --git a/src/tower/tower_api_client/models/session.py b/src/tower/tower_api_client/models/session.py new file mode 100644 index 00000000..a3c8bcaa --- /dev/null +++ b/src/tower/tower_api_client/models/session.py @@ -0,0 +1,88 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +if TYPE_CHECKING: + from ..models.featurebase_identity import FeaturebaseIdentity + from ..models.team import Team + from ..models.token import Token + from ..models.user import User + + +T = TypeVar("T", bound="Session") + + +@_attrs_define +class Session: + """ + Attributes: + featurebase_identity (FeaturebaseIdentity): + teams (list[Team]): + token (Token): + user (User): + """ + + featurebase_identity: FeaturebaseIdentity + teams: list[Team] + token: Token + user: User + + def to_dict(self) -> dict[str, Any]: + featurebase_identity = self.featurebase_identity.to_dict() + + teams = [] + for teams_item_data in self.teams: + teams_item = teams_item_data.to_dict() + teams.append(teams_item) + + token = self.token.to_dict() + + user = self.user.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "featurebase_identity": featurebase_identity, + "teams": teams, + "token": token, + "user": user, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.featurebase_identity import FeaturebaseIdentity + from ..models.team import Team + from ..models.token import Token + from ..models.user import User + + d = dict(src_dict) + featurebase_identity = FeaturebaseIdentity.from_dict( + d.pop("featurebase_identity") + ) + + teams = [] + _teams = d.pop("teams") + for teams_item_data in _teams: + teams_item = Team.from_dict(teams_item_data) + + teams.append(teams_item) + + token = Token.from_dict(d.pop("token")) + + user = User.from_dict(d.pop("user")) + + session = cls( + featurebase_identity=featurebase_identity, + teams=teams, + token=token, + user=user, + ) + + return session diff --git a/src/tower/tower_api_client/models/shoulder_tap.py b/src/tower/tower_api_client/models/shoulder_tap.py new file mode 100644 index 00000000..181e7ae4 --- /dev/null +++ b/src/tower/tower_api_client/models/shoulder_tap.py @@ -0,0 +1,76 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +T = TypeVar("T", bound="ShoulderTap") + + +@_attrs_define +class ShoulderTap: + """ + Attributes: + account_id (str): Account ID that owns the resource. + event_type (str): Event type in format resource.changed (e.g., apps.changed, runs.changed). + resource_id (str): Unique identifier of the resource. + resource_type (str): Type of resource (apps, runs, schedules, secrets, environments, catalogs). + timestamp (datetime.datetime): Timestamp when the event occurred. + """ + + account_id: str + event_type: str + resource_id: str + resource_type: str + timestamp: datetime.datetime + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + event_type = self.event_type + + resource_id = self.resource_id + + resource_type = self.resource_type + + timestamp = self.timestamp.isoformat() + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "account_id": account_id, + "event_type": event_type, + "resource_id": resource_id, + "resource_type": resource_type, + "timestamp": timestamp, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + account_id = d.pop("account_id") + + event_type = d.pop("event_type") + + resource_id = d.pop("resource_id") + + resource_type = d.pop("resource_type") + + timestamp = isoparse(d.pop("timestamp")) + + shoulder_tap = cls( + account_id=account_id, + event_type=event_type, + resource_id=resource_id, + resource_type=resource_type, + timestamp=timestamp, + ) + + return shoulder_tap diff --git a/src/tower/tower_api_client/models/sse_warning.py b/src/tower/tower_api_client/models/sse_warning.py new file mode 100644 index 00000000..6b6cfdcf --- /dev/null +++ b/src/tower/tower_api_client/models/sse_warning.py @@ -0,0 +1,52 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +T = TypeVar("T", bound="SSEWarning") + + +@_attrs_define +class SSEWarning: + """ + Attributes: + content (str): Contents of the warning. + reported_at (datetime.datetime): Timestamp of the event. + """ + + content: str + reported_at: datetime.datetime + + def to_dict(self) -> dict[str, Any]: + content = self.content + + reported_at = self.reported_at.isoformat() + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "content": content, + "reported_at": reported_at, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + content = d.pop("content") + + reported_at = isoparse(d.pop("reported_at")) + + sse_warning = cls( + content=content, + reported_at=reported_at, + ) + + return sse_warning diff --git a/src/tower/tower_api_client/models/statistics_settings.py b/src/tower/tower_api_client/models/statistics_settings.py new file mode 100644 index 00000000..2791d517 --- /dev/null +++ b/src/tower/tower_api_client/models/statistics_settings.py @@ -0,0 +1,78 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.statistics_settings_interval import StatisticsSettingsInterval + +T = TypeVar("T", bound="StatisticsSettings") + + +@_attrs_define +class StatisticsSettings: + """ + Attributes: + end_at (datetime.datetime): The end time for the statistics period. + environment (str): The environment to get statistics for. + interval (StatisticsSettingsInterval): The interval for the statistics period. + start_at (datetime.datetime): The start time for the statistics period. + timezone (str): The time zone for the statistics period. + """ + + end_at: datetime.datetime + environment: str + interval: StatisticsSettingsInterval + start_at: datetime.datetime + timezone: str + + def to_dict(self) -> dict[str, Any]: + end_at = self.end_at.isoformat() + + environment = self.environment + + interval = self.interval.value + + start_at = self.start_at.isoformat() + + timezone = self.timezone + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "end_at": end_at, + "environment": environment, + "interval": interval, + "start_at": start_at, + "timezone": timezone, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + end_at = isoparse(d.pop("end_at")) + + environment = d.pop("environment") + + interval = StatisticsSettingsInterval(d.pop("interval")) + + start_at = isoparse(d.pop("start_at")) + + timezone = d.pop("timezone") + + statistics_settings = cls( + end_at=end_at, + environment=environment, + interval=interval, + start_at=start_at, + timezone=timezone, + ) + + return statistics_settings diff --git a/src/tower/tower_api_client/models/statistics_settings_interval.py b/src/tower/tower_api_client/models/statistics_settings_interval.py new file mode 100644 index 00000000..def5d1a0 --- /dev/null +++ b/src/tower/tower_api_client/models/statistics_settings_interval.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class StatisticsSettingsInterval(str, Enum): + DAILY = "daily" + HOURLY = "hourly" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/stream_alerts_event_alert.py b/src/tower/tower_api_client/models/stream_alerts_event_alert.py new file mode 100644 index 00000000..53a97347 --- /dev/null +++ b/src/tower/tower_api_client/models/stream_alerts_event_alert.py @@ -0,0 +1,103 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import ( + TYPE_CHECKING, + Any, + Literal, + TypeVar, + cast, +) + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.alert import Alert + + +T = TypeVar("T", bound="StreamAlertsEventAlert") + + +@_attrs_define +class StreamAlertsEventAlert: + """ + Attributes: + data (Alert): + event (Literal['alert']): The event name. + id (int | Unset): The event ID. + retry (int | Unset): The retry time in milliseconds. + """ + + data: Alert + event: Literal["alert"] + id: int | Unset = UNSET + retry: int | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + event = self.event + + id = self.id + + retry = self.retry + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + "event": event, + } + ) + if id is not UNSET: + field_dict["id"] = id + if retry is not UNSET: + field_dict["retry"] = retry + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.alert import Alert + + d = dict(src_dict) + data = Alert.from_dict(d.pop("data")) + + event = cast(Literal["alert"], d.pop("event")) + if event != "alert": + raise ValueError(f"event must match const 'alert', got '{event}'") + + id = d.pop("id", UNSET) + + retry = d.pop("retry", UNSET) + + stream_alerts_event_alert = cls( + data=data, + event=event, + id=id, + retry=retry, + ) + + stream_alerts_event_alert.additional_properties = d + return stream_alerts_event_alert + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/tower/tower_api_client/models/stream_alerts_event_error.py b/src/tower/tower_api_client/models/stream_alerts_event_error.py new file mode 100644 index 00000000..ffd5e1d1 --- /dev/null +++ b/src/tower/tower_api_client/models/stream_alerts_event_error.py @@ -0,0 +1,103 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import ( + TYPE_CHECKING, + Any, + Literal, + TypeVar, + cast, +) + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.sse_warning import SSEWarning + + +T = TypeVar("T", bound="StreamAlertsEventError") + + +@_attrs_define +class StreamAlertsEventError: + """ + Attributes: + data (SSEWarning): + event (Literal['error']): The event name. + id (int | Unset): The event ID. + retry (int | Unset): The retry time in milliseconds. + """ + + data: SSEWarning + event: Literal["error"] + id: int | Unset = UNSET + retry: int | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + event = self.event + + id = self.id + + retry = self.retry + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + "event": event, + } + ) + if id is not UNSET: + field_dict["id"] = id + if retry is not UNSET: + field_dict["retry"] = retry + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.sse_warning import SSEWarning + + d = dict(src_dict) + data = SSEWarning.from_dict(d.pop("data")) + + event = cast(Literal["error"], d.pop("event")) + if event != "error": + raise ValueError(f"event must match const 'error', got '{event}'") + + id = d.pop("id", UNSET) + + retry = d.pop("retry", UNSET) + + stream_alerts_event_error = cls( + data=data, + event=event, + id=id, + retry=retry, + ) + + stream_alerts_event_error.additional_properties = d + return stream_alerts_event_error + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/tower/tower_api_client/models/stream_run_logs_event_log.py b/src/tower/tower_api_client/models/stream_run_logs_event_log.py new file mode 100644 index 00000000..ec751a57 --- /dev/null +++ b/src/tower/tower_api_client/models/stream_run_logs_event_log.py @@ -0,0 +1,103 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import ( + TYPE_CHECKING, + Any, + Literal, + TypeVar, + cast, +) + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.run_log_line import RunLogLine + + +T = TypeVar("T", bound="StreamRunLogsEventLog") + + +@_attrs_define +class StreamRunLogsEventLog: + """ + Attributes: + data (RunLogLine): + event (Literal['log']): The event name. + id (int | Unset): The event ID. + retry (int | Unset): The retry time in milliseconds. + """ + + data: RunLogLine + event: Literal["log"] + id: int | Unset = UNSET + retry: int | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + event = self.event + + id = self.id + + retry = self.retry + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + "event": event, + } + ) + if id is not UNSET: + field_dict["id"] = id + if retry is not UNSET: + field_dict["retry"] = retry + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.run_log_line import RunLogLine + + d = dict(src_dict) + data = RunLogLine.from_dict(d.pop("data")) + + event = cast(Literal["log"], d.pop("event")) + if event != "log": + raise ValueError(f"event must match const 'log', got '{event}'") + + id = d.pop("id", UNSET) + + retry = d.pop("retry", UNSET) + + stream_run_logs_event_log = cls( + data=data, + event=event, + id=id, + retry=retry, + ) + + stream_run_logs_event_log.additional_properties = d + return stream_run_logs_event_log + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/tower/tower_api_client/models/stream_run_logs_event_warning.py b/src/tower/tower_api_client/models/stream_run_logs_event_warning.py new file mode 100644 index 00000000..4419d8ee --- /dev/null +++ b/src/tower/tower_api_client/models/stream_run_logs_event_warning.py @@ -0,0 +1,103 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import ( + TYPE_CHECKING, + Any, + Literal, + TypeVar, + cast, +) + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.sse_warning import SSEWarning + + +T = TypeVar("T", bound="StreamRunLogsEventWarning") + + +@_attrs_define +class StreamRunLogsEventWarning: + """ + Attributes: + data (SSEWarning): + event (Literal['warning']): The event name. + id (int | Unset): The event ID. + retry (int | Unset): The retry time in milliseconds. + """ + + data: SSEWarning + event: Literal["warning"] + id: int | Unset = UNSET + retry: int | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + event = self.event + + id = self.id + + retry = self.retry + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + "event": event, + } + ) + if id is not UNSET: + field_dict["id"] = id + if retry is not UNSET: + field_dict["retry"] = retry + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.sse_warning import SSEWarning + + d = dict(src_dict) + data = SSEWarning.from_dict(d.pop("data")) + + event = cast(Literal["warning"], d.pop("event")) + if event != "warning": + raise ValueError(f"event must match const 'warning', got '{event}'") + + id = d.pop("id", UNSET) + + retry = d.pop("retry", UNSET) + + stream_run_logs_event_warning = cls( + data=data, + event=event, + id=id, + retry=retry, + ) + + stream_run_logs_event_warning.additional_properties = d + return stream_run_logs_event_warning + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/tower/tower_api_client/models/stream_shouldertaps_event_shouldertap.py b/src/tower/tower_api_client/models/stream_shouldertaps_event_shouldertap.py new file mode 100644 index 00000000..4f983426 --- /dev/null +++ b/src/tower/tower_api_client/models/stream_shouldertaps_event_shouldertap.py @@ -0,0 +1,103 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import ( + TYPE_CHECKING, + Any, + Literal, + TypeVar, + cast, +) + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.shoulder_tap import ShoulderTap + + +T = TypeVar("T", bound="StreamShouldertapsEventShouldertap") + + +@_attrs_define +class StreamShouldertapsEventShouldertap: + """ + Attributes: + data (ShoulderTap): + event (Literal['shouldertap']): The event name. + id (int | Unset): The event ID. + retry (int | Unset): The retry time in milliseconds. + """ + + data: ShoulderTap + event: Literal["shouldertap"] + id: int | Unset = UNSET + retry: int | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + event = self.event + + id = self.id + + retry = self.retry + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + "event": event, + } + ) + if id is not UNSET: + field_dict["id"] = id + if retry is not UNSET: + field_dict["retry"] = retry + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.shoulder_tap import ShoulderTap + + d = dict(src_dict) + data = ShoulderTap.from_dict(d.pop("data")) + + event = cast(Literal["shouldertap"], d.pop("event")) + if event != "shouldertap": + raise ValueError(f"event must match const 'shouldertap', got '{event}'") + + id = d.pop("id", UNSET) + + retry = d.pop("retry", UNSET) + + stream_shouldertaps_event_shouldertap = cls( + data=data, + event=event, + id=id, + retry=retry, + ) + + stream_shouldertaps_event_shouldertap.additional_properties = d + return stream_shouldertaps_event_shouldertap + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/tower/tower_api_client/models/stream_shouldertaps_event_warning.py b/src/tower/tower_api_client/models/stream_shouldertaps_event_warning.py new file mode 100644 index 00000000..b1fc8a4c --- /dev/null +++ b/src/tower/tower_api_client/models/stream_shouldertaps_event_warning.py @@ -0,0 +1,103 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import ( + TYPE_CHECKING, + Any, + Literal, + TypeVar, + cast, +) + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.sse_warning import SSEWarning + + +T = TypeVar("T", bound="StreamShouldertapsEventWarning") + + +@_attrs_define +class StreamShouldertapsEventWarning: + """ + Attributes: + data (SSEWarning): + event (Literal['warning']): The event name. + id (int | Unset): The event ID. + retry (int | Unset): The retry time in milliseconds. + """ + + data: SSEWarning + event: Literal["warning"] + id: int | Unset = UNSET + retry: int | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + event = self.event + + id = self.id + + retry = self.retry + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + "event": event, + } + ) + if id is not UNSET: + field_dict["id"] = id + if retry is not UNSET: + field_dict["retry"] = retry + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.sse_warning import SSEWarning + + d = dict(src_dict) + data = SSEWarning.from_dict(d.pop("data")) + + event = cast(Literal["warning"], d.pop("event")) + if event != "warning": + raise ValueError(f"event must match const 'warning', got '{event}'") + + id = d.pop("id", UNSET) + + retry = d.pop("retry", UNSET) + + stream_shouldertaps_event_warning = cls( + data=data, + event=event, + id=id, + retry=retry, + ) + + stream_shouldertaps_event_warning.additional_properties = d + return stream_shouldertaps_event_warning + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/tower/tower_api_client/models/team.py b/src/tower/tower_api_client/models/team.py new file mode 100644 index 00000000..21d8eebd --- /dev/null +++ b/src/tower/tower_api_client/models/team.py @@ -0,0 +1,99 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.token import Token + + +T = TypeVar("T", bound="Team") + + +@_attrs_define +class Team: + """ + Attributes: + execution_region (str): + name (str): + organization (str): The name of the organization this team belongs to. + type_ (str): The type of team, either 'personal' or 'team'. + slug (str | Unset): This property is deprecated. Use name instead. + token (Token | Unset): + """ + + execution_region: str + name: str + organization: str + type_: str + slug: str | Unset = UNSET + token: Token | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + execution_region = self.execution_region + + name = self.name + + organization = self.organization + + type_ = self.type_ + + slug = self.slug + + token: dict[str, Any] | Unset = UNSET + if not isinstance(self.token, Unset): + token = self.token.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "execution_region": execution_region, + "name": name, + "organization": organization, + "type": type_, + } + ) + if slug is not UNSET: + field_dict["slug"] = slug + if token is not UNSET: + field_dict["token"] = token + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.token import Token + + d = dict(src_dict) + execution_region = d.pop("execution_region") + + name = d.pop("name") + + organization = d.pop("organization") + + type_ = d.pop("type") + + slug = d.pop("slug", UNSET) + + _token = d.pop("token", UNSET) + token: Token | Unset + if isinstance(_token, Unset): + token = UNSET + else: + token = Token.from_dict(_token) + + team = cls( + execution_region=execution_region, + name=name, + organization=organization, + type_=type_, + slug=slug, + token=token, + ) + + return team diff --git a/src/tower/tower_api_client/models/team_invitation.py b/src/tower/tower_api_client/models/team_invitation.py new file mode 100644 index 00000000..b253abef --- /dev/null +++ b/src/tower/tower_api_client/models/team_invitation.py @@ -0,0 +1,74 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +if TYPE_CHECKING: + from ..models.team import Team + + +T = TypeVar("T", bound="TeamInvitation") + + +@_attrs_define +class TeamInvitation: + """ + Attributes: + email (str): + invitation_sent_at (datetime.datetime): + role (str): + team (Team): + """ + + email: str + invitation_sent_at: datetime.datetime + role: str + team: Team + + def to_dict(self) -> dict[str, Any]: + email = self.email + + invitation_sent_at = self.invitation_sent_at.isoformat() + + role = self.role + + team = self.team.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "email": email, + "invitation_sent_at": invitation_sent_at, + "role": role, + "team": team, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.team import Team + + d = dict(src_dict) + email = d.pop("email") + + invitation_sent_at = isoparse(d.pop("invitation_sent_at")) + + role = d.pop("role") + + team = Team.from_dict(d.pop("team")) + + team_invitation = cls( + email=email, + invitation_sent_at=invitation_sent_at, + role=role, + team=team, + ) + + return team_invitation diff --git a/src/tower/tower_api_client/models/team_membership.py b/src/tower/tower_api_client/models/team_membership.py new file mode 100644 index 00000000..21a0df06 --- /dev/null +++ b/src/tower/tower_api_client/models/team_membership.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.team_membership_role import TeamMembershipRole + +if TYPE_CHECKING: + from ..models.team import Team + from ..models.user import User + + +T = TypeVar("T", bound="TeamMembership") + + +@_attrs_define +class TeamMembership: + """ + Attributes: + role (TeamMembershipRole): + team (Team): + user (User): + """ + + role: TeamMembershipRole + team: Team + user: User + + def to_dict(self) -> dict[str, Any]: + role = self.role.value + + team = self.team.to_dict() + + user = self.user.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "role": role, + "team": team, + "user": user, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.team import Team + from ..models.user import User + + d = dict(src_dict) + role = TeamMembershipRole(d.pop("role")) + + team = Team.from_dict(d.pop("team")) + + user = User.from_dict(d.pop("user")) + + team_membership = cls( + role=role, + team=team, + user=user, + ) + + return team_membership diff --git a/src/tower/tower_api_client/models/team_membership_role.py b/src/tower/tower_api_client/models/team_membership_role.py new file mode 100644 index 00000000..64f85be0 --- /dev/null +++ b/src/tower/tower_api_client/models/team_membership_role.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class TeamMembershipRole(str, Enum): + ADMIN = "admin" + DEVELOPER = "developer" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/test_webhook_response.py b/src/tower/tower_api_client/models/test_webhook_response.py new file mode 100644 index 00000000..687ac6b7 --- /dev/null +++ b/src/tower/tower_api_client/models/test_webhook_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.webhook import Webhook + + +T = TypeVar("T", bound="TestWebhookResponse") + + +@_attrs_define +class TestWebhookResponse: + """ + Attributes: + webhook (Webhook): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/TestWebhookResponse.json. + """ + + webhook: Webhook + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + webhook = self.webhook.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "webhook": webhook, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.webhook import Webhook + + d = dict(src_dict) + webhook = Webhook.from_dict(d.pop("webhook")) + + schema = d.pop("$schema", UNSET) + + test_webhook_response = cls( + webhook=webhook, + schema=schema, + ) + + return test_webhook_response diff --git a/src/tower/tower_api_client/models/token.py b/src/tower/tower_api_client/models/token.py new file mode 100644 index 00000000..598af35c --- /dev/null +++ b/src/tower/tower_api_client/models/token.py @@ -0,0 +1,63 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="Token") + + +@_attrs_define +class Token: + """ + Attributes: + access_token (str): The access token to use when authenticating API requests with Tower. + jwt (str): + refresh_token (str | Unset): The refresh token to use when refreshing an expired access token. For security + reasons, refresh tokens should only be transmitted over secure channels and never logged or stored in plaintext. + It will only be returned upon initial authentication or when explicitly refreshing the access token. + """ + + access_token: str + jwt: str + refresh_token: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + access_token = self.access_token + + jwt = self.jwt + + refresh_token = self.refresh_token + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "access_token": access_token, + "jwt": jwt, + } + ) + if refresh_token is not UNSET: + field_dict["refresh_token"] = refresh_token + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + access_token = d.pop("access_token") + + jwt = d.pop("jwt") + + refresh_token = d.pop("refresh_token", UNSET) + + token = cls( + access_token=access_token, + jwt=jwt, + refresh_token=refresh_token, + ) + + return token diff --git a/src/tower/tower_api_client/models/update_account_params.py b/src/tower/tower_api_client/models/update_account_params.py new file mode 100644 index 00000000..6e51da42 --- /dev/null +++ b/src/tower/tower_api_client/models/update_account_params.py @@ -0,0 +1,81 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.update_account_params_execution_region import ( + UpdateAccountParamsExecutionRegion, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateAccountParams") + + +@_attrs_define +class UpdateAccountParams: + """ + Attributes: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/UpdateAccountParams.json. + execution_region (UpdateAccountParamsExecutionRegion | Unset): The execution region for runs (eu-central-1 or + us-east-1) + is_self_hosted_only (bool | Unset): Whether the account is for self-hosted use only + name (str | Unset): The new name for the account, if any + """ + + schema: str | Unset = UNSET + execution_region: UpdateAccountParamsExecutionRegion | Unset = UNSET + is_self_hosted_only: bool | Unset = UNSET + name: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + schema = self.schema + + execution_region: str | Unset = UNSET + if not isinstance(self.execution_region, Unset): + execution_region = self.execution_region.value + + is_self_hosted_only = self.is_self_hosted_only + + name = self.name + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if schema is not UNSET: + field_dict["$schema"] = schema + if execution_region is not UNSET: + field_dict["execution_region"] = execution_region + if is_self_hosted_only is not UNSET: + field_dict["is_self_hosted_only"] = is_self_hosted_only + if name is not UNSET: + field_dict["name"] = name + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + schema = d.pop("$schema", UNSET) + + _execution_region = d.pop("execution_region", UNSET) + execution_region: UpdateAccountParamsExecutionRegion | Unset + if isinstance(_execution_region, Unset): + execution_region = UNSET + else: + execution_region = UpdateAccountParamsExecutionRegion(_execution_region) + + is_self_hosted_only = d.pop("is_self_hosted_only", UNSET) + + name = d.pop("name", UNSET) + + update_account_params = cls( + schema=schema, + execution_region=execution_region, + is_self_hosted_only=is_self_hosted_only, + name=name, + ) + + return update_account_params diff --git a/src/tower/tower_api_client/models/update_account_params_execution_region.py b/src/tower/tower_api_client/models/update_account_params_execution_region.py new file mode 100644 index 00000000..0e5e7047 --- /dev/null +++ b/src/tower/tower_api_client/models/update_account_params_execution_region.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class UpdateAccountParamsExecutionRegion(str, Enum): + EU_CENTRAL_1 = "eu-central-1" + US_EAST_1 = "us-east-1" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/update_account_response.py b/src/tower/tower_api_client/models/update_account_response.py new file mode 100644 index 00000000..a3fa5875 --- /dev/null +++ b/src/tower/tower_api_client/models/update_account_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.account import Account + + +T = TypeVar("T", bound="UpdateAccountResponse") + + +@_attrs_define +class UpdateAccountResponse: + """ + Attributes: + account (Account): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/UpdateAccountResponse.json. + """ + + account: Account + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + account = self.account.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "account": account, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.account import Account + + d = dict(src_dict) + account = Account.from_dict(d.pop("account")) + + schema = d.pop("$schema", UNSET) + + update_account_response = cls( + account=account, + schema=schema, + ) + + return update_account_response diff --git a/src/tower/tower_api_client/models/update_app_environment_params.py b/src/tower/tower_api_client/models/update_app_environment_params.py new file mode 100644 index 00000000..26f09c97 --- /dev/null +++ b/src/tower/tower_api_client/models/update_app_environment_params.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateAppEnvironmentParams") + + +@_attrs_define +class UpdateAppEnvironmentParams: + """ + Attributes: + version (str): The version to deploy to this environment, e.g. 'v1', 'v2'. + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/UpdateAppEnvironmentParams.json. + """ + + version: str + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + version = self.version + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "version": version, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + version = d.pop("version") + + schema = d.pop("$schema", UNSET) + + update_app_environment_params = cls( + version=version, + schema=schema, + ) + + return update_app_environment_params diff --git a/src/tower/tower_api_client/models/update_app_environment_response.py b/src/tower/tower_api_client/models/update_app_environment_response.py new file mode 100644 index 00000000..f0432792 --- /dev/null +++ b/src/tower/tower_api_client/models/update_app_environment_response.py @@ -0,0 +1,62 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateAppEnvironmentResponse") + + +@_attrs_define +class UpdateAppEnvironmentResponse: + """ + Attributes: + environment (str): + version (str): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/UpdateAppEnvironmentResponse.json. + """ + + environment: str + version: str + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + environment = self.environment + + version = self.version + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "environment": environment, + "version": version, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + environment = d.pop("environment") + + version = d.pop("version") + + schema = d.pop("$schema", UNSET) + + update_app_environment_response = cls( + environment=environment, + version=version, + schema=schema, + ) + + return update_app_environment_response diff --git a/src/tower/tower_api_client/models/update_app_params.py b/src/tower/tower_api_client/models/update_app_params.py new file mode 100644 index 00000000..c1d71216 --- /dev/null +++ b/src/tower/tower_api_client/models/update_app_params.py @@ -0,0 +1,191 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.run_retry_policy import RunRetryPolicy + + +T = TypeVar("T", bound="UpdateAppParams") + + +@_attrs_define +class UpdateAppParams: + """ + Attributes: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/UpdateAppParams.json. + description (None | str | Unset): New description for the App + is_externally_accessible (bool | None | Unset): Indicates that web traffic should be routed to this app and that + its runs should get a hostname assigned to it. + pending_timeout (int | None | Unset): The amount of time in seconds that runs of this app can stay in pending + state before being marked as failed. + retry_policy (RunRetryPolicy | Unset): + running_timeout (int | None | Unset): The amount of time in seconds that runs of this app can stay in running + state before being marked as failed. + status (None | str | Unset): New status for the App + subdomain (None | str | Unset): The subdomain this app is accessible under. Requires is_externally_accessible to + be true. + """ + + schema: str | Unset = UNSET + description: None | str | Unset = UNSET + is_externally_accessible: bool | None | Unset = UNSET + pending_timeout: int | None | Unset = UNSET + retry_policy: RunRetryPolicy | Unset = UNSET + running_timeout: int | None | Unset = UNSET + status: None | str | Unset = UNSET + subdomain: None | str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + schema = self.schema + + description: None | str | Unset + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + is_externally_accessible: bool | None | Unset + if isinstance(self.is_externally_accessible, Unset): + is_externally_accessible = UNSET + else: + is_externally_accessible = self.is_externally_accessible + + pending_timeout: int | None | Unset + if isinstance(self.pending_timeout, Unset): + pending_timeout = UNSET + else: + pending_timeout = self.pending_timeout + + retry_policy: dict[str, Any] | Unset = UNSET + if not isinstance(self.retry_policy, Unset): + retry_policy = self.retry_policy.to_dict() + + running_timeout: int | None | Unset + if isinstance(self.running_timeout, Unset): + running_timeout = UNSET + else: + running_timeout = self.running_timeout + + status: None | str | Unset + if isinstance(self.status, Unset): + status = UNSET + else: + status = self.status + + subdomain: None | str | Unset + if isinstance(self.subdomain, Unset): + subdomain = UNSET + else: + subdomain = self.subdomain + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if schema is not UNSET: + field_dict["$schema"] = schema + if description is not UNSET: + field_dict["description"] = description + if is_externally_accessible is not UNSET: + field_dict["is_externally_accessible"] = is_externally_accessible + if pending_timeout is not UNSET: + field_dict["pending_timeout"] = pending_timeout + if retry_policy is not UNSET: + field_dict["retry_policy"] = retry_policy + if running_timeout is not UNSET: + field_dict["running_timeout"] = running_timeout + if status is not UNSET: + field_dict["status"] = status + if subdomain is not UNSET: + field_dict["subdomain"] = subdomain + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.run_retry_policy import RunRetryPolicy + + d = dict(src_dict) + schema = d.pop("$schema", UNSET) + + def _parse_description(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + description = _parse_description(d.pop("description", UNSET)) + + def _parse_is_externally_accessible(data: object) -> bool | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(bool | None | Unset, data) + + is_externally_accessible = _parse_is_externally_accessible( + d.pop("is_externally_accessible", UNSET) + ) + + def _parse_pending_timeout(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + pending_timeout = _parse_pending_timeout(d.pop("pending_timeout", UNSET)) + + _retry_policy = d.pop("retry_policy", UNSET) + retry_policy: RunRetryPolicy | Unset + if isinstance(_retry_policy, Unset): + retry_policy = UNSET + else: + retry_policy = RunRetryPolicy.from_dict(_retry_policy) + + def _parse_running_timeout(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + running_timeout = _parse_running_timeout(d.pop("running_timeout", UNSET)) + + def _parse_status(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + status = _parse_status(d.pop("status", UNSET)) + + def _parse_subdomain(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + subdomain = _parse_subdomain(d.pop("subdomain", UNSET)) + + update_app_params = cls( + schema=schema, + description=description, + is_externally_accessible=is_externally_accessible, + pending_timeout=pending_timeout, + retry_policy=retry_policy, + running_timeout=running_timeout, + status=status, + subdomain=subdomain, + ) + + return update_app_params diff --git a/src/tower/tower_api_client/models/update_app_response.py b/src/tower/tower_api_client/models/update_app_response.py new file mode 100644 index 00000000..2cc99f8f --- /dev/null +++ b/src/tower/tower_api_client/models/update_app_response.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.app import App + + +T = TypeVar("T", bound="UpdateAppResponse") + + +@_attrs_define +class UpdateAppResponse: + """ + Attributes: + App (App): + app (App): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/UpdateAppResponse.json. + """ + + App: App + app: App + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + from ..models.app import App + + App = self.App.to_dict() + + app = self.app.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "App": App, + "app": app, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.app import App + + d = dict(src_dict) + App = App.from_dict(d.pop("App")) + + app = App.from_dict(d.pop("app")) + + schema = d.pop("$schema", UNSET) + + update_app_response = cls( + App=App, + app=app, + schema=schema, + ) + + return update_app_response diff --git a/src/tower/tower_api_client/models/update_catalog_params.py b/src/tower/tower_api_client/models/update_catalog_params.py new file mode 100644 index 00000000..7df04285 --- /dev/null +++ b/src/tower/tower_api_client/models/update_catalog_params.py @@ -0,0 +1,76 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.encrypted_catalog_property import EncryptedCatalogProperty + + +T = TypeVar("T", bound="UpdateCatalogParams") + + +@_attrs_define +class UpdateCatalogParams: + """ + Attributes: + environment (str): New environment for the catalog + properties (list[EncryptedCatalogProperty]): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/UpdateCatalogParams.json. + """ + + environment: str + properties: list[EncryptedCatalogProperty] + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + environment = self.environment + + properties = [] + for properties_item_data in self.properties: + properties_item = properties_item_data.to_dict() + properties.append(properties_item) + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "environment": environment, + "properties": properties, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.encrypted_catalog_property import EncryptedCatalogProperty + + d = dict(src_dict) + environment = d.pop("environment") + + properties = [] + _properties = d.pop("properties") + for properties_item_data in _properties: + properties_item = EncryptedCatalogProperty.from_dict(properties_item_data) + + properties.append(properties_item) + + schema = d.pop("$schema", UNSET) + + update_catalog_params = cls( + environment=environment, + properties=properties, + schema=schema, + ) + + return update_catalog_params diff --git a/src/tower/tower_api_client/models/update_catalog_response.py b/src/tower/tower_api_client/models/update_catalog_response.py new file mode 100644 index 00000000..64a41120 --- /dev/null +++ b/src/tower/tower_api_client/models/update_catalog_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.catalog import Catalog + + +T = TypeVar("T", bound="UpdateCatalogResponse") + + +@_attrs_define +class UpdateCatalogResponse: + """ + Attributes: + catalog (Catalog): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/UpdateCatalogResponse.json. + """ + + catalog: Catalog + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + catalog = self.catalog.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "catalog": catalog, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.catalog import Catalog + + d = dict(src_dict) + catalog = Catalog.from_dict(d.pop("catalog")) + + schema = d.pop("$schema", UNSET) + + update_catalog_response = cls( + catalog=catalog, + schema=schema, + ) + + return update_catalog_response diff --git a/src/tower/tower_api_client/models/update_email_preferences_body.py b/src/tower/tower_api_client/models/update_email_preferences_body.py new file mode 100644 index 00000000..c6029d63 --- /dev/null +++ b/src/tower/tower_api_client/models/update_email_preferences_body.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.email_subscriptions import EmailSubscriptions + + +T = TypeVar("T", bound="UpdateEmailPreferencesBody") + + +@_attrs_define +class UpdateEmailPreferencesBody: + """ + Attributes: + subscriptions (EmailSubscriptions): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/UpdateEmailPreferencesBody.json. + """ + + subscriptions: EmailSubscriptions + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + subscriptions = self.subscriptions.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "subscriptions": subscriptions, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.email_subscriptions import EmailSubscriptions + + d = dict(src_dict) + subscriptions = EmailSubscriptions.from_dict(d.pop("subscriptions")) + + schema = d.pop("$schema", UNSET) + + update_email_preferences_body = cls( + subscriptions=subscriptions, + schema=schema, + ) + + return update_email_preferences_body diff --git a/src/tower/tower_api_client/models/update_environment_params.py b/src/tower/tower_api_client/models/update_environment_params.py new file mode 100644 index 00000000..fc12ec91 --- /dev/null +++ b/src/tower/tower_api_client/models/update_environment_params.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateEnvironmentParams") + + +@_attrs_define +class UpdateEnvironmentParams: + """ + Attributes: + new_name (str): The desired new name of the environment + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/UpdateEnvironmentParams.json. + """ + + new_name: str + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + new_name = self.new_name + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "new_name": new_name, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + new_name = d.pop("new_name") + + schema = d.pop("$schema", UNSET) + + update_environment_params = cls( + new_name=new_name, + schema=schema, + ) + + return update_environment_params diff --git a/src/tower/tower_api_client/models/update_environment_response.py b/src/tower/tower_api_client/models/update_environment_response.py new file mode 100644 index 00000000..9368644b --- /dev/null +++ b/src/tower/tower_api_client/models/update_environment_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.environment import Environment + + +T = TypeVar("T", bound="UpdateEnvironmentResponse") + + +@_attrs_define +class UpdateEnvironmentResponse: + """ + Attributes: + environment (Environment): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/UpdateEnvironmentResponse.json. + """ + + environment: Environment + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + environment = self.environment.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "environment": environment, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.environment import Environment + + d = dict(src_dict) + environment = Environment.from_dict(d.pop("environment")) + + schema = d.pop("$schema", UNSET) + + update_environment_response = cls( + environment=environment, + schema=schema, + ) + + return update_environment_response diff --git a/src/tower/tower_api_client/models/update_my_team_invitation_params.py b/src/tower/tower_api_client/models/update_my_team_invitation_params.py new file mode 100644 index 00000000..a6f1f041 --- /dev/null +++ b/src/tower/tower_api_client/models/update_my_team_invitation_params.py @@ -0,0 +1,62 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateMyTeamInvitationParams") + + +@_attrs_define +class UpdateMyTeamInvitationParams: + """ + Attributes: + accepted (bool): Whether or not the invitation was accepted. If false, it's considered rejected. + name (str): The name of the team invitation to update + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/UpdateMyTeamInvitationParams.json. + """ + + accepted: bool + name: str + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + accepted = self.accepted + + name = self.name + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "accepted": accepted, + "name": name, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + accepted = d.pop("accepted") + + name = d.pop("name") + + schema = d.pop("$schema", UNSET) + + update_my_team_invitation_params = cls( + accepted=accepted, + name=name, + schema=schema, + ) + + return update_my_team_invitation_params diff --git a/src/tower/tower_api_client/models/update_my_team_invitation_response.py b/src/tower/tower_api_client/models/update_my_team_invitation_response.py new file mode 100644 index 00000000..ea503aaa --- /dev/null +++ b/src/tower/tower_api_client/models/update_my_team_invitation_response.py @@ -0,0 +1,43 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateMyTeamInvitationResponse") + + +@_attrs_define +class UpdateMyTeamInvitationResponse: + """ + Attributes: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/UpdateMyTeamInvitationResponse.json. + """ + + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + schema = d.pop("$schema", UNSET) + + update_my_team_invitation_response = cls( + schema=schema, + ) + + return update_my_team_invitation_response diff --git a/src/tower/tower_api_client/models/update_organization_params.py b/src/tower/tower_api_client/models/update_organization_params.py new file mode 100644 index 00000000..eba86aeb --- /dev/null +++ b/src/tower/tower_api_client/models/update_organization_params.py @@ -0,0 +1,53 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateOrganizationParams") + + +@_attrs_define +class UpdateOrganizationParams: + """ + Attributes: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/UpdateOrganizationParams.json. + name (str | Unset): The name of the organization to update. This is optional, if you supply null it will not + update the organization name. + """ + + schema: str | Unset = UNSET + name: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + schema = self.schema + + name = self.name + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if schema is not UNSET: + field_dict["$schema"] = schema + if name is not UNSET: + field_dict["name"] = name + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + schema = d.pop("$schema", UNSET) + + name = d.pop("name", UNSET) + + update_organization_params = cls( + schema=schema, + name=name, + ) + + return update_organization_params diff --git a/src/tower/tower_api_client/models/update_organization_response.py b/src/tower/tower_api_client/models/update_organization_response.py new file mode 100644 index 00000000..3bb4501f --- /dev/null +++ b/src/tower/tower_api_client/models/update_organization_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.organization import Organization + + +T = TypeVar("T", bound="UpdateOrganizationResponse") + + +@_attrs_define +class UpdateOrganizationResponse: + """ + Attributes: + organization (Organization): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/UpdateOrganizationResponse.json. + """ + + organization: Organization + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + organization = self.organization.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "organization": organization, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.organization import Organization + + d = dict(src_dict) + organization = Organization.from_dict(d.pop("organization")) + + schema = d.pop("$schema", UNSET) + + update_organization_response = cls( + organization=organization, + schema=schema, + ) + + return update_organization_response diff --git a/src/tower/tower_api_client/models/update_plan_params.py b/src/tower/tower_api_client/models/update_plan_params.py new file mode 100644 index 00000000..975cab1a --- /dev/null +++ b/src/tower/tower_api_client/models/update_plan_params.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdatePlanParams") + + +@_attrs_define +class UpdatePlanParams: + """ + Attributes: + base_plan_name (str): The name of the base plan to use. + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/UpdatePlanParams.json. + """ + + base_plan_name: str + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + base_plan_name = self.base_plan_name + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "base_plan_name": base_plan_name, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + base_plan_name = d.pop("base_plan_name") + + schema = d.pop("$schema", UNSET) + + update_plan_params = cls( + base_plan_name=base_plan_name, + schema=schema, + ) + + return update_plan_params diff --git a/src/tower/tower_api_client/models/update_plan_response.py b/src/tower/tower_api_client/models/update_plan_response.py new file mode 100644 index 00000000..eb96f53f --- /dev/null +++ b/src/tower/tower_api_client/models/update_plan_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.plan import Plan + + +T = TypeVar("T", bound="UpdatePlanResponse") + + +@_attrs_define +class UpdatePlanResponse: + """ + Attributes: + plan (Plan): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/UpdatePlanResponse.json. + """ + + plan: Plan + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + plan = self.plan.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "plan": plan, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.plan import Plan + + d = dict(src_dict) + plan = Plan.from_dict(d.pop("plan")) + + schema = d.pop("$schema", UNSET) + + update_plan_response = cls( + plan=plan, + schema=schema, + ) + + return update_plan_response diff --git a/src/tower/tower_api_client/models/update_schedule_params.py b/src/tower/tower_api_client/models/update_schedule_params.py new file mode 100644 index 00000000..fab0a6c0 --- /dev/null +++ b/src/tower/tower_api_client/models/update_schedule_params.py @@ -0,0 +1,186 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..models.update_schedule_params_overlap_policy import ( + UpdateScheduleParamsOverlapPolicy, +) +from ..models.update_schedule_params_status import UpdateScheduleParamsStatus +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.run_parameter_input import RunParameterInput + + +T = TypeVar("T", bound="UpdateScheduleParams") + + +@_attrs_define +class UpdateScheduleParams: + """ + Attributes: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/UpdateScheduleParams.json. + app_version (None | str | Unset): This property is deprecated and ignored. Schedules inherit the version from + their environment. + cron (str | Unset): The cron expression defining when the app should run + environment (str | Unset): The environment to run the app in Default: 'default'. + name (None | str | Unset): The name for this schedule. Must be unique per team. + overlap_policy (UpdateScheduleParamsOverlapPolicy | Unset): The overlap policy for the schedule + parameters (list[RunParameterInput] | Unset): Parameters to pass when running the app + status (UpdateScheduleParamsStatus | Unset): The status of the schedule + timezone (None | str | Unset): The IANA timezone identifier that the cron expression should be evaluated in + (e.g., 'America/New_York', 'Europe/London'). + """ + + schema: str | Unset = UNSET + app_version: None | str | Unset = UNSET + cron: str | Unset = UNSET + environment: str | Unset = "default" + name: None | str | Unset = UNSET + overlap_policy: UpdateScheduleParamsOverlapPolicy | Unset = UNSET + parameters: list[RunParameterInput] | Unset = UNSET + status: UpdateScheduleParamsStatus | Unset = UNSET + timezone: None | str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + schema = self.schema + + app_version: None | str | Unset + if isinstance(self.app_version, Unset): + app_version = UNSET + else: + app_version = self.app_version + + cron = self.cron + + environment = self.environment + + name: None | str | Unset + if isinstance(self.name, Unset): + name = UNSET + else: + name = self.name + + overlap_policy: str | Unset = UNSET + if not isinstance(self.overlap_policy, Unset): + overlap_policy = self.overlap_policy.value + + parameters: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.parameters, Unset): + parameters = [] + for parameters_item_data in self.parameters: + parameters_item = parameters_item_data.to_dict() + parameters.append(parameters_item) + + status: str | Unset = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + timezone: None | str | Unset + if isinstance(self.timezone, Unset): + timezone = UNSET + else: + timezone = self.timezone + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if schema is not UNSET: + field_dict["$schema"] = schema + if app_version is not UNSET: + field_dict["app_version"] = app_version + if cron is not UNSET: + field_dict["cron"] = cron + if environment is not UNSET: + field_dict["environment"] = environment + if name is not UNSET: + field_dict["name"] = name + if overlap_policy is not UNSET: + field_dict["overlap_policy"] = overlap_policy + if parameters is not UNSET: + field_dict["parameters"] = parameters + if status is not UNSET: + field_dict["status"] = status + if timezone is not UNSET: + field_dict["timezone"] = timezone + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.run_parameter_input import RunParameterInput + + d = dict(src_dict) + schema = d.pop("$schema", UNSET) + + def _parse_app_version(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + app_version = _parse_app_version(d.pop("app_version", UNSET)) + + cron = d.pop("cron", UNSET) + + environment = d.pop("environment", UNSET) + + def _parse_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + name = _parse_name(d.pop("name", UNSET)) + + _overlap_policy = d.pop("overlap_policy", UNSET) + overlap_policy: UpdateScheduleParamsOverlapPolicy | Unset + if isinstance(_overlap_policy, Unset): + overlap_policy = UNSET + else: + overlap_policy = UpdateScheduleParamsOverlapPolicy(_overlap_policy) + + _parameters = d.pop("parameters", UNSET) + parameters: list[RunParameterInput] | Unset = UNSET + if _parameters is not UNSET: + parameters = [] + for parameters_item_data in _parameters: + parameters_item = RunParameterInput.from_dict(parameters_item_data) + + parameters.append(parameters_item) + + _status = d.pop("status", UNSET) + status: UpdateScheduleParamsStatus | Unset + if isinstance(_status, Unset): + status = UNSET + else: + status = UpdateScheduleParamsStatus(_status) + + def _parse_timezone(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + timezone = _parse_timezone(d.pop("timezone", UNSET)) + + update_schedule_params = cls( + schema=schema, + app_version=app_version, + cron=cron, + environment=environment, + name=name, + overlap_policy=overlap_policy, + parameters=parameters, + status=status, + timezone=timezone, + ) + + return update_schedule_params diff --git a/src/tower/tower_api_client/models/update_schedule_params_overlap_policy.py b/src/tower/tower_api_client/models/update_schedule_params_overlap_policy.py new file mode 100644 index 00000000..ffa1779a --- /dev/null +++ b/src/tower/tower_api_client/models/update_schedule_params_overlap_policy.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class UpdateScheduleParamsOverlapPolicy(str, Enum): + ALLOW = "allow" + SKIP = "skip" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/update_schedule_params_status.py b/src/tower/tower_api_client/models/update_schedule_params_status.py new file mode 100644 index 00000000..2959b194 --- /dev/null +++ b/src/tower/tower_api_client/models/update_schedule_params_status.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class UpdateScheduleParamsStatus(str, Enum): + ACTIVE = "active" + DISABLED = "disabled" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/update_schedule_response.py b/src/tower/tower_api_client/models/update_schedule_response.py new file mode 100644 index 00000000..45313433 --- /dev/null +++ b/src/tower/tower_api_client/models/update_schedule_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.schedule import Schedule + + +T = TypeVar("T", bound="UpdateScheduleResponse") + + +@_attrs_define +class UpdateScheduleResponse: + """ + Attributes: + schedule (Schedule): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/UpdateScheduleResponse.json. + """ + + schedule: Schedule + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + schedule = self.schedule.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "schedule": schedule, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.schedule import Schedule + + d = dict(src_dict) + schedule = Schedule.from_dict(d.pop("schedule")) + + schema = d.pop("$schema", UNSET) + + update_schedule_response = cls( + schedule=schedule, + schema=schema, + ) + + return update_schedule_response diff --git a/src/tower/tower_api_client/models/update_secret_params.py b/src/tower/tower_api_client/models/update_secret_params.py new file mode 100644 index 00000000..d759ab36 --- /dev/null +++ b/src/tower/tower_api_client/models/update_secret_params.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateSecretParams") + + +@_attrs_define +class UpdateSecretParams: + """ + Attributes: + encrypted_value (str): + environment (str): + preview (str): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/UpdateSecretParams.json. + """ + + encrypted_value: str + environment: str + preview: str + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + encrypted_value = self.encrypted_value + + environment = self.environment + + preview = self.preview + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "encrypted_value": encrypted_value, + "environment": environment, + "preview": preview, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + encrypted_value = d.pop("encrypted_value") + + environment = d.pop("environment") + + preview = d.pop("preview") + + schema = d.pop("$schema", UNSET) + + update_secret_params = cls( + encrypted_value=encrypted_value, + environment=environment, + preview=preview, + schema=schema, + ) + + return update_secret_params diff --git a/src/tower/tower_api_client/models/update_secret_response.py b/src/tower/tower_api_client/models/update_secret_response.py new file mode 100644 index 00000000..9897ee11 --- /dev/null +++ b/src/tower/tower_api_client/models/update_secret_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.secret import Secret + + +T = TypeVar("T", bound="UpdateSecretResponse") + + +@_attrs_define +class UpdateSecretResponse: + """ + Attributes: + secret (Secret): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/UpdateSecretResponse.json. + """ + + secret: Secret + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + secret = self.secret.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "secret": secret, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.secret import Secret + + d = dict(src_dict) + secret = Secret.from_dict(d.pop("secret")) + + schema = d.pop("$schema", UNSET) + + update_secret_response = cls( + secret=secret, + schema=schema, + ) + + return update_secret_response diff --git a/src/tower/tower_api_client/models/update_team_member_params.py b/src/tower/tower_api_client/models/update_team_member_params.py new file mode 100644 index 00000000..ad8d0c5a --- /dev/null +++ b/src/tower/tower_api_client/models/update_team_member_params.py @@ -0,0 +1,71 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.update_team_member_params_role import UpdateTeamMemberParamsRole +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateTeamMemberParams") + + +@_attrs_define +class UpdateTeamMemberParams: + """ + Attributes: + email (str): The email address of the team member to update + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/UpdateTeamMemberParams.json. + role (UpdateTeamMemberParamsRole | Unset): The role to update the team member to + """ + + email: str + schema: str | Unset = UNSET + role: UpdateTeamMemberParamsRole | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + email = self.email + + schema = self.schema + + role: str | Unset = UNSET + if not isinstance(self.role, Unset): + role = self.role.value + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "email": email, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + if role is not UNSET: + field_dict["role"] = role + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + email = d.pop("email") + + schema = d.pop("$schema", UNSET) + + _role = d.pop("role", UNSET) + role: UpdateTeamMemberParamsRole | Unset + if isinstance(_role, Unset): + role = UNSET + else: + role = UpdateTeamMemberParamsRole(_role) + + update_team_member_params = cls( + email=email, + schema=schema, + role=role, + ) + + return update_team_member_params diff --git a/src/tower/tower_api_client/models/update_team_member_params_role.py b/src/tower/tower_api_client/models/update_team_member_params_role.py new file mode 100644 index 00000000..f594165e --- /dev/null +++ b/src/tower/tower_api_client/models/update_team_member_params_role.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class UpdateTeamMemberParamsRole(str, Enum): + ADMIN = "admin" + DEVELOPER = "developer" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/update_team_member_response.py b/src/tower/tower_api_client/models/update_team_member_response.py new file mode 100644 index 00000000..9d8e0b98 --- /dev/null +++ b/src/tower/tower_api_client/models/update_team_member_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.team_membership import TeamMembership + + +T = TypeVar("T", bound="UpdateTeamMemberResponse") + + +@_attrs_define +class UpdateTeamMemberResponse: + """ + Attributes: + team_member (TeamMembership): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/UpdateTeamMemberResponse.json. + """ + + team_member: TeamMembership + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + team_member = self.team_member.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "team_member": team_member, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.team_membership import TeamMembership + + d = dict(src_dict) + team_member = TeamMembership.from_dict(d.pop("team_member")) + + schema = d.pop("$schema", UNSET) + + update_team_member_response = cls( + team_member=team_member, + schema=schema, + ) + + return update_team_member_response diff --git a/src/tower/tower_api_client/models/update_team_params.py b/src/tower/tower_api_client/models/update_team_params.py new file mode 100644 index 00000000..4f82cc5b --- /dev/null +++ b/src/tower/tower_api_client/models/update_team_params.py @@ -0,0 +1,80 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..models.update_team_params_execution_region import UpdateTeamParamsExecutionRegion +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateTeamParams") + + +@_attrs_define +class UpdateTeamParams: + """ + Attributes: + name (None | str): The name of the team to update. This is optional, if you supply null it will not update the + team name. + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/UpdateTeamParams.json. + execution_region (UpdateTeamParamsExecutionRegion | Unset): The execution region for runs (eu-central-1 or us- + east-1) + """ + + name: None | str + schema: str | Unset = UNSET + execution_region: UpdateTeamParamsExecutionRegion | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + name: None | str + name = self.name + + schema = self.schema + + execution_region: str | Unset = UNSET + if not isinstance(self.execution_region, Unset): + execution_region = self.execution_region.value + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "name": name, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + if execution_region is not UNSET: + field_dict["execution_region"] = execution_region + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + + def _parse_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + name = _parse_name(d.pop("name")) + + schema = d.pop("$schema", UNSET) + + _execution_region = d.pop("execution_region", UNSET) + execution_region: UpdateTeamParamsExecutionRegion | Unset + if isinstance(_execution_region, Unset): + execution_region = UNSET + else: + execution_region = UpdateTeamParamsExecutionRegion(_execution_region) + + update_team_params = cls( + name=name, + schema=schema, + execution_region=execution_region, + ) + + return update_team_params diff --git a/src/tower/tower_api_client/models/update_team_params_execution_region.py b/src/tower/tower_api_client/models/update_team_params_execution_region.py new file mode 100644 index 00000000..8d3f524d --- /dev/null +++ b/src/tower/tower_api_client/models/update_team_params_execution_region.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class UpdateTeamParamsExecutionRegion(str, Enum): + EU_CENTRAL_1 = "eu-central-1" + US_EAST_1 = "us-east-1" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/update_team_response.py b/src/tower/tower_api_client/models/update_team_response.py new file mode 100644 index 00000000..e1e98f7b --- /dev/null +++ b/src/tower/tower_api_client/models/update_team_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.team import Team + + +T = TypeVar("T", bound="UpdateTeamResponse") + + +@_attrs_define +class UpdateTeamResponse: + """ + Attributes: + team (Team): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/UpdateTeamResponse.json. + """ + + team: Team + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + team = self.team.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "team": team, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.team import Team + + d = dict(src_dict) + team = Team.from_dict(d.pop("team")) + + schema = d.pop("$schema", UNSET) + + update_team_response = cls( + team=team, + schema=schema, + ) + + return update_team_response diff --git a/src/tower/tower_api_client/models/update_user_params.py b/src/tower/tower_api_client/models/update_user_params.py new file mode 100644 index 00000000..e441ebd4 --- /dev/null +++ b/src/tower/tower_api_client/models/update_user_params.py @@ -0,0 +1,254 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateUserParams") + + +@_attrs_define +class UpdateUserParams: + """ + Attributes: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/UpdateUserParams.json. + company (None | str | Unset): + country (None | str | Unset): + first_name (None | str | Unset): + is_alerts_enabled (bool | None | Unset): + is_subscribed_to_changelog (bool | None | Unset): If true, the user will receive changelog updates via email. + is_subscribed_to_marketing_emails (bool | None | Unset): If true, the user will receive marketing emails from + Tower. + is_subscribed_to_newsletter (bool | None | Unset): If true, the user will receive the Tower newsletter. + last_name (None | str | Unset): + password (None | str | Unset): + promo_code (None | str | Unset): + """ + + schema: str | Unset = UNSET + company: None | str | Unset = UNSET + country: None | str | Unset = UNSET + first_name: None | str | Unset = UNSET + is_alerts_enabled: bool | None | Unset = UNSET + is_subscribed_to_changelog: bool | None | Unset = UNSET + is_subscribed_to_marketing_emails: bool | None | Unset = UNSET + is_subscribed_to_newsletter: bool | None | Unset = UNSET + last_name: None | str | Unset = UNSET + password: None | str | Unset = UNSET + promo_code: None | str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + schema = self.schema + + company: None | str | Unset + if isinstance(self.company, Unset): + company = UNSET + else: + company = self.company + + country: None | str | Unset + if isinstance(self.country, Unset): + country = UNSET + else: + country = self.country + + first_name: None | str | Unset + if isinstance(self.first_name, Unset): + first_name = UNSET + else: + first_name = self.first_name + + is_alerts_enabled: bool | None | Unset + if isinstance(self.is_alerts_enabled, Unset): + is_alerts_enabled = UNSET + else: + is_alerts_enabled = self.is_alerts_enabled + + is_subscribed_to_changelog: bool | None | Unset + if isinstance(self.is_subscribed_to_changelog, Unset): + is_subscribed_to_changelog = UNSET + else: + is_subscribed_to_changelog = self.is_subscribed_to_changelog + + is_subscribed_to_marketing_emails: bool | None | Unset + if isinstance(self.is_subscribed_to_marketing_emails, Unset): + is_subscribed_to_marketing_emails = UNSET + else: + is_subscribed_to_marketing_emails = self.is_subscribed_to_marketing_emails + + is_subscribed_to_newsletter: bool | None | Unset + if isinstance(self.is_subscribed_to_newsletter, Unset): + is_subscribed_to_newsletter = UNSET + else: + is_subscribed_to_newsletter = self.is_subscribed_to_newsletter + + last_name: None | str | Unset + if isinstance(self.last_name, Unset): + last_name = UNSET + else: + last_name = self.last_name + + password: None | str | Unset + if isinstance(self.password, Unset): + password = UNSET + else: + password = self.password + + promo_code: None | str | Unset + if isinstance(self.promo_code, Unset): + promo_code = UNSET + else: + promo_code = self.promo_code + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if schema is not UNSET: + field_dict["$schema"] = schema + if company is not UNSET: + field_dict["company"] = company + if country is not UNSET: + field_dict["country"] = country + if first_name is not UNSET: + field_dict["first_name"] = first_name + if is_alerts_enabled is not UNSET: + field_dict["is_alerts_enabled"] = is_alerts_enabled + if is_subscribed_to_changelog is not UNSET: + field_dict["is_subscribed_to_changelog"] = is_subscribed_to_changelog + if is_subscribed_to_marketing_emails is not UNSET: + field_dict["is_subscribed_to_marketing_emails"] = ( + is_subscribed_to_marketing_emails + ) + if is_subscribed_to_newsletter is not UNSET: + field_dict["is_subscribed_to_newsletter"] = is_subscribed_to_newsletter + if last_name is not UNSET: + field_dict["last_name"] = last_name + if password is not UNSET: + field_dict["password"] = password + if promo_code is not UNSET: + field_dict["promo_code"] = promo_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + schema = d.pop("$schema", UNSET) + + def _parse_company(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + company = _parse_company(d.pop("company", UNSET)) + + def _parse_country(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + country = _parse_country(d.pop("country", UNSET)) + + def _parse_first_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + first_name = _parse_first_name(d.pop("first_name", UNSET)) + + def _parse_is_alerts_enabled(data: object) -> bool | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(bool | None | Unset, data) + + is_alerts_enabled = _parse_is_alerts_enabled(d.pop("is_alerts_enabled", UNSET)) + + def _parse_is_subscribed_to_changelog(data: object) -> bool | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(bool | None | Unset, data) + + is_subscribed_to_changelog = _parse_is_subscribed_to_changelog( + d.pop("is_subscribed_to_changelog", UNSET) + ) + + def _parse_is_subscribed_to_marketing_emails( + data: object, + ) -> bool | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(bool | None | Unset, data) + + is_subscribed_to_marketing_emails = _parse_is_subscribed_to_marketing_emails( + d.pop("is_subscribed_to_marketing_emails", UNSET) + ) + + def _parse_is_subscribed_to_newsletter(data: object) -> bool | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(bool | None | Unset, data) + + is_subscribed_to_newsletter = _parse_is_subscribed_to_newsletter( + d.pop("is_subscribed_to_newsletter", UNSET) + ) + + def _parse_last_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + last_name = _parse_last_name(d.pop("last_name", UNSET)) + + def _parse_password(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + password = _parse_password(d.pop("password", UNSET)) + + def _parse_promo_code(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + promo_code = _parse_promo_code(d.pop("promo_code", UNSET)) + + update_user_params = cls( + schema=schema, + company=company, + country=country, + first_name=first_name, + is_alerts_enabled=is_alerts_enabled, + is_subscribed_to_changelog=is_subscribed_to_changelog, + is_subscribed_to_marketing_emails=is_subscribed_to_marketing_emails, + is_subscribed_to_newsletter=is_subscribed_to_newsletter, + last_name=last_name, + password=password, + promo_code=promo_code, + ) + + return update_user_params diff --git a/src/tower/tower_api_client/models/update_user_response.py b/src/tower/tower_api_client/models/update_user_response.py new file mode 100644 index 00000000..76524c4a --- /dev/null +++ b/src/tower/tower_api_client/models/update_user_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.user import User + + +T = TypeVar("T", bound="UpdateUserResponse") + + +@_attrs_define +class UpdateUserResponse: + """ + Attributes: + user (User): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/UpdateUserResponse.json. + """ + + user: User + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + user = self.user.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "user": user, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.user import User + + d = dict(src_dict) + user = User.from_dict(d.pop("user")) + + schema = d.pop("$schema", UNSET) + + update_user_response = cls( + user=user, + schema=schema, + ) + + return update_user_response diff --git a/src/tower/tower_api_client/models/update_webhook_params.py b/src/tower/tower_api_client/models/update_webhook_params.py new file mode 100644 index 00000000..84f1532f --- /dev/null +++ b/src/tower/tower_api_client/models/update_webhook_params.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateWebhookParams") + + +@_attrs_define +class UpdateWebhookParams: + """ + Attributes: + name (str): The new name of the webhook. + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/UpdateWebhookParams.json. + """ + + name: str + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + name = self.name + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "name": name, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + schema = d.pop("$schema", UNSET) + + update_webhook_params = cls( + name=name, + schema=schema, + ) + + return update_webhook_params diff --git a/src/tower/tower_api_client/models/update_webhook_response.py b/src/tower/tower_api_client/models/update_webhook_response.py new file mode 100644 index 00000000..188eaa37 --- /dev/null +++ b/src/tower/tower_api_client/models/update_webhook_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.webhook import Webhook + + +T = TypeVar("T", bound="UpdateWebhookResponse") + + +@_attrs_define +class UpdateWebhookResponse: + """ + Attributes: + webhook (Webhook): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- + dev.net/v1/schemas/UpdateWebhookResponse.json. + """ + + webhook: Webhook + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + webhook = self.webhook.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "webhook": webhook, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.webhook import Webhook + + d = dict(src_dict) + webhook = Webhook.from_dict(d.pop("webhook")) + + schema = d.pop("$schema", UNSET) + + update_webhook_response = cls( + webhook=webhook, + schema=schema, + ) + + return update_webhook_response diff --git a/src/tower/tower_api_client/models/usage_limit.py b/src/tower/tower_api_client/models/usage_limit.py new file mode 100644 index 00000000..e3503dcf --- /dev/null +++ b/src/tower/tower_api_client/models/usage_limit.py @@ -0,0 +1,51 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="UsageLimit") + + +@_attrs_define +class UsageLimit: + """ + Attributes: + limit (int): For numeric quotas: the maximum number of units allowed (-1 means unlimited). For boolean + entitlements (e.g. self_hosted_runners): 0 = disabled, 1 = enabled. + used (int): The number of units used for this resource. + """ + + limit: int + used: int + + def to_dict(self) -> dict[str, Any]: + limit = self.limit + + used = self.used + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "limit": limit, + "used": used, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + limit = d.pop("limit") + + used = d.pop("used") + + usage_limit = cls( + limit=limit, + used=used, + ) + + return usage_limit diff --git a/src/tower/tower_api_client/models/usage_metric_time_series_point.py b/src/tower/tower_api_client/models/usage_metric_time_series_point.py new file mode 100644 index 00000000..862b7c15 --- /dev/null +++ b/src/tower/tower_api_client/models/usage_metric_time_series_point.py @@ -0,0 +1,62 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.usage_metric_time_series_point_name import UsageMetricTimeSeriesPointName + +T = TypeVar("T", bound="UsageMetricTimeSeriesPoint") + + +@_attrs_define +class UsageMetricTimeSeriesPoint: + """ + Attributes: + date (datetime.datetime): + name (UsageMetricTimeSeriesPointName): + value (int): + """ + + date: datetime.datetime + name: UsageMetricTimeSeriesPointName + value: int + + def to_dict(self) -> dict[str, Any]: + date = self.date.isoformat() + + name = self.name.value + + value = self.value + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "date": date, + "name": name, + "value": value, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + date = isoparse(d.pop("date")) + + name = UsageMetricTimeSeriesPointName(d.pop("name")) + + value = d.pop("value") + + usage_metric_time_series_point = cls( + date=date, + name=name, + value=value, + ) + + return usage_metric_time_series_point diff --git a/src/tower/tower_api_client/models/usage_metric_time_series_point_name.py b/src/tower/tower_api_client/models/usage_metric_time_series_point_name.py new file mode 100644 index 00000000..4e55c479 --- /dev/null +++ b/src/tower/tower_api_client/models/usage_metric_time_series_point_name.py @@ -0,0 +1,8 @@ +from enum import Enum + + +class UsageMetricTimeSeriesPointName(str, Enum): + RUN_SECONDS = "run_seconds" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/user.py b/src/tower/tower_api_client/models/user.py new file mode 100644 index 00000000..0ef65262 --- /dev/null +++ b/src/tower/tower_api_client/models/user.py @@ -0,0 +1,135 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="User") + + +@_attrs_define +class User: + """ + Attributes: + company (str): + country (str): + created_at (datetime.datetime): + email (str): + first_name (str): + is_alerts_enabled (bool): + is_confirmed (bool): + is_subscribed_to_changelog (bool): + last_name (str): + profile_photo_url (str): + promo_code (str): + is_invitation_claimed (bool | Unset): This property is deprecated. It will be removed in a future version. + """ + + company: str + country: str + created_at: datetime.datetime + email: str + first_name: str + is_alerts_enabled: bool + is_confirmed: bool + is_subscribed_to_changelog: bool + last_name: str + profile_photo_url: str + promo_code: str + is_invitation_claimed: bool | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + company = self.company + + country = self.country + + created_at = self.created_at.isoformat() + + email = self.email + + first_name = self.first_name + + is_alerts_enabled = self.is_alerts_enabled + + is_confirmed = self.is_confirmed + + is_subscribed_to_changelog = self.is_subscribed_to_changelog + + last_name = self.last_name + + profile_photo_url = self.profile_photo_url + + promo_code = self.promo_code + + is_invitation_claimed = self.is_invitation_claimed + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "company": company, + "country": country, + "created_at": created_at, + "email": email, + "first_name": first_name, + "is_alerts_enabled": is_alerts_enabled, + "is_confirmed": is_confirmed, + "is_subscribed_to_changelog": is_subscribed_to_changelog, + "last_name": last_name, + "profile_photo_url": profile_photo_url, + "promo_code": promo_code, + } + ) + if is_invitation_claimed is not UNSET: + field_dict["is_invitation_claimed"] = is_invitation_claimed + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + company = d.pop("company") + + country = d.pop("country") + + created_at = isoparse(d.pop("created_at")) + + email = d.pop("email") + + first_name = d.pop("first_name") + + is_alerts_enabled = d.pop("is_alerts_enabled") + + is_confirmed = d.pop("is_confirmed") + + is_subscribed_to_changelog = d.pop("is_subscribed_to_changelog") + + last_name = d.pop("last_name") + + profile_photo_url = d.pop("profile_photo_url") + + promo_code = d.pop("promo_code") + + is_invitation_claimed = d.pop("is_invitation_claimed", UNSET) + + user = cls( + company=company, + country=country, + created_at=created_at, + email=email, + first_name=first_name, + is_alerts_enabled=is_alerts_enabled, + is_confirmed=is_confirmed, + is_subscribed_to_changelog=is_subscribed_to_changelog, + last_name=last_name, + profile_photo_url=profile_photo_url, + promo_code=promo_code, + is_invitation_claimed=is_invitation_claimed, + ) + + return user diff --git a/src/tower/tower_api_client/models/webhook.py b/src/tower/tower_api_client/models/webhook.py new file mode 100644 index 00000000..023f8948 --- /dev/null +++ b/src/tower/tower_api_client/models/webhook.py @@ -0,0 +1,128 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.webhook_state import WebhookState +from ..types import UNSET, Unset + +T = TypeVar("T", bound="Webhook") + + +@_attrs_define +class Webhook: + """ + Attributes: + account_id (str): + created_at (datetime.datetime): + created_by_id (str): + last_checked_at (datetime.datetime | None): + name (str): + state (WebhookState): + url (str): + deleted_at (datetime.datetime | Unset): + """ + + account_id: str + created_at: datetime.datetime + created_by_id: str + last_checked_at: datetime.datetime | None + name: str + state: WebhookState + url: str + deleted_at: datetime.datetime | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + created_at = self.created_at.isoformat() + + created_by_id = self.created_by_id + + last_checked_at: None | str + if isinstance(self.last_checked_at, datetime.datetime): + last_checked_at = self.last_checked_at.isoformat() + else: + last_checked_at = self.last_checked_at + + name = self.name + + state = self.state.value + + url = self.url + + deleted_at: str | Unset = UNSET + if not isinstance(self.deleted_at, Unset): + deleted_at = self.deleted_at.isoformat() + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "account_id": account_id, + "created_at": created_at, + "created_by_id": created_by_id, + "last_checked_at": last_checked_at, + "name": name, + "state": state, + "url": url, + } + ) + if deleted_at is not UNSET: + field_dict["deleted_at"] = deleted_at + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + account_id = d.pop("account_id") + + created_at = isoparse(d.pop("created_at")) + + created_by_id = d.pop("created_by_id") + + def _parse_last_checked_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + last_checked_at_type_0 = isoparse(data) + + return last_checked_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + last_checked_at = _parse_last_checked_at(d.pop("last_checked_at")) + + name = d.pop("name") + + state = WebhookState(d.pop("state")) + + url = d.pop("url") + + _deleted_at = d.pop("deleted_at", UNSET) + deleted_at: datetime.datetime | Unset + if isinstance(_deleted_at, Unset): + deleted_at = UNSET + else: + deleted_at = isoparse(_deleted_at) + + webhook = cls( + account_id=account_id, + created_at=created_at, + created_by_id=created_by_id, + last_checked_at=last_checked_at, + name=name, + state=state, + url=url, + deleted_at=deleted_at, + ) + + return webhook diff --git a/src/tower/tower_api_client/models/webhook_state.py b/src/tower/tower_api_client/models/webhook_state.py new file mode 100644 index 00000000..b302e807 --- /dev/null +++ b/src/tower/tower_api_client/models/webhook_state.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class WebhookState(str, Enum): + HEALTHY = "healthy" + UNHEALTHY = "unhealthy" + UNKNOWN = "unknown" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/types.py b/src/tower/tower_api_client/types.py new file mode 100644 index 00000000..b64af095 --- /dev/null +++ b/src/tower/tower_api_client/types.py @@ -0,0 +1,54 @@ +"""Contains some shared types for properties""" + +from collections.abc import Mapping, MutableMapping +from http import HTTPStatus +from typing import IO, BinaryIO, Generic, Literal, TypeVar + +from attrs import define + + +class Unset: + def __bool__(self) -> Literal[False]: + return False + + +UNSET: Unset = Unset() + +# The types that `httpx.Client(files=)` can accept, copied from that library. +FileContent = IO[bytes] | bytes | str +FileTypes = ( + # (filename, file (or bytes), content_type) + tuple[str | None, FileContent, str | None] + # (filename, file (or bytes), content_type, headers) + | tuple[str | None, FileContent, str | None, Mapping[str, str]] +) +RequestFiles = list[tuple[str, FileTypes]] + + +@define +class File: + """Contains information for file uploads""" + + payload: BinaryIO + file_name: str | None = None + mime_type: str | None = None + + def to_tuple(self) -> FileTypes: + """Return a tuple representation that httpx will accept for multipart/form-data""" + return self.file_name, self.payload, self.mime_type + + +T = TypeVar("T") + + +@define +class Response(Generic[T]): + """A response from an endpoint""" + + status_code: HTTPStatus + content: bytes + headers: MutableMapping[str, str] + parsed: T | None + + +__all__ = ["UNSET", "File", "FileTypes", "RequestFiles", "Response", "Unset"] From d5da993bf0fd5ea35d257ff66c1cec598ee11cc9 Mon Sep 17 00:00:00 2001 From: Brad Heller Date: Thu, 23 Apr 2026 09:09:27 +0100 Subject: [PATCH 4/9] chore: Refactor how we track run status and add `starting`. Fix some broken test infra for the new starting properties, too. --- src/tower/_client.py | 23 ++++++++++++++++++++--- tests/tower/test_client.py | 2 ++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/tower/_client.py b/src/tower/_client.py index 02124280..522e38b0 100644 --- a/src/tower/_client.py +++ b/src/tower/_client.py @@ -24,6 +24,7 @@ RunAppParams, RunAppParamsParameters, RunAppResponse, + RunStatus, ) from .tower_api_client.models.error_model import ErrorModel from .tower_api_client.errors import UnexpectedStatus @@ -44,6 +45,22 @@ # API before we just give up entirely. DEFAULT_NUM_TIMEOUT_RETRIES = 5 +# TERMINAL_RUN_STATUSES are the run statuses that indicate that a run has finished, +# regardless of whether it completed successfully or not. +TERMINAL_RUN_STATUSES = [RunStatus.EXITED, RunStatus.CANCELLED, RunStatus.CRASHED, RunStatus.ERRORED] + +# SUCCESSFUL_RUN_STATUSES are the run statuses that indicate that a run has finished and +# completed successfully. +SUCCESSFUL_RUN_STATUSES = [RunStatus.EXITED] + +# FAILED_RUN_STATUSES are the run statuses that indicate that a run has finished but +# did not complete successfully. +FAILED_RUN_STATUSES = [RunStatus.ERRORED, RunStatus.CANCELLED, RunStatus.CRASHED] + +# AWAITING_RUN_STATUSES are the run statuses that indicate that a run is either currently +# running or is expected to run in the near future. +AWAITING_RUN_STATUSES = [RunStatus.PENDING, RunStatus.SCHEDULED, RunStatus.RUNNING, RunStatus.STARTING, RunStatus.RETRYING] + def run_app( name: str, @@ -279,7 +296,7 @@ def _is_failed_run(run: Run) -> bool: Returns: bool: True if the run has failed, False otherwise. """ - return run.status in ["crashed", "cancelled", "errored"] + return run.status in FAILED_RUN_STATUSES def _is_successful_run(run: Run) -> bool: @@ -292,7 +309,7 @@ def _is_successful_run(run: Run) -> bool: Returns: bool: True if the run was successful, False otherwise. """ - return run.status in ["exited"] + return run.status in SUCCESSFUL_RUN_STATUSES def _is_run_awaiting_completion(run: Run) -> bool: @@ -305,7 +322,7 @@ def _is_run_awaiting_completion(run: Run) -> bool: Returns: bool: True if the run is awaiting run or currently running, False otherwise. """ - return run.status in ["pending", "scheduled", "running"] + return run.status in AWAITING_RUN_STATUSES def _env_client( diff --git a/tests/tower/test_client.py b/tests/tower/test_client.py index beb48cc7..04e44e0d 100644 --- a/tests/tower/test_client.py +++ b/tests/tower/test_client.py @@ -50,6 +50,7 @@ def _create_run_response( "number": number, "run_id": run_id, "scheduled_at": "2025-04-25T20:54:58.761867Z", + "starting_at": "2025-04-25T20:54:59.366937Z", "started_at": "2025-04-25T20:54:59.366937Z", "status": status, "exit_code": None, @@ -100,6 +101,7 @@ def _create_run( number=number, run_id=run_id, scheduled_at="2025-04-25T20:54:58.761867Z", + starting_at="2025-04-25T20:54:59.366937Z", started_at="2025-04-25T20:54:59.366937Z", status=status, status_group=status_group, From f614bb7f9f344a46627835c8aeb60021c115bb5d Mon Sep 17 00:00:00 2001 From: Brad Heller Date: Thu, 23 Apr 2026 09:10:27 +0100 Subject: [PATCH 5/9] chore: Fix formatting --- src/tower/_client.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/tower/_client.py b/src/tower/_client.py index 522e38b0..9ec118f7 100644 --- a/src/tower/_client.py +++ b/src/tower/_client.py @@ -47,7 +47,12 @@ # TERMINAL_RUN_STATUSES are the run statuses that indicate that a run has finished, # regardless of whether it completed successfully or not. -TERMINAL_RUN_STATUSES = [RunStatus.EXITED, RunStatus.CANCELLED, RunStatus.CRASHED, RunStatus.ERRORED] +TERMINAL_RUN_STATUSES = [ + RunStatus.EXITED, + RunStatus.CANCELLED, + RunStatus.CRASHED, + RunStatus.ERRORED, +] # SUCCESSFUL_RUN_STATUSES are the run statuses that indicate that a run has finished and # completed successfully. @@ -59,7 +64,13 @@ # AWAITING_RUN_STATUSES are the run statuses that indicate that a run is either currently # running or is expected to run in the near future. -AWAITING_RUN_STATUSES = [RunStatus.PENDING, RunStatus.SCHEDULED, RunStatus.RUNNING, RunStatus.STARTING, RunStatus.RETRYING] +AWAITING_RUN_STATUSES = [ + RunStatus.PENDING, + RunStatus.SCHEDULED, + RunStatus.RUNNING, + RunStatus.STARTING, + RunStatus.RETRYING, +] def run_app( From 766023416901ae042c74f32e986e3eaf8afdf44c Mon Sep 17 00:00:00 2001 From: Brad Heller Date: Thu, 23 Apr 2026 09:25:31 +0100 Subject: [PATCH 6/9] chore: Add `starting` to the rust side, too --- crates/tower-cmd/src/apps.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/tower-cmd/src/apps.rs b/crates/tower-cmd/src/apps.rs index ab632620..a75d51c5 100644 --- a/crates/tower-cmd/src/apps.rs +++ b/crates/tower-cmd/src/apps.rs @@ -552,7 +552,7 @@ fn is_run_finished(run: &Run) -> bool { fn is_run_started(run: &Run) -> bool { match run.status { - tower_api::models::run::Status::Scheduled | tower_api::models::run::Status::Pending => { + tower_api::models::run::Status::Scheduled | tower_api::models::run::Status::Pending | tower_api::models::run::Status::Starting => { false } _ => true, @@ -636,6 +636,7 @@ mod tests { let status = Status::Scheduled; match status { Status::Scheduled => {} + Status::Starting => {} Status::Pending => {} Status::Running => {} Status::Retrying => {} @@ -648,7 +649,7 @@ mod tests { #[test] fn test_run_started_statuses() { - let not_started = [Status::Scheduled, Status::Pending]; + let not_started = [Status::Scheduled, Status::Pending, Status::Starting]; for status in not_started { let run = Run { status, From 2387a99a59fb3c525adcb748ecf595432e597753 Mon Sep 17 00:00:00 2001 From: Brad Heller Date: Sat, 2 May 2026 08:28:28 +0100 Subject: [PATCH 7/9] chore: Regenerate API clients against prod schema Refresh Python and Rust clients from api.tower.dev now that the starting state has shipped. Adapt tower-cmd call sites: revert RunParameterInput -> RunParameter (prod kept the original name) and pass environment: None for the new optional DescribeAppParams field. Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/tower-api/README.md | 5 +- crates/tower-api/src/apis/configuration.rs | 4 +- crates/tower-api/src/apis/default_api.rs | 7 ++- .../tower-api/src/apis/feature_flags_api.rs | 2 +- crates/tower-api/src/models/account.rs | 2 +- .../src/models/acknowledge_alert_response.rs | 2 +- .../models/acknowledge_all_alerts_response.rs | 2 +- crates/tower-api/src/models/alert.rs | 2 +- crates/tower-api/src/models/api_key.rs | 2 +- crates/tower-api/src/models/app.rs | 2 +- crates/tower-api/src/models/app_statistics.rs | 2 +- crates/tower-api/src/models/app_summary.rs | 2 +- crates/tower-api/src/models/app_version.rs | 2 +- .../src/models/authentication_context.rs | 2 +- .../src/models/batch_schedule_params.rs | 2 +- .../src/models/batch_schedule_response.rs | 2 +- .../src/models/cancel_run_response.rs | 14 ++++- crates/tower-api/src/models/catalog.rs | 2 +- .../tower-api/src/models/catalog_property.rs | 2 +- .../claim_device_login_ticket_params.rs | 2 +- .../claim_device_login_ticket_response.rs | 2 +- .../src/models/create_account_params.rs | 2 +- .../create_account_params_flags_struct.rs | 2 +- .../src/models/create_account_response.rs | 2 +- .../src/models/create_api_key_params.rs | 2 +- .../src/models/create_api_key_response.rs | 2 +- .../tower-api/src/models/create_app_params.rs | 2 +- .../src/models/create_app_response.rs | 2 +- .../src/models/create_catalog_params.rs | 2 +- .../src/models/create_catalog_response.rs | 2 +- .../create_device_login_ticket_response.rs | 2 +- .../src/models/create_environment_params.rs | 2 +- .../src/models/create_environment_response.rs | 2 +- .../src/models/create_guest_params.rs | 2 +- .../src/models/create_guest_response.rs | 2 +- .../models/create_sandbox_secrets_params.rs | 2 +- .../models/create_sandbox_secrets_response.rs | 2 +- .../src/models/create_schedule_params.rs | 4 +- .../src/models/create_schedule_response.rs | 2 +- .../src/models/create_secret_params.rs | 2 +- .../src/models/create_secret_response.rs | 2 +- .../src/models/create_session_params.rs | 2 +- .../src/models/create_session_response.rs | 2 +- .../src/models/create_team_params.rs | 2 +- .../src/models/create_team_response.rs | 2 +- .../src/models/create_webhook_params.rs | 2 +- .../src/models/create_webhook_response.rs | 2 +- .../src/models/delete_api_key_params.rs | 2 +- .../src/models/delete_api_key_response.rs | 2 +- .../src/models/delete_app_response.rs | 2 +- .../src/models/delete_catalog_response.rs | 2 +- .../src/models/delete_guest_output_body.rs | 2 +- .../src/models/delete_schedule_params.rs | 2 +- .../src/models/delete_schedule_response.rs | 2 +- .../src/models/delete_secret_response.rs | 2 +- .../src/models/delete_session_params.rs | 2 +- .../src/models/delete_session_response.rs | 2 +- .../models/delete_team_invitation_params.rs | 2 +- .../models/delete_team_invitation_response.rs | 2 +- .../src/models/delete_team_params.rs | 2 +- .../src/models/delete_team_response.rs | 2 +- .../src/models/delete_webhook_response.rs | 2 +- .../src/models/deploy_app_request.rs | 2 +- .../src/models/deploy_app_response.rs | 2 +- .../src/models/describe_account_body.rs | 2 +- .../src/models/describe_app_response.rs | 2 +- .../models/describe_app_version_response.rs | 2 +- .../describe_authentication_context_body.rs | 2 +- .../src/models/describe_catalog_response.rs | 2 +- .../describe_device_login_session_response.rs | 2 +- .../models/describe_email_preferences_body.rs | 2 +- .../src/models/describe_plan_response.rs | 2 +- .../src/models/describe_run_graph_response.rs | 2 +- .../src/models/describe_run_links.rs | 2 +- .../src/models/describe_run_logs_response.rs | 2 +- .../src/models/describe_run_response.rs | 2 +- .../models/describe_secrets_key_response.rs | 2 +- .../src/models/describe_session_response.rs | 2 +- .../src/models/describe_team_response.rs | 2 +- .../src/models/describe_webhook_response.rs | 2 +- .../src/models/email_subscriptions.rs | 2 +- .../src/models/encrypted_catalog_property.rs | 2 +- crates/tower-api/src/models/environment.rs | 2 +- crates/tower-api/src/models/error_detail.rs | 2 +- crates/tower-api/src/models/error_model.rs | 2 +- crates/tower-api/src/models/event_alert.rs | 2 +- crates/tower-api/src/models/event_error.rs | 2 +- crates/tower-api/src/models/event_log.rs | 2 +- .../tower-api/src/models/event_shouldertap.rs | 2 +- crates/tower-api/src/models/event_warning.rs | 2 +- .../src/models/export_catalogs_params.rs | 2 +- .../src/models/export_catalogs_response.rs | 2 +- .../src/models/export_secrets_params.rs | 2 +- .../src/models/export_secrets_response.rs | 2 +- .../tower-api/src/models/exported_catalog.rs | 2 +- .../src/models/exported_catalog_property.rs | 2 +- .../tower-api/src/models/exported_secret.rs | 2 +- crates/tower-api/src/models/feature.rs | 2 +- .../src/models/featurebase_identity.rs | 2 +- .../generate_app_statistics_response.rs | 2 +- ...organization_usage_time_series_response.rs | 2 +- .../generate_run_statistics_response.rs | 2 +- .../generate_runner_credentials_response.rs | 2 +- .../models/get_feature_flag_response_body.rs | 2 +- crates/tower-api/src/models/guest.rs | 2 +- .../src/models/invite_team_member_params.rs | 2 +- .../src/models/invite_team_member_response.rs | 2 +- .../src/models/leave_team_response.rs | 2 +- .../src/models/list_alerts_response.rs | 2 +- .../src/models/list_api_keys_response.rs | 2 +- .../models/list_app_environments_response.rs | 2 +- .../src/models/list_app_versions_response.rs | 2 +- .../src/models/list_apps_response.rs | 2 +- .../src/models/list_catalogs_response.rs | 2 +- .../src/models/list_environments_response.rs | 2 +- .../src/models/list_guests_response.rs | 2 +- .../list_my_team_invitations_response.rs | 2 +- .../src/models/list_runners_response.rs | 2 +- .../src/models/list_runs_response.rs | 2 +- .../src/models/list_schedules_response.rs | 2 +- .../list_secret_environments_response.rs | 2 +- .../src/models/list_secrets_response.rs | 2 +- .../models/list_team_invitations_response.rs | 2 +- .../src/models/list_team_members_response.rs | 2 +- .../src/models/list_teams_response.rs | 2 +- .../src/models/list_webhooks_response.rs | 2 +- crates/tower-api/src/models/mod.rs | 2 - crates/tower-api/src/models/organization.rs | 2 +- .../src/models/organization_usage.rs | 2 +- crates/tower-api/src/models/pagination.rs | 2 +- crates/tower-api/src/models/parameter.rs | 2 +- crates/tower-api/src/models/plan.rs | 2 +- .../src/models/refresh_session_params.rs | 2 +- .../src/models/refresh_session_response.rs | 2 +- .../regenerate_guest_login_url_params.rs | 2 +- .../regenerate_guest_login_url_response.rs | 2 +- .../src/models/remove_team_member_params.rs | 2 +- .../src/models/remove_team_member_response.rs | 2 +- .../models/resend_team_invitation_params.rs | 2 +- .../models/resend_team_invitation_response.rs | 2 +- crates/tower-api/src/models/run.rs | 2 +- .../src/models/run_app_initiator_data.rs | 2 +- crates/tower-api/src/models/run_app_params.rs | 2 +- .../tower-api/src/models/run_app_response.rs | 2 +- crates/tower-api/src/models/run_attempt.rs | 2 +- .../tower-api/src/models/run_failure_alert.rs | 2 +- crates/tower-api/src/models/run_graph_node.rs | 2 +- .../tower-api/src/models/run_graph_run_id.rs | 2 +- crates/tower-api/src/models/run_initiator.rs | 2 +- .../src/models/run_initiator_details.rs | 2 +- crates/tower-api/src/models/run_log_line.rs | 2 +- crates/tower-api/src/models/run_parameter.rs | 16 +++-- crates/tower-api/src/models/run_results.rs | 2 +- .../tower-api/src/models/run_retry_policy.rs | 2 +- .../src/models/run_run_initiator_details.rs | 2 +- crates/tower-api/src/models/run_statistics.rs | 2 +- .../src/models/run_timeseries_point.rs | 2 +- crates/tower-api/src/models/runner.rs | 2 +- .../src/models/runner_credentials.rs | 2 +- crates/tower-api/src/models/schedule.rs | 2 +- .../models/schedule_run_initiator_details.rs | 2 +- .../src/models/search_runs_response.rs | 2 +- crates/tower-api/src/models/secret.rs | 2 +- .../src/models/server_sent_events_inner.rs | 2 +- .../src/models/server_sent_events_inner_1.rs | 2 +- .../src/models/server_sent_events_inner_2.rs | 2 +- crates/tower-api/src/models/session.rs | 3 +- crates/tower-api/src/models/shoulder_tap.rs | 2 +- crates/tower-api/src/models/sse_warning.rs | 2 +- .../src/models/statistics_settings.rs | 2 +- crates/tower-api/src/models/team.rs | 2 +- .../tower-api/src/models/team_invitation.rs | 2 +- .../tower-api/src/models/team_membership.rs | 2 +- .../src/models/test_webhook_response.rs | 2 +- crates/tower-api/src/models/token.rs | 2 +- .../src/models/update_account_params.rs | 2 +- .../src/models/update_account_response.rs | 2 +- .../models/update_app_environment_params.rs | 2 +- .../models/update_app_environment_response.rs | 2 +- .../tower-api/src/models/update_app_params.rs | 2 +- .../src/models/update_app_response.rs | 2 +- .../src/models/update_catalog_params.rs | 2 +- .../src/models/update_catalog_response.rs | 2 +- .../models/update_email_preferences_body.rs | 2 +- .../src/models/update_environment_params.rs | 2 +- .../src/models/update_environment_response.rs | 2 +- .../update_my_team_invitation_params.rs | 2 +- .../update_my_team_invitation_response.rs | 2 +- .../src/models/update_organization_params.rs | 2 +- .../models/update_organization_response.rs | 2 +- .../src/models/update_plan_params.rs | 2 +- .../src/models/update_plan_response.rs | 2 +- .../src/models/update_schedule_params.rs | 4 +- .../src/models/update_schedule_response.rs | 2 +- .../src/models/update_secret_params.rs | 2 +- .../src/models/update_secret_response.rs | 2 +- .../src/models/update_team_member_params.rs | 2 +- .../src/models/update_team_member_response.rs | 2 +- .../src/models/update_team_params.rs | 2 +- .../src/models/update_team_response.rs | 2 +- .../src/models/update_user_params.rs | 2 +- .../src/models/update_user_response.rs | 2 +- .../src/models/update_webhook_params.rs | 2 +- .../src/models/update_webhook_response.rs | 2 +- crates/tower-api/src/models/usage_limit.rs | 2 +- .../models/usage_metric_time_series_point.rs | 2 +- crates/tower-api/src/models/user.rs | 2 +- crates/tower-api/src/models/webhook.rs | 2 +- crates/tower-cmd/src/api.rs | 26 ++++---- crates/tower-cmd/src/apps.rs | 44 +++++++++---- crates/tower-cmd/src/deploy.rs | 7 +-- crates/tower-cmd/src/mcp.rs | 28 +++++---- crates/tower-cmd/src/run.rs | 30 ++++++--- crates/tower-cmd/src/schedules.rs | 8 ++- crates/tower-cmd/src/secrets.rs | 9 ++- crates/tower-cmd/src/session.rs | 3 +- crates/tower-cmd/src/skill.rs | 17 +----- crates/tower-cmd/src/teams.rs | 5 +- crates/tower-cmd/src/util/apps.rs | 1 + crates/tower-cmd/src/util/deploy.rs | 12 +++- .../api/default/describe_app.py | 19 ++++++ src/tower/tower_api_client/models/__init__.py | 2 - .../models/acknowledge_alert_response.py | 4 +- .../models/acknowledge_all_alerts_response.py | 4 +- .../models/batch_schedule_params.py | 4 +- .../models/batch_schedule_response.py | 4 +- .../models/cancel_run_response.py | 12 +++- .../claim_device_login_ticket_params.py | 4 +- .../claim_device_login_ticket_response.py | 4 +- .../models/create_account_params.py | 4 +- .../models/create_account_response.py | 4 +- .../models/create_api_key_params.py | 4 +- .../models/create_api_key_response.py | 4 +- .../models/create_app_params.py | 4 +- .../models/create_app_response.py | 4 +- .../models/create_catalog_params.py | 4 +- .../models/create_catalog_response.py | 4 +- .../create_device_login_ticket_response.py | 4 +- .../models/create_environment_params.py | 4 +- .../models/create_environment_response.py | 4 +- .../models/create_guest_params.py | 4 +- .../models/create_guest_response.py | 4 +- .../models/create_sandbox_secrets_params.py | 4 +- .../models/create_sandbox_secrets_response.py | 4 +- .../models/create_schedule_params.py | 16 ++--- .../models/create_schedule_response.py | 4 +- .../models/create_secret_params.py | 4 +- .../models/create_secret_response.py | 4 +- .../models/create_session_params.py | 4 +- .../models/create_session_response.py | 4 +- .../models/create_team_params.py | 4 +- .../models/create_team_response.py | 4 +- .../models/create_webhook_params.py | 4 +- .../models/create_webhook_response.py | 4 +- .../models/delete_api_key_params.py | 4 +- .../models/delete_api_key_response.py | 4 +- .../models/delete_app_response.py | 4 +- .../models/delete_catalog_response.py | 4 +- .../models/delete_guest_output_body.py | 4 +- .../models/delete_schedule_params.py | 4 +- .../models/delete_schedule_response.py | 4 +- .../models/delete_secret_response.py | 4 +- .../models/delete_session_params.py | 4 +- .../models/delete_session_response.py | 4 +- .../models/delete_team_invitation_params.py | 4 +- .../models/delete_team_invitation_response.py | 4 +- .../models/delete_team_params.py | 4 +- .../models/delete_team_response.py | 4 +- .../models/delete_webhook_response.py | 4 +- .../models/deploy_app_response.py | 4 +- .../models/describe_account_body.py | 4 +- .../models/describe_app_response.py | 4 +- .../models/describe_app_version_response.py | 4 +- .../describe_authentication_context_body.py | 4 +- .../models/describe_catalog_response.py | 4 +- .../describe_device_login_session_response.py | 4 +- .../models/describe_email_preferences_body.py | 4 +- .../models/describe_plan_response.py | 4 +- .../models/describe_run_graph_response.py | 4 +- .../models/describe_run_logs_response.py | 4 +- .../models/describe_run_response.py | 4 +- .../models/describe_secrets_key_response.py | 4 +- .../models/describe_session_response.py | 4 +- .../models/describe_team_response.py | 4 +- .../models/describe_webhook_response.py | 4 +- .../tower_api_client/models/error_model.py | 4 +- .../models/export_catalogs_params.py | 4 +- .../models/export_catalogs_response.py | 4 +- .../models/export_secrets_params.py | 4 +- .../models/export_secrets_response.py | 4 +- .../generate_app_statistics_response.py | 4 +- ...organization_usage_time_series_response.py | 4 +- .../generate_run_statistics_response.py | 4 +- .../generate_runner_credentials_response.py | 4 +- .../models/get_feature_flag_response_body.py | 4 +- .../models/invite_team_member_params.py | 4 +- .../models/invite_team_member_response.py | 4 +- .../models/leave_team_response.py | 4 +- .../models/list_alerts_response.py | 4 +- .../models/list_api_keys_response.py | 4 +- .../models/list_app_environments_response.py | 4 +- .../models/list_app_versions_response.py | 4 +- .../models/list_apps_response.py | 4 +- .../models/list_catalogs_response.py | 4 +- .../models/list_environments_response.py | 4 +- .../models/list_guests_response.py | 4 +- .../list_my_team_invitations_response.py | 4 +- .../models/list_runners_response.py | 4 +- .../models/list_runs_response.py | 4 +- .../models/list_schedules_response.py | 4 +- .../list_secret_environments_response.py | 4 +- .../models/list_secrets_response.py | 4 +- .../models/list_team_invitations_response.py | 4 +- .../models/list_team_members_response.py | 4 +- .../models/list_teams_response.py | 4 +- .../models/list_webhooks_response.py | 4 +- .../models/organization_usage.py | 4 +- .../models/refresh_session_params.py | 4 +- .../models/refresh_session_response.py | 4 +- .../regenerate_guest_login_url_params.py | 4 +- .../regenerate_guest_login_url_response.py | 4 +- .../models/remove_team_member_params.py | 4 +- .../models/remove_team_member_response.py | 4 +- .../models/resend_team_invitation_params.py | 4 +- .../models/resend_team_invitation_response.py | 4 +- .../tower_api_client/models/run_app_params.py | 4 +- .../models/run_app_response.py | 4 +- .../tower_api_client/models/run_parameter.py | 32 +++++++--- .../models/run_parameter_input.py | 61 ------------------- .../models/search_runs_response.py | 4 +- .../models/test_webhook_response.py | 4 +- .../models/update_account_params.py | 4 +- .../models/update_account_response.py | 4 +- .../models/update_app_environment_params.py | 4 +- .../models/update_app_environment_response.py | 4 +- .../models/update_app_params.py | 4 +- .../models/update_app_response.py | 4 +- .../models/update_catalog_params.py | 4 +- .../models/update_catalog_response.py | 4 +- .../models/update_email_preferences_body.py | 4 +- .../models/update_environment_params.py | 4 +- .../models/update_environment_response.py | 4 +- .../update_my_team_invitation_params.py | 4 +- .../update_my_team_invitation_response.py | 4 +- .../models/update_organization_params.py | 4 +- .../models/update_organization_response.py | 4 +- .../models/update_plan_params.py | 4 +- .../models/update_plan_response.py | 4 +- .../models/update_schedule_params.py | 16 ++--- .../models/update_schedule_response.py | 4 +- .../models/update_secret_params.py | 4 +- .../models/update_secret_response.py | 4 +- .../models/update_team_member_params.py | 4 +- .../models/update_team_member_response.py | 4 +- .../models/update_team_params.py | 4 +- .../models/update_team_response.py | 4 +- .../models/update_user_params.py | 4 +- .../models/update_user_response.py | 4 +- .../models/update_webhook_params.py | 4 +- .../models/update_webhook_response.py | 4 +- 360 files changed, 683 insertions(+), 654 deletions(-) delete mode 100644 src/tower/tower_api_client/models/run_parameter_input.py diff --git a/crates/tower-api/README.md b/crates/tower-api/README.md index ed3f5e46..34128aec 100644 --- a/crates/tower-api/README.md +++ b/crates/tower-api/README.md @@ -8,7 +8,7 @@ For more information, please visit [https://tower.dev](https://tower.dev) This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. -- API version: 0.10.23-preview +- API version: v0.10.24 - Package version: 1.0.0 - Generator version: 7.19.0 - Build package: `org.openapitools.codegen.languages.RustClientCodegen` @@ -23,7 +23,7 @@ tower-api = { path = "./tower-api" } ## Documentation for API Endpoints -All URIs are relative to *https://api.staging.tower-dev.net/v1* +All URIs are relative to *https://api.tower.dev/v1* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- @@ -277,7 +277,6 @@ Class | Method | HTTP request | Description - [RunInitiatorDetails](docs/RunInitiatorDetails.md) - [RunLogLine](docs/RunLogLine.md) - [RunParameter](docs/RunParameter.md) - - [RunParameterInput](docs/RunParameterInput.md) - [RunResults](docs/RunResults.md) - [RunRetryPolicy](docs/RunRetryPolicy.md) - [RunRunInitiatorDetails](docs/RunRunInitiatorDetails.md) diff --git a/crates/tower-api/src/apis/configuration.rs b/crates/tower-api/src/apis/configuration.rs index 32a7e13e..8c0cc1d9 100644 --- a/crates/tower-api/src/apis/configuration.rs +++ b/crates/tower-api/src/apis/configuration.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -36,7 +36,7 @@ impl Configuration { impl Default for Configuration { fn default() -> Self { Configuration { - base_path: "https://api.staging.tower-dev.net/v1".to_owned(), + base_path: "https://api.tower.dev/v1".to_owned(), user_agent: Some("Tower CLI".to_owned()), client: reqwest::Client::new(), basic_auth: None, diff --git a/crates/tower-api/src/apis/default_api.rs b/crates/tower-api/src/apis/default_api.rs index 262aa5d1..3b081631 100644 --- a/crates/tower-api/src/apis/default_api.rs +++ b/crates/tower-api/src/apis/default_api.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -242,6 +242,8 @@ pub struct DescribeAppParams { pub end_at: Option, /// Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to UTC. pub timezone: Option, + /// The environment to resolve the app version against. Defaults to 'default'. + pub environment: Option, } /// struct for passing parameters to the method [`describe_app_version`] @@ -4258,6 +4260,9 @@ pub async fn describe_app( if let Some(ref param_value) = params.timezone { req_builder = req_builder.query(&[("timezone", ¶m_value.to_string())]); } + if let Some(ref param_value) = params.environment { + req_builder = req_builder.query(&[("environment", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } diff --git a/crates/tower-api/src/apis/feature_flags_api.rs b/crates/tower-api/src/apis/feature_flags_api.rs index ff430533..1e9a0237 100644 --- a/crates/tower-api/src/apis/feature_flags_api.rs +++ b/crates/tower-api/src/apis/feature_flags_api.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/account.rs b/crates/tower-api/src/models/account.rs index 4b155b74..116672a5 100644 --- a/crates/tower-api/src/models/account.rs +++ b/crates/tower-api/src/models/account.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/acknowledge_alert_response.rs b/crates/tower-api/src/models/acknowledge_alert_response.rs index 8d49da94..3cf58938 100644 --- a/crates/tower-api/src/models/acknowledge_alert_response.rs +++ b/crates/tower-api/src/models/acknowledge_alert_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/acknowledge_all_alerts_response.rs b/crates/tower-api/src/models/acknowledge_all_alerts_response.rs index 9af9a3a2..91060002 100644 --- a/crates/tower-api/src/models/acknowledge_all_alerts_response.rs +++ b/crates/tower-api/src/models/acknowledge_all_alerts_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/alert.rs b/crates/tower-api/src/models/alert.rs index f49a7306..16e47b0c 100644 --- a/crates/tower-api/src/models/alert.rs +++ b/crates/tower-api/src/models/alert.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/api_key.rs b/crates/tower-api/src/models/api_key.rs index 379e8036..1f112ff5 100644 --- a/crates/tower-api/src/models/api_key.rs +++ b/crates/tower-api/src/models/api_key.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/app.rs b/crates/tower-api/src/models/app.rs index a61349f9..abbc4c54 100644 --- a/crates/tower-api/src/models/app.rs +++ b/crates/tower-api/src/models/app.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/app_statistics.rs b/crates/tower-api/src/models/app_statistics.rs index 23033725..f2d9c680 100644 --- a/crates/tower-api/src/models/app_statistics.rs +++ b/crates/tower-api/src/models/app_statistics.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/app_summary.rs b/crates/tower-api/src/models/app_summary.rs index 927638eb..a2eb79df 100644 --- a/crates/tower-api/src/models/app_summary.rs +++ b/crates/tower-api/src/models/app_summary.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/app_version.rs b/crates/tower-api/src/models/app_version.rs index 764c2524..d1262e21 100644 --- a/crates/tower-api/src/models/app_version.rs +++ b/crates/tower-api/src/models/app_version.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/authentication_context.rs b/crates/tower-api/src/models/authentication_context.rs index 1ed6c0a5..ba6f7a8b 100644 --- a/crates/tower-api/src/models/authentication_context.rs +++ b/crates/tower-api/src/models/authentication_context.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/batch_schedule_params.rs b/crates/tower-api/src/models/batch_schedule_params.rs index 6aae6b8f..54d803d5 100644 --- a/crates/tower-api/src/models/batch_schedule_params.rs +++ b/crates/tower-api/src/models/batch_schedule_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/batch_schedule_response.rs b/crates/tower-api/src/models/batch_schedule_response.rs index a5dc5bf9..95604266 100644 --- a/crates/tower-api/src/models/batch_schedule_response.rs +++ b/crates/tower-api/src/models/batch_schedule_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/cancel_run_response.rs b/crates/tower-api/src/models/cancel_run_response.rs index bd3c6ed0..07da93b7 100644 --- a/crates/tower-api/src/models/cancel_run_response.rs +++ b/crates/tower-api/src/models/cancel_run_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -17,13 +17,21 @@ pub struct CancelRunResponse { /// A URL to the JSON Schema for this object. #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] pub schema: Option, + /// Number of descendant runs that were also cancelled as part of this cascade. + #[serde_as(as = "DefaultOnNull")] + #[serde(rename = "cancelled_child_runs")] + pub cancelled_child_runs: i64, #[serde_as(as = "DefaultOnNull")] #[serde(rename = "run")] pub run: models::Run, } impl CancelRunResponse { - pub fn new(run: models::Run) -> CancelRunResponse { - CancelRunResponse { schema: None, run } + pub fn new(cancelled_child_runs: i64, run: models::Run) -> CancelRunResponse { + CancelRunResponse { + schema: None, + cancelled_child_runs, + run, + } } } diff --git a/crates/tower-api/src/models/catalog.rs b/crates/tower-api/src/models/catalog.rs index 18b7aba0..cfc5944f 100644 --- a/crates/tower-api/src/models/catalog.rs +++ b/crates/tower-api/src/models/catalog.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/catalog_property.rs b/crates/tower-api/src/models/catalog_property.rs index 8e0a0aa4..708c9a98 100644 --- a/crates/tower-api/src/models/catalog_property.rs +++ b/crates/tower-api/src/models/catalog_property.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/claim_device_login_ticket_params.rs b/crates/tower-api/src/models/claim_device_login_ticket_params.rs index 37dc711b..4571e526 100644 --- a/crates/tower-api/src/models/claim_device_login_ticket_params.rs +++ b/crates/tower-api/src/models/claim_device_login_ticket_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/claim_device_login_ticket_response.rs b/crates/tower-api/src/models/claim_device_login_ticket_response.rs index b42c8c8e..c671b5eb 100644 --- a/crates/tower-api/src/models/claim_device_login_ticket_response.rs +++ b/crates/tower-api/src/models/claim_device_login_ticket_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_account_params.rs b/crates/tower-api/src/models/create_account_params.rs index 3cbd0d13..336e8686 100644 --- a/crates/tower-api/src/models/create_account_params.rs +++ b/crates/tower-api/src/models/create_account_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_account_params_flags_struct.rs b/crates/tower-api/src/models/create_account_params_flags_struct.rs index 5942add0..328e26c0 100644 --- a/crates/tower-api/src/models/create_account_params_flags_struct.rs +++ b/crates/tower-api/src/models/create_account_params_flags_struct.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_account_response.rs b/crates/tower-api/src/models/create_account_response.rs index b68d8af6..1ea4ae6c 100644 --- a/crates/tower-api/src/models/create_account_response.rs +++ b/crates/tower-api/src/models/create_account_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_api_key_params.rs b/crates/tower-api/src/models/create_api_key_params.rs index b9af5219..2530d81d 100644 --- a/crates/tower-api/src/models/create_api_key_params.rs +++ b/crates/tower-api/src/models/create_api_key_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_api_key_response.rs b/crates/tower-api/src/models/create_api_key_response.rs index c1666d58..d30a2857 100644 --- a/crates/tower-api/src/models/create_api_key_response.rs +++ b/crates/tower-api/src/models/create_api_key_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_app_params.rs b/crates/tower-api/src/models/create_app_params.rs index 9214b501..4e988c8f 100644 --- a/crates/tower-api/src/models/create_app_params.rs +++ b/crates/tower-api/src/models/create_app_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_app_response.rs b/crates/tower-api/src/models/create_app_response.rs index 5044ac71..cd76db8f 100644 --- a/crates/tower-api/src/models/create_app_response.rs +++ b/crates/tower-api/src/models/create_app_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_catalog_params.rs b/crates/tower-api/src/models/create_catalog_params.rs index 7d3b3223..6d68e41e 100644 --- a/crates/tower-api/src/models/create_catalog_params.rs +++ b/crates/tower-api/src/models/create_catalog_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_catalog_response.rs b/crates/tower-api/src/models/create_catalog_response.rs index 27b4839f..b18d7639 100644 --- a/crates/tower-api/src/models/create_catalog_response.rs +++ b/crates/tower-api/src/models/create_catalog_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_device_login_ticket_response.rs b/crates/tower-api/src/models/create_device_login_ticket_response.rs index 460921e0..8ed291d2 100644 --- a/crates/tower-api/src/models/create_device_login_ticket_response.rs +++ b/crates/tower-api/src/models/create_device_login_ticket_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_environment_params.rs b/crates/tower-api/src/models/create_environment_params.rs index a481fce2..7f5841f2 100644 --- a/crates/tower-api/src/models/create_environment_params.rs +++ b/crates/tower-api/src/models/create_environment_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_environment_response.rs b/crates/tower-api/src/models/create_environment_response.rs index 77096812..d6b5d4ac 100644 --- a/crates/tower-api/src/models/create_environment_response.rs +++ b/crates/tower-api/src/models/create_environment_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_guest_params.rs b/crates/tower-api/src/models/create_guest_params.rs index c2f673fa..6d24139a 100644 --- a/crates/tower-api/src/models/create_guest_params.rs +++ b/crates/tower-api/src/models/create_guest_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_guest_response.rs b/crates/tower-api/src/models/create_guest_response.rs index 0c7fa372..efaa7b59 100644 --- a/crates/tower-api/src/models/create_guest_response.rs +++ b/crates/tower-api/src/models/create_guest_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_sandbox_secrets_params.rs b/crates/tower-api/src/models/create_sandbox_secrets_params.rs index b5e776fe..ff6cc634 100644 --- a/crates/tower-api/src/models/create_sandbox_secrets_params.rs +++ b/crates/tower-api/src/models/create_sandbox_secrets_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_sandbox_secrets_response.rs b/crates/tower-api/src/models/create_sandbox_secrets_response.rs index 92f16b40..afeb5d6b 100644 --- a/crates/tower-api/src/models/create_sandbox_secrets_response.rs +++ b/crates/tower-api/src/models/create_sandbox_secrets_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_schedule_params.rs b/crates/tower-api/src/models/create_schedule_params.rs index 64754564..a87807d0 100644 --- a/crates/tower-api/src/models/create_schedule_params.rs +++ b/crates/tower-api/src/models/create_schedule_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -54,7 +54,7 @@ pub struct CreateScheduleParams { pub overlap_policy: Option>, /// Parameters to pass when running the app #[serde(rename = "parameters", skip_serializing_if = "Option::is_none")] - pub parameters: Option>, + pub parameters: Option>, /// The status of the schedule (defaults to active) #[serde( rename = "status", diff --git a/crates/tower-api/src/models/create_schedule_response.rs b/crates/tower-api/src/models/create_schedule_response.rs index e5d112b0..f2746869 100644 --- a/crates/tower-api/src/models/create_schedule_response.rs +++ b/crates/tower-api/src/models/create_schedule_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_secret_params.rs b/crates/tower-api/src/models/create_secret_params.rs index bfd4f63b..d074ecf0 100644 --- a/crates/tower-api/src/models/create_secret_params.rs +++ b/crates/tower-api/src/models/create_secret_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_secret_response.rs b/crates/tower-api/src/models/create_secret_response.rs index c05c3dba..6e67efbe 100644 --- a/crates/tower-api/src/models/create_secret_response.rs +++ b/crates/tower-api/src/models/create_secret_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_session_params.rs b/crates/tower-api/src/models/create_session_params.rs index 2bef0be7..f911bb0e 100644 --- a/crates/tower-api/src/models/create_session_params.rs +++ b/crates/tower-api/src/models/create_session_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_session_response.rs b/crates/tower-api/src/models/create_session_response.rs index b232d581..1b522b5b 100644 --- a/crates/tower-api/src/models/create_session_response.rs +++ b/crates/tower-api/src/models/create_session_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_team_params.rs b/crates/tower-api/src/models/create_team_params.rs index ae637fb1..6b1df789 100644 --- a/crates/tower-api/src/models/create_team_params.rs +++ b/crates/tower-api/src/models/create_team_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_team_response.rs b/crates/tower-api/src/models/create_team_response.rs index 12dd7828..a4641a5f 100644 --- a/crates/tower-api/src/models/create_team_response.rs +++ b/crates/tower-api/src/models/create_team_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_webhook_params.rs b/crates/tower-api/src/models/create_webhook_params.rs index 131fc637..2efa854f 100644 --- a/crates/tower-api/src/models/create_webhook_params.rs +++ b/crates/tower-api/src/models/create_webhook_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/create_webhook_response.rs b/crates/tower-api/src/models/create_webhook_response.rs index 70d257d4..905ee30e 100644 --- a/crates/tower-api/src/models/create_webhook_response.rs +++ b/crates/tower-api/src/models/create_webhook_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_api_key_params.rs b/crates/tower-api/src/models/delete_api_key_params.rs index f66c471a..08b09485 100644 --- a/crates/tower-api/src/models/delete_api_key_params.rs +++ b/crates/tower-api/src/models/delete_api_key_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_api_key_response.rs b/crates/tower-api/src/models/delete_api_key_response.rs index 32a03db0..6532f3c0 100644 --- a/crates/tower-api/src/models/delete_api_key_response.rs +++ b/crates/tower-api/src/models/delete_api_key_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_app_response.rs b/crates/tower-api/src/models/delete_app_response.rs index 65d15608..23ee6d59 100644 --- a/crates/tower-api/src/models/delete_app_response.rs +++ b/crates/tower-api/src/models/delete_app_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_catalog_response.rs b/crates/tower-api/src/models/delete_catalog_response.rs index 5ca62f96..1eab81e6 100644 --- a/crates/tower-api/src/models/delete_catalog_response.rs +++ b/crates/tower-api/src/models/delete_catalog_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_guest_output_body.rs b/crates/tower-api/src/models/delete_guest_output_body.rs index 3a7bd931..4cad97b8 100644 --- a/crates/tower-api/src/models/delete_guest_output_body.rs +++ b/crates/tower-api/src/models/delete_guest_output_body.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_schedule_params.rs b/crates/tower-api/src/models/delete_schedule_params.rs index 8c3a5080..7ac3e40a 100644 --- a/crates/tower-api/src/models/delete_schedule_params.rs +++ b/crates/tower-api/src/models/delete_schedule_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_schedule_response.rs b/crates/tower-api/src/models/delete_schedule_response.rs index 81bc0980..2bb66758 100644 --- a/crates/tower-api/src/models/delete_schedule_response.rs +++ b/crates/tower-api/src/models/delete_schedule_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_secret_response.rs b/crates/tower-api/src/models/delete_secret_response.rs index be06aa72..6b243271 100644 --- a/crates/tower-api/src/models/delete_secret_response.rs +++ b/crates/tower-api/src/models/delete_secret_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_session_params.rs b/crates/tower-api/src/models/delete_session_params.rs index f883eff9..68502ec9 100644 --- a/crates/tower-api/src/models/delete_session_params.rs +++ b/crates/tower-api/src/models/delete_session_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_session_response.rs b/crates/tower-api/src/models/delete_session_response.rs index 65e65b59..fd2a8cca 100644 --- a/crates/tower-api/src/models/delete_session_response.rs +++ b/crates/tower-api/src/models/delete_session_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_team_invitation_params.rs b/crates/tower-api/src/models/delete_team_invitation_params.rs index 8feda324..e3612231 100644 --- a/crates/tower-api/src/models/delete_team_invitation_params.rs +++ b/crates/tower-api/src/models/delete_team_invitation_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_team_invitation_response.rs b/crates/tower-api/src/models/delete_team_invitation_response.rs index 5231b735..8c158558 100644 --- a/crates/tower-api/src/models/delete_team_invitation_response.rs +++ b/crates/tower-api/src/models/delete_team_invitation_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_team_params.rs b/crates/tower-api/src/models/delete_team_params.rs index 477ae509..68d0be3d 100644 --- a/crates/tower-api/src/models/delete_team_params.rs +++ b/crates/tower-api/src/models/delete_team_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_team_response.rs b/crates/tower-api/src/models/delete_team_response.rs index 22db7e12..0231e905 100644 --- a/crates/tower-api/src/models/delete_team_response.rs +++ b/crates/tower-api/src/models/delete_team_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/delete_webhook_response.rs b/crates/tower-api/src/models/delete_webhook_response.rs index 9b2cdd1b..f7988d8b 100644 --- a/crates/tower-api/src/models/delete_webhook_response.rs +++ b/crates/tower-api/src/models/delete_webhook_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/deploy_app_request.rs b/crates/tower-api/src/models/deploy_app_request.rs index a80ae751..0636309a 100644 --- a/crates/tower-api/src/models/deploy_app_request.rs +++ b/crates/tower-api/src/models/deploy_app_request.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/deploy_app_response.rs b/crates/tower-api/src/models/deploy_app_response.rs index e3fcd5f6..e3000f51 100644 --- a/crates/tower-api/src/models/deploy_app_response.rs +++ b/crates/tower-api/src/models/deploy_app_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_account_body.rs b/crates/tower-api/src/models/describe_account_body.rs index 656f5e2b..d860bc7b 100644 --- a/crates/tower-api/src/models/describe_account_body.rs +++ b/crates/tower-api/src/models/describe_account_body.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_app_response.rs b/crates/tower-api/src/models/describe_app_response.rs index bc38edb4..252b611f 100644 --- a/crates/tower-api/src/models/describe_app_response.rs +++ b/crates/tower-api/src/models/describe_app_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_app_version_response.rs b/crates/tower-api/src/models/describe_app_version_response.rs index 10e4acc5..88011575 100644 --- a/crates/tower-api/src/models/describe_app_version_response.rs +++ b/crates/tower-api/src/models/describe_app_version_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_authentication_context_body.rs b/crates/tower-api/src/models/describe_authentication_context_body.rs index cd3aab12..49ae2ae9 100644 --- a/crates/tower-api/src/models/describe_authentication_context_body.rs +++ b/crates/tower-api/src/models/describe_authentication_context_body.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_catalog_response.rs b/crates/tower-api/src/models/describe_catalog_response.rs index b456d43d..131c83ca 100644 --- a/crates/tower-api/src/models/describe_catalog_response.rs +++ b/crates/tower-api/src/models/describe_catalog_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_device_login_session_response.rs b/crates/tower-api/src/models/describe_device_login_session_response.rs index c47d342b..9f002161 100644 --- a/crates/tower-api/src/models/describe_device_login_session_response.rs +++ b/crates/tower-api/src/models/describe_device_login_session_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_email_preferences_body.rs b/crates/tower-api/src/models/describe_email_preferences_body.rs index 3143da7c..37609c33 100644 --- a/crates/tower-api/src/models/describe_email_preferences_body.rs +++ b/crates/tower-api/src/models/describe_email_preferences_body.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_plan_response.rs b/crates/tower-api/src/models/describe_plan_response.rs index 7251ffcb..debd454f 100644 --- a/crates/tower-api/src/models/describe_plan_response.rs +++ b/crates/tower-api/src/models/describe_plan_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_run_graph_response.rs b/crates/tower-api/src/models/describe_run_graph_response.rs index 1942b9d0..63e9f060 100644 --- a/crates/tower-api/src/models/describe_run_graph_response.rs +++ b/crates/tower-api/src/models/describe_run_graph_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_run_links.rs b/crates/tower-api/src/models/describe_run_links.rs index 4cd160db..508248ce 100644 --- a/crates/tower-api/src/models/describe_run_links.rs +++ b/crates/tower-api/src/models/describe_run_links.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_run_logs_response.rs b/crates/tower-api/src/models/describe_run_logs_response.rs index 36bf267a..2abee200 100644 --- a/crates/tower-api/src/models/describe_run_logs_response.rs +++ b/crates/tower-api/src/models/describe_run_logs_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_run_response.rs b/crates/tower-api/src/models/describe_run_response.rs index 5a140ad8..b14ea569 100644 --- a/crates/tower-api/src/models/describe_run_response.rs +++ b/crates/tower-api/src/models/describe_run_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_secrets_key_response.rs b/crates/tower-api/src/models/describe_secrets_key_response.rs index fc132e09..cbf925f0 100644 --- a/crates/tower-api/src/models/describe_secrets_key_response.rs +++ b/crates/tower-api/src/models/describe_secrets_key_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_session_response.rs b/crates/tower-api/src/models/describe_session_response.rs index e26bb266..2d6af965 100644 --- a/crates/tower-api/src/models/describe_session_response.rs +++ b/crates/tower-api/src/models/describe_session_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_team_response.rs b/crates/tower-api/src/models/describe_team_response.rs index 0b343180..f866d4eb 100644 --- a/crates/tower-api/src/models/describe_team_response.rs +++ b/crates/tower-api/src/models/describe_team_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/describe_webhook_response.rs b/crates/tower-api/src/models/describe_webhook_response.rs index dd3cd32c..b38ae16e 100644 --- a/crates/tower-api/src/models/describe_webhook_response.rs +++ b/crates/tower-api/src/models/describe_webhook_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/email_subscriptions.rs b/crates/tower-api/src/models/email_subscriptions.rs index d12e02db..63f26c6b 100644 --- a/crates/tower-api/src/models/email_subscriptions.rs +++ b/crates/tower-api/src/models/email_subscriptions.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/encrypted_catalog_property.rs b/crates/tower-api/src/models/encrypted_catalog_property.rs index 5817ac48..ae3bad2a 100644 --- a/crates/tower-api/src/models/encrypted_catalog_property.rs +++ b/crates/tower-api/src/models/encrypted_catalog_property.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/environment.rs b/crates/tower-api/src/models/environment.rs index a9e9e268..fca84227 100644 --- a/crates/tower-api/src/models/environment.rs +++ b/crates/tower-api/src/models/environment.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/error_detail.rs b/crates/tower-api/src/models/error_detail.rs index 3649ac49..b38f2403 100644 --- a/crates/tower-api/src/models/error_detail.rs +++ b/crates/tower-api/src/models/error_detail.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/error_model.rs b/crates/tower-api/src/models/error_model.rs index 9dec40ee..aad23278 100644 --- a/crates/tower-api/src/models/error_model.rs +++ b/crates/tower-api/src/models/error_model.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/event_alert.rs b/crates/tower-api/src/models/event_alert.rs index 4a2858a1..2be91340 100644 --- a/crates/tower-api/src/models/event_alert.rs +++ b/crates/tower-api/src/models/event_alert.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/event_error.rs b/crates/tower-api/src/models/event_error.rs index 3d9c73b5..f7728cc3 100644 --- a/crates/tower-api/src/models/event_error.rs +++ b/crates/tower-api/src/models/event_error.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/event_log.rs b/crates/tower-api/src/models/event_log.rs index 7be388c9..2ddb3bdd 100644 --- a/crates/tower-api/src/models/event_log.rs +++ b/crates/tower-api/src/models/event_log.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/event_shouldertap.rs b/crates/tower-api/src/models/event_shouldertap.rs index 31fc6a97..ae2d8478 100644 --- a/crates/tower-api/src/models/event_shouldertap.rs +++ b/crates/tower-api/src/models/event_shouldertap.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/event_warning.rs b/crates/tower-api/src/models/event_warning.rs index e3a1ab3d..5bf5d34b 100644 --- a/crates/tower-api/src/models/event_warning.rs +++ b/crates/tower-api/src/models/event_warning.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/export_catalogs_params.rs b/crates/tower-api/src/models/export_catalogs_params.rs index 50c99f91..bb3405be 100644 --- a/crates/tower-api/src/models/export_catalogs_params.rs +++ b/crates/tower-api/src/models/export_catalogs_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/export_catalogs_response.rs b/crates/tower-api/src/models/export_catalogs_response.rs index e96b6e34..97e63115 100644 --- a/crates/tower-api/src/models/export_catalogs_response.rs +++ b/crates/tower-api/src/models/export_catalogs_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/export_secrets_params.rs b/crates/tower-api/src/models/export_secrets_params.rs index 1b0fa3c3..edbbae54 100644 --- a/crates/tower-api/src/models/export_secrets_params.rs +++ b/crates/tower-api/src/models/export_secrets_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/export_secrets_response.rs b/crates/tower-api/src/models/export_secrets_response.rs index 2df224b0..3b0abe0e 100644 --- a/crates/tower-api/src/models/export_secrets_response.rs +++ b/crates/tower-api/src/models/export_secrets_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/exported_catalog.rs b/crates/tower-api/src/models/exported_catalog.rs index e77b98ea..487b6316 100644 --- a/crates/tower-api/src/models/exported_catalog.rs +++ b/crates/tower-api/src/models/exported_catalog.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/exported_catalog_property.rs b/crates/tower-api/src/models/exported_catalog_property.rs index 6550c5be..d94e101c 100644 --- a/crates/tower-api/src/models/exported_catalog_property.rs +++ b/crates/tower-api/src/models/exported_catalog_property.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/exported_secret.rs b/crates/tower-api/src/models/exported_secret.rs index 0739d088..ca789489 100644 --- a/crates/tower-api/src/models/exported_secret.rs +++ b/crates/tower-api/src/models/exported_secret.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/feature.rs b/crates/tower-api/src/models/feature.rs index a35da13d..6e5ca4e0 100644 --- a/crates/tower-api/src/models/feature.rs +++ b/crates/tower-api/src/models/feature.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/featurebase_identity.rs b/crates/tower-api/src/models/featurebase_identity.rs index 192c472a..faa671c0 100644 --- a/crates/tower-api/src/models/featurebase_identity.rs +++ b/crates/tower-api/src/models/featurebase_identity.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/generate_app_statistics_response.rs b/crates/tower-api/src/models/generate_app_statistics_response.rs index f16b3f04..f81187c5 100644 --- a/crates/tower-api/src/models/generate_app_statistics_response.rs +++ b/crates/tower-api/src/models/generate_app_statistics_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/generate_organization_usage_time_series_response.rs b/crates/tower-api/src/models/generate_organization_usage_time_series_response.rs index 51cfd65a..68ea2be1 100644 --- a/crates/tower-api/src/models/generate_organization_usage_time_series_response.rs +++ b/crates/tower-api/src/models/generate_organization_usage_time_series_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/generate_run_statistics_response.rs b/crates/tower-api/src/models/generate_run_statistics_response.rs index e3b351b8..70bc530f 100644 --- a/crates/tower-api/src/models/generate_run_statistics_response.rs +++ b/crates/tower-api/src/models/generate_run_statistics_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/generate_runner_credentials_response.rs b/crates/tower-api/src/models/generate_runner_credentials_response.rs index bec5c307..0cf2c196 100644 --- a/crates/tower-api/src/models/generate_runner_credentials_response.rs +++ b/crates/tower-api/src/models/generate_runner_credentials_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/get_feature_flag_response_body.rs b/crates/tower-api/src/models/get_feature_flag_response_body.rs index 8369303b..cfe6bb45 100644 --- a/crates/tower-api/src/models/get_feature_flag_response_body.rs +++ b/crates/tower-api/src/models/get_feature_flag_response_body.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/guest.rs b/crates/tower-api/src/models/guest.rs index 42f4e297..1d4490cc 100644 --- a/crates/tower-api/src/models/guest.rs +++ b/crates/tower-api/src/models/guest.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/invite_team_member_params.rs b/crates/tower-api/src/models/invite_team_member_params.rs index ef3b2ab4..ecf9d14b 100644 --- a/crates/tower-api/src/models/invite_team_member_params.rs +++ b/crates/tower-api/src/models/invite_team_member_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/invite_team_member_response.rs b/crates/tower-api/src/models/invite_team_member_response.rs index 4148d651..0d8acffb 100644 --- a/crates/tower-api/src/models/invite_team_member_response.rs +++ b/crates/tower-api/src/models/invite_team_member_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/leave_team_response.rs b/crates/tower-api/src/models/leave_team_response.rs index f7b6f0d9..ec53a0b7 100644 --- a/crates/tower-api/src/models/leave_team_response.rs +++ b/crates/tower-api/src/models/leave_team_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_alerts_response.rs b/crates/tower-api/src/models/list_alerts_response.rs index e427b507..1c076702 100644 --- a/crates/tower-api/src/models/list_alerts_response.rs +++ b/crates/tower-api/src/models/list_alerts_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_api_keys_response.rs b/crates/tower-api/src/models/list_api_keys_response.rs index 8c2193e2..43d8ac38 100644 --- a/crates/tower-api/src/models/list_api_keys_response.rs +++ b/crates/tower-api/src/models/list_api_keys_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_app_environments_response.rs b/crates/tower-api/src/models/list_app_environments_response.rs index 6311e89c..76a2c759 100644 --- a/crates/tower-api/src/models/list_app_environments_response.rs +++ b/crates/tower-api/src/models/list_app_environments_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_app_versions_response.rs b/crates/tower-api/src/models/list_app_versions_response.rs index 456854bf..730443b3 100644 --- a/crates/tower-api/src/models/list_app_versions_response.rs +++ b/crates/tower-api/src/models/list_app_versions_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_apps_response.rs b/crates/tower-api/src/models/list_apps_response.rs index ca2f17e1..58d49b1d 100644 --- a/crates/tower-api/src/models/list_apps_response.rs +++ b/crates/tower-api/src/models/list_apps_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_catalogs_response.rs b/crates/tower-api/src/models/list_catalogs_response.rs index b98a3b88..c5db3834 100644 --- a/crates/tower-api/src/models/list_catalogs_response.rs +++ b/crates/tower-api/src/models/list_catalogs_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_environments_response.rs b/crates/tower-api/src/models/list_environments_response.rs index 37c29036..de3b3700 100644 --- a/crates/tower-api/src/models/list_environments_response.rs +++ b/crates/tower-api/src/models/list_environments_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_guests_response.rs b/crates/tower-api/src/models/list_guests_response.rs index 8d0597c8..d8c366c8 100644 --- a/crates/tower-api/src/models/list_guests_response.rs +++ b/crates/tower-api/src/models/list_guests_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_my_team_invitations_response.rs b/crates/tower-api/src/models/list_my_team_invitations_response.rs index 41b1000b..9c87365f 100644 --- a/crates/tower-api/src/models/list_my_team_invitations_response.rs +++ b/crates/tower-api/src/models/list_my_team_invitations_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_runners_response.rs b/crates/tower-api/src/models/list_runners_response.rs index 5f826a46..edcea666 100644 --- a/crates/tower-api/src/models/list_runners_response.rs +++ b/crates/tower-api/src/models/list_runners_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_runs_response.rs b/crates/tower-api/src/models/list_runs_response.rs index 4836fa6e..3d622433 100644 --- a/crates/tower-api/src/models/list_runs_response.rs +++ b/crates/tower-api/src/models/list_runs_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_schedules_response.rs b/crates/tower-api/src/models/list_schedules_response.rs index 6b630f1f..7eaa5f94 100644 --- a/crates/tower-api/src/models/list_schedules_response.rs +++ b/crates/tower-api/src/models/list_schedules_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_secret_environments_response.rs b/crates/tower-api/src/models/list_secret_environments_response.rs index 9dea8f85..1c4a0297 100644 --- a/crates/tower-api/src/models/list_secret_environments_response.rs +++ b/crates/tower-api/src/models/list_secret_environments_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_secrets_response.rs b/crates/tower-api/src/models/list_secrets_response.rs index f6e4f979..623502ac 100644 --- a/crates/tower-api/src/models/list_secrets_response.rs +++ b/crates/tower-api/src/models/list_secrets_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_team_invitations_response.rs b/crates/tower-api/src/models/list_team_invitations_response.rs index b343ba79..5b138a92 100644 --- a/crates/tower-api/src/models/list_team_invitations_response.rs +++ b/crates/tower-api/src/models/list_team_invitations_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_team_members_response.rs b/crates/tower-api/src/models/list_team_members_response.rs index 92688eed..8564b6c5 100644 --- a/crates/tower-api/src/models/list_team_members_response.rs +++ b/crates/tower-api/src/models/list_team_members_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_teams_response.rs b/crates/tower-api/src/models/list_teams_response.rs index 5351e6d9..8fea8f2f 100644 --- a/crates/tower-api/src/models/list_teams_response.rs +++ b/crates/tower-api/src/models/list_teams_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/list_webhooks_response.rs b/crates/tower-api/src/models/list_webhooks_response.rs index 121582fa..ce232d2b 100644 --- a/crates/tower-api/src/models/list_webhooks_response.rs +++ b/crates/tower-api/src/models/list_webhooks_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/mod.rs b/crates/tower-api/src/models/mod.rs index 84ca1cff..5a3a8045 100644 --- a/crates/tower-api/src/models/mod.rs +++ b/crates/tower-api/src/models/mod.rs @@ -292,8 +292,6 @@ pub mod run_log_line; pub use self::run_log_line::RunLogLine; pub mod run_parameter; pub use self::run_parameter::RunParameter; -pub mod run_parameter_input; -pub use self::run_parameter_input::RunParameterInput; pub mod run_results; pub use self::run_results::RunResults; pub mod run_retry_policy; diff --git a/crates/tower-api/src/models/organization.rs b/crates/tower-api/src/models/organization.rs index 68971805..43aad387 100644 --- a/crates/tower-api/src/models/organization.rs +++ b/crates/tower-api/src/models/organization.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/organization_usage.rs b/crates/tower-api/src/models/organization_usage.rs index fc8d41fa..26ee42fb 100644 --- a/crates/tower-api/src/models/organization_usage.rs +++ b/crates/tower-api/src/models/organization_usage.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/pagination.rs b/crates/tower-api/src/models/pagination.rs index c224e736..94a36b98 100644 --- a/crates/tower-api/src/models/pagination.rs +++ b/crates/tower-api/src/models/pagination.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/parameter.rs b/crates/tower-api/src/models/parameter.rs index a4ec7a2c..811bd79f 100644 --- a/crates/tower-api/src/models/parameter.rs +++ b/crates/tower-api/src/models/parameter.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/plan.rs b/crates/tower-api/src/models/plan.rs index 57460752..f830dd76 100644 --- a/crates/tower-api/src/models/plan.rs +++ b/crates/tower-api/src/models/plan.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/refresh_session_params.rs b/crates/tower-api/src/models/refresh_session_params.rs index 2fc5ec7c..37f9619c 100644 --- a/crates/tower-api/src/models/refresh_session_params.rs +++ b/crates/tower-api/src/models/refresh_session_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/refresh_session_response.rs b/crates/tower-api/src/models/refresh_session_response.rs index dd5e0cf3..f8f2d7c4 100644 --- a/crates/tower-api/src/models/refresh_session_response.rs +++ b/crates/tower-api/src/models/refresh_session_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/regenerate_guest_login_url_params.rs b/crates/tower-api/src/models/regenerate_guest_login_url_params.rs index 26a6fb45..8030a2ff 100644 --- a/crates/tower-api/src/models/regenerate_guest_login_url_params.rs +++ b/crates/tower-api/src/models/regenerate_guest_login_url_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/regenerate_guest_login_url_response.rs b/crates/tower-api/src/models/regenerate_guest_login_url_response.rs index f0b44f78..130e4623 100644 --- a/crates/tower-api/src/models/regenerate_guest_login_url_response.rs +++ b/crates/tower-api/src/models/regenerate_guest_login_url_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/remove_team_member_params.rs b/crates/tower-api/src/models/remove_team_member_params.rs index b1e253fa..ba59de99 100644 --- a/crates/tower-api/src/models/remove_team_member_params.rs +++ b/crates/tower-api/src/models/remove_team_member_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/remove_team_member_response.rs b/crates/tower-api/src/models/remove_team_member_response.rs index ea19e79f..da320640 100644 --- a/crates/tower-api/src/models/remove_team_member_response.rs +++ b/crates/tower-api/src/models/remove_team_member_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/resend_team_invitation_params.rs b/crates/tower-api/src/models/resend_team_invitation_params.rs index 6b0c9e55..cbbcbf51 100644 --- a/crates/tower-api/src/models/resend_team_invitation_params.rs +++ b/crates/tower-api/src/models/resend_team_invitation_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/resend_team_invitation_response.rs b/crates/tower-api/src/models/resend_team_invitation_response.rs index bf9affea..90181711 100644 --- a/crates/tower-api/src/models/resend_team_invitation_response.rs +++ b/crates/tower-api/src/models/resend_team_invitation_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run.rs b/crates/tower-api/src/models/run.rs index 4e93eb69..4e84df41 100644 --- a/crates/tower-api/src/models/run.rs +++ b/crates/tower-api/src/models/run.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_app_initiator_data.rs b/crates/tower-api/src/models/run_app_initiator_data.rs index 9efc5f5f..6c8556b3 100644 --- a/crates/tower-api/src/models/run_app_initiator_data.rs +++ b/crates/tower-api/src/models/run_app_initiator_data.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_app_params.rs b/crates/tower-api/src/models/run_app_params.rs index 595f1077..741ed3cd 100644 --- a/crates/tower-api/src/models/run_app_params.rs +++ b/crates/tower-api/src/models/run_app_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_app_response.rs b/crates/tower-api/src/models/run_app_response.rs index 2d217d43..abf80054 100644 --- a/crates/tower-api/src/models/run_app_response.rs +++ b/crates/tower-api/src/models/run_app_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_attempt.rs b/crates/tower-api/src/models/run_attempt.rs index 6f755fce..85b59d80 100644 --- a/crates/tower-api/src/models/run_attempt.rs +++ b/crates/tower-api/src/models/run_attempt.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_failure_alert.rs b/crates/tower-api/src/models/run_failure_alert.rs index c6800254..93ce4473 100644 --- a/crates/tower-api/src/models/run_failure_alert.rs +++ b/crates/tower-api/src/models/run_failure_alert.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_graph_node.rs b/crates/tower-api/src/models/run_graph_node.rs index 5c68a0de..316a3882 100644 --- a/crates/tower-api/src/models/run_graph_node.rs +++ b/crates/tower-api/src/models/run_graph_node.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_graph_run_id.rs b/crates/tower-api/src/models/run_graph_run_id.rs index c62c99fc..fc7047d9 100644 --- a/crates/tower-api/src/models/run_graph_run_id.rs +++ b/crates/tower-api/src/models/run_graph_run_id.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_initiator.rs b/crates/tower-api/src/models/run_initiator.rs index b1e59590..00cbf42f 100644 --- a/crates/tower-api/src/models/run_initiator.rs +++ b/crates/tower-api/src/models/run_initiator.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_initiator_details.rs b/crates/tower-api/src/models/run_initiator_details.rs index d89e78dc..cc6ff315 100644 --- a/crates/tower-api/src/models/run_initiator_details.rs +++ b/crates/tower-api/src/models/run_initiator_details.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_log_line.rs b/crates/tower-api/src/models/run_log_line.rs index 5e9937fa..1dcad0c9 100644 --- a/crates/tower-api/src/models/run_log_line.rs +++ b/crates/tower-api/src/models/run_log_line.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_parameter.rs b/crates/tower-api/src/models/run_parameter.rs index c288ff00..cb98bfcd 100644 --- a/crates/tower-api/src/models/run_parameter.rs +++ b/crates/tower-api/src/models/run_parameter.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -18,9 +18,13 @@ pub struct RunParameter { #[serde(rename = "hidden", skip_serializing_if = "Option::is_none")] pub hidden: Option, /// Whether this parameter's value was supplied as an override at run/schedule creation time (true) or comes from the app version's default (false). - #[serde_as(as = "DefaultOnNull")] - #[serde(rename = "is_override")] - pub is_override: bool, + #[serde( + rename = "is_override", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub is_override: Option>, #[serde_as(as = "DefaultOnNull")] #[serde(rename = "name")] pub name: String, @@ -30,10 +34,10 @@ pub struct RunParameter { } impl RunParameter { - pub fn new(is_override: bool, name: String, value: String) -> RunParameter { + pub fn new(name: String, value: String) -> RunParameter { RunParameter { hidden: None, - is_override, + is_override: None, name, value, } diff --git a/crates/tower-api/src/models/run_results.rs b/crates/tower-api/src/models/run_results.rs index 0a8be8ec..72d6c3e7 100644 --- a/crates/tower-api/src/models/run_results.rs +++ b/crates/tower-api/src/models/run_results.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_retry_policy.rs b/crates/tower-api/src/models/run_retry_policy.rs index 8777f75f..bfe9489d 100644 --- a/crates/tower-api/src/models/run_retry_policy.rs +++ b/crates/tower-api/src/models/run_retry_policy.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_run_initiator_details.rs b/crates/tower-api/src/models/run_run_initiator_details.rs index afd4f8ca..4015ed98 100644 --- a/crates/tower-api/src/models/run_run_initiator_details.rs +++ b/crates/tower-api/src/models/run_run_initiator_details.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_statistics.rs b/crates/tower-api/src/models/run_statistics.rs index 2da28570..af3a61f8 100644 --- a/crates/tower-api/src/models/run_statistics.rs +++ b/crates/tower-api/src/models/run_statistics.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/run_timeseries_point.rs b/crates/tower-api/src/models/run_timeseries_point.rs index dc068055..23bd370d 100644 --- a/crates/tower-api/src/models/run_timeseries_point.rs +++ b/crates/tower-api/src/models/run_timeseries_point.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/runner.rs b/crates/tower-api/src/models/runner.rs index a0cb0a72..3835beeb 100644 --- a/crates/tower-api/src/models/runner.rs +++ b/crates/tower-api/src/models/runner.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/runner_credentials.rs b/crates/tower-api/src/models/runner_credentials.rs index 1e002e02..1fd53e86 100644 --- a/crates/tower-api/src/models/runner_credentials.rs +++ b/crates/tower-api/src/models/runner_credentials.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/schedule.rs b/crates/tower-api/src/models/schedule.rs index a903f92b..fde474d2 100644 --- a/crates/tower-api/src/models/schedule.rs +++ b/crates/tower-api/src/models/schedule.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/schedule_run_initiator_details.rs b/crates/tower-api/src/models/schedule_run_initiator_details.rs index 806fcc65..ae103d42 100644 --- a/crates/tower-api/src/models/schedule_run_initiator_details.rs +++ b/crates/tower-api/src/models/schedule_run_initiator_details.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/search_runs_response.rs b/crates/tower-api/src/models/search_runs_response.rs index 527787f7..9971ebaf 100644 --- a/crates/tower-api/src/models/search_runs_response.rs +++ b/crates/tower-api/src/models/search_runs_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/secret.rs b/crates/tower-api/src/models/secret.rs index 70f27a8a..fdbc37b9 100644 --- a/crates/tower-api/src/models/secret.rs +++ b/crates/tower-api/src/models/secret.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/server_sent_events_inner.rs b/crates/tower-api/src/models/server_sent_events_inner.rs index 9dbf0398..777b2918 100644 --- a/crates/tower-api/src/models/server_sent_events_inner.rs +++ b/crates/tower-api/src/models/server_sent_events_inner.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/server_sent_events_inner_1.rs b/crates/tower-api/src/models/server_sent_events_inner_1.rs index 81f60d01..4374a4c9 100644 --- a/crates/tower-api/src/models/server_sent_events_inner_1.rs +++ b/crates/tower-api/src/models/server_sent_events_inner_1.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/server_sent_events_inner_2.rs b/crates/tower-api/src/models/server_sent_events_inner_2.rs index 154f6160..aa3416da 100644 --- a/crates/tower-api/src/models/server_sent_events_inner_2.rs +++ b/crates/tower-api/src/models/server_sent_events_inner_2.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/session.rs b/crates/tower-api/src/models/session.rs index 742a5f9a..63873a02 100644 --- a/crates/tower-api/src/models/session.rs +++ b/crates/tower-api/src/models/session.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -14,6 +14,7 @@ use serde_with::{serde_as, DefaultOnNull}; #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Session { + /// This property is deprecated. It will be removed in a future version. #[serde_as(as = "DefaultOnNull")] #[serde(rename = "featurebase_identity")] pub featurebase_identity: models::FeaturebaseIdentity, diff --git a/crates/tower-api/src/models/shoulder_tap.rs b/crates/tower-api/src/models/shoulder_tap.rs index 31dd8626..3d5b91f7 100644 --- a/crates/tower-api/src/models/shoulder_tap.rs +++ b/crates/tower-api/src/models/shoulder_tap.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/sse_warning.rs b/crates/tower-api/src/models/sse_warning.rs index 59af41f1..28dc3f9e 100644 --- a/crates/tower-api/src/models/sse_warning.rs +++ b/crates/tower-api/src/models/sse_warning.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/statistics_settings.rs b/crates/tower-api/src/models/statistics_settings.rs index 68bc7054..8026f7dc 100644 --- a/crates/tower-api/src/models/statistics_settings.rs +++ b/crates/tower-api/src/models/statistics_settings.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/team.rs b/crates/tower-api/src/models/team.rs index 50b62fb7..537b57a1 100644 --- a/crates/tower-api/src/models/team.rs +++ b/crates/tower-api/src/models/team.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/team_invitation.rs b/crates/tower-api/src/models/team_invitation.rs index 426e12fc..1a649f7b 100644 --- a/crates/tower-api/src/models/team_invitation.rs +++ b/crates/tower-api/src/models/team_invitation.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/team_membership.rs b/crates/tower-api/src/models/team_membership.rs index 600079a7..ab61bc59 100644 --- a/crates/tower-api/src/models/team_membership.rs +++ b/crates/tower-api/src/models/team_membership.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/test_webhook_response.rs b/crates/tower-api/src/models/test_webhook_response.rs index f7310bce..edb69308 100644 --- a/crates/tower-api/src/models/test_webhook_response.rs +++ b/crates/tower-api/src/models/test_webhook_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/token.rs b/crates/tower-api/src/models/token.rs index e6b7b550..bd119e00 100644 --- a/crates/tower-api/src/models/token.rs +++ b/crates/tower-api/src/models/token.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_account_params.rs b/crates/tower-api/src/models/update_account_params.rs index a3a12676..7f051a0b 100644 --- a/crates/tower-api/src/models/update_account_params.rs +++ b/crates/tower-api/src/models/update_account_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_account_response.rs b/crates/tower-api/src/models/update_account_response.rs index 2d7418df..6b289c94 100644 --- a/crates/tower-api/src/models/update_account_response.rs +++ b/crates/tower-api/src/models/update_account_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_app_environment_params.rs b/crates/tower-api/src/models/update_app_environment_params.rs index a9b0dd4a..d0fbc7f2 100644 --- a/crates/tower-api/src/models/update_app_environment_params.rs +++ b/crates/tower-api/src/models/update_app_environment_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_app_environment_response.rs b/crates/tower-api/src/models/update_app_environment_response.rs index 9287ac4e..0da5a43b 100644 --- a/crates/tower-api/src/models/update_app_environment_response.rs +++ b/crates/tower-api/src/models/update_app_environment_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_app_params.rs b/crates/tower-api/src/models/update_app_params.rs index 529df315..7b030fa8 100644 --- a/crates/tower-api/src/models/update_app_params.rs +++ b/crates/tower-api/src/models/update_app_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_app_response.rs b/crates/tower-api/src/models/update_app_response.rs index f0ef7d93..1b6e34a0 100644 --- a/crates/tower-api/src/models/update_app_response.rs +++ b/crates/tower-api/src/models/update_app_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_catalog_params.rs b/crates/tower-api/src/models/update_catalog_params.rs index 54a31fe3..8546d7be 100644 --- a/crates/tower-api/src/models/update_catalog_params.rs +++ b/crates/tower-api/src/models/update_catalog_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_catalog_response.rs b/crates/tower-api/src/models/update_catalog_response.rs index ee4574ad..f95ad2df 100644 --- a/crates/tower-api/src/models/update_catalog_response.rs +++ b/crates/tower-api/src/models/update_catalog_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_email_preferences_body.rs b/crates/tower-api/src/models/update_email_preferences_body.rs index 2630ad09..03e86fbf 100644 --- a/crates/tower-api/src/models/update_email_preferences_body.rs +++ b/crates/tower-api/src/models/update_email_preferences_body.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_environment_params.rs b/crates/tower-api/src/models/update_environment_params.rs index a57453f5..750e217b 100644 --- a/crates/tower-api/src/models/update_environment_params.rs +++ b/crates/tower-api/src/models/update_environment_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_environment_response.rs b/crates/tower-api/src/models/update_environment_response.rs index 1d7b9709..0d94e746 100644 --- a/crates/tower-api/src/models/update_environment_response.rs +++ b/crates/tower-api/src/models/update_environment_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_my_team_invitation_params.rs b/crates/tower-api/src/models/update_my_team_invitation_params.rs index 733f32b2..388fce68 100644 --- a/crates/tower-api/src/models/update_my_team_invitation_params.rs +++ b/crates/tower-api/src/models/update_my_team_invitation_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_my_team_invitation_response.rs b/crates/tower-api/src/models/update_my_team_invitation_response.rs index 20b4f20a..bcbf9136 100644 --- a/crates/tower-api/src/models/update_my_team_invitation_response.rs +++ b/crates/tower-api/src/models/update_my_team_invitation_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_organization_params.rs b/crates/tower-api/src/models/update_organization_params.rs index 45e0b6a0..2912b546 100644 --- a/crates/tower-api/src/models/update_organization_params.rs +++ b/crates/tower-api/src/models/update_organization_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_organization_response.rs b/crates/tower-api/src/models/update_organization_response.rs index b8634563..782b6124 100644 --- a/crates/tower-api/src/models/update_organization_response.rs +++ b/crates/tower-api/src/models/update_organization_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_plan_params.rs b/crates/tower-api/src/models/update_plan_params.rs index 19fb20f4..6252fb2a 100644 --- a/crates/tower-api/src/models/update_plan_params.rs +++ b/crates/tower-api/src/models/update_plan_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_plan_response.rs b/crates/tower-api/src/models/update_plan_response.rs index 5f1f5662..c1bb2d58 100644 --- a/crates/tower-api/src/models/update_plan_response.rs +++ b/crates/tower-api/src/models/update_plan_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_schedule_params.rs b/crates/tower-api/src/models/update_schedule_params.rs index 1d63d0b4..ba2541c8 100644 --- a/crates/tower-api/src/models/update_schedule_params.rs +++ b/crates/tower-api/src/models/update_schedule_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ @@ -49,7 +49,7 @@ pub struct UpdateScheduleParams { pub overlap_policy: Option>, /// Parameters to pass when running the app #[serde(rename = "parameters", skip_serializing_if = "Option::is_none")] - pub parameters: Option>, + pub parameters: Option>, /// The status of the schedule #[serde( rename = "status", diff --git a/crates/tower-api/src/models/update_schedule_response.rs b/crates/tower-api/src/models/update_schedule_response.rs index 0825aacb..a75eeca5 100644 --- a/crates/tower-api/src/models/update_schedule_response.rs +++ b/crates/tower-api/src/models/update_schedule_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_secret_params.rs b/crates/tower-api/src/models/update_secret_params.rs index b4725dc9..b4f02c80 100644 --- a/crates/tower-api/src/models/update_secret_params.rs +++ b/crates/tower-api/src/models/update_secret_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_secret_response.rs b/crates/tower-api/src/models/update_secret_response.rs index c5be5745..589c5013 100644 --- a/crates/tower-api/src/models/update_secret_response.rs +++ b/crates/tower-api/src/models/update_secret_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_team_member_params.rs b/crates/tower-api/src/models/update_team_member_params.rs index 0e989caa..5b34f5d7 100644 --- a/crates/tower-api/src/models/update_team_member_params.rs +++ b/crates/tower-api/src/models/update_team_member_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_team_member_response.rs b/crates/tower-api/src/models/update_team_member_response.rs index a4f09d4d..42511c70 100644 --- a/crates/tower-api/src/models/update_team_member_response.rs +++ b/crates/tower-api/src/models/update_team_member_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_team_params.rs b/crates/tower-api/src/models/update_team_params.rs index ece74dfb..4dcef519 100644 --- a/crates/tower-api/src/models/update_team_params.rs +++ b/crates/tower-api/src/models/update_team_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_team_response.rs b/crates/tower-api/src/models/update_team_response.rs index 0f9e036c..28c1734c 100644 --- a/crates/tower-api/src/models/update_team_response.rs +++ b/crates/tower-api/src/models/update_team_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_user_params.rs b/crates/tower-api/src/models/update_user_params.rs index a049a267..a95860ca 100644 --- a/crates/tower-api/src/models/update_user_params.rs +++ b/crates/tower-api/src/models/update_user_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_user_response.rs b/crates/tower-api/src/models/update_user_response.rs index bf777a83..727a11d9 100644 --- a/crates/tower-api/src/models/update_user_response.rs +++ b/crates/tower-api/src/models/update_user_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_webhook_params.rs b/crates/tower-api/src/models/update_webhook_params.rs index afe75e0f..2272a311 100644 --- a/crates/tower-api/src/models/update_webhook_params.rs +++ b/crates/tower-api/src/models/update_webhook_params.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/update_webhook_response.rs b/crates/tower-api/src/models/update_webhook_response.rs index c5920056..90ba489a 100644 --- a/crates/tower-api/src/models/update_webhook_response.rs +++ b/crates/tower-api/src/models/update_webhook_response.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/usage_limit.rs b/crates/tower-api/src/models/usage_limit.rs index e6c15a5c..53252d37 100644 --- a/crates/tower-api/src/models/usage_limit.rs +++ b/crates/tower-api/src/models/usage_limit.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/usage_metric_time_series_point.rs b/crates/tower-api/src/models/usage_metric_time_series_point.rs index a6c58730..38d14c80 100644 --- a/crates/tower-api/src/models/usage_metric_time_series_point.rs +++ b/crates/tower-api/src/models/usage_metric_time_series_point.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/user.rs b/crates/tower-api/src/models/user.rs index c389c967..d7e31814 100644 --- a/crates/tower-api/src/models/user.rs +++ b/crates/tower-api/src/models/user.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-api/src/models/webhook.rs b/crates/tower-api/src/models/webhook.rs index 2bd17f11..ad5db127 100644 --- a/crates/tower-api/src/models/webhook.rs +++ b/crates/tower-api/src/models/webhook.rs @@ -3,7 +3,7 @@ * * REST API to interact with Tower Services. * - * The version of the OpenAPI document: 0.10.23-preview + * The version of the OpenAPI document: v0.10.24 * Contact: hello@tower.dev * Generated by: https://openapi-generator.tech */ diff --git a/crates/tower-cmd/src/api.rs b/crates/tower-cmd/src/api.rs index ab5c6b35..1da1637b 100644 --- a/crates/tower-cmd/src/api.rs +++ b/crates/tower-cmd/src/api.rs @@ -7,7 +7,7 @@ use tokio::sync::mpsc; use tower_api::apis::configuration; use tower_api::apis::Error; use tower_api::apis::ResponseContent; -use tower_api::models::RunParameterInput; +use tower_api::models::RunParameter; use tower_telemetry::debug; /// Helper trait to extract the successful response data from API responses @@ -34,6 +34,7 @@ pub async fn describe_app( start_at: None, end_at: None, timezone: None, + environment: None, }; unwrap_api_response(tower_api::apis::default_api::describe_app( @@ -404,10 +405,8 @@ pub async fn refresh_session( pub async fn list_teams( config: &Config, -) -> Result< - tower_api::models::ListTeamsResponse, - Error, -> { +) -> Result> +{ let api_config = &config.into(); let params = tower_api::apis::default_api::ListTeamsParams { @@ -934,7 +933,8 @@ pub async fn create_schedule( let run_parameters = parameters.map(|params| { params .into_iter() - .map(|(key, value)| RunParameterInput { + .map(|(key, value)| RunParameter { + is_override: None, name: key, value, hidden: None, @@ -972,7 +972,8 @@ pub async fn update_schedule( let run_parameters = parameters.map(|params| { params .into_iter() - .map(|(key, value)| RunParameterInput { + .map(|(key, value)| RunParameter { + is_override: None, name: key, value, hidden: None, @@ -1079,10 +1080,8 @@ pub async fn cancel_run( config: &Config, name: &str, seq: i64, -) -> Result< - tower_api::models::CancelRunResponse, - Error, -> { +) -> Result> +{ let api_config = &config.into(); let params = tower_api::apis::default_api::CancelRunParams { @@ -1090,10 +1089,7 @@ pub async fn cancel_run( seq, }; - unwrap_api_response(tower_api::apis::default_api::cancel_run( - api_config, params, - )) - .await + unwrap_api_response(tower_api::apis::default_api::cancel_run(api_config, params)).await } impl ResponseEntity for tower_api::apis::default_api::CancelRunSuccess { diff --git a/crates/tower-cmd/src/apps.rs b/crates/tower-cmd/src/apps.rs index a75d51c5..9d821d7b 100644 --- a/crates/tower-cmd/src/apps.rs +++ b/crates/tower-cmd/src/apps.rs @@ -97,9 +97,13 @@ pub fn apps_cmd() -> Command { } pub async fn do_logs(config: Config, cmd: &ArgMatches) { - let app_name_raw = cmd.get_one::("app_name").expect("app_name is required"); + let app_name_raw = cmd + .get_one::("app_name") + .expect("app_name is required"); let (name, seq) = if let Some((name, num_str)) = app_name_raw.split_once('#') { - let num = num_str.parse::().unwrap_or_else(|_| output::die("Run number must be a number")); + let num = num_str + .parse::() + .unwrap_or_else(|_| output::die("Run number must be a number")); (name.to_string(), num) } else { let num = match cmd.get_one::("run_number").copied() { @@ -123,7 +127,9 @@ pub async fn do_logs(config: Config, cmd: &ArgMatches) { } pub async fn do_show(config: Config, cmd: &ArgMatches) { - let name = cmd.get_one::("app_name").expect("app_name is required"); + let name = cmd + .get_one::("app_name") + .expect("app_name is required"); match api::describe_app(&config, &name).await { Ok(app_response) => { @@ -236,7 +242,9 @@ pub async fn do_create(config: Config, args: &ArgMatches) { } pub async fn do_delete(config: Config, cmd: &ArgMatches) { - let name = cmd.get_one::("app_name").expect("app_name is required"); + let name = cmd + .get_one::("app_name") + .expect("app_name is required"); output::with_spinner("Deleting app", api::delete_app(&config, name)).await; } @@ -263,7 +271,8 @@ pub async fn do_cancel(config: Config, cmd: &ArgMatches) { async fn latest_run_number(config: &Config, name: &str) -> i64 { match api::describe_app(config, name).await { - Ok(resp) => resp.runs + Ok(resp) => resp + .runs .iter() .map(|r| r.number) .max() @@ -307,7 +316,9 @@ async fn follow_logs(config: Config, name: String, seq: i64) { sleep(RUN_START_POLL_INTERVAL).await; if wait_started.elapsed() > RUN_START_TIMEOUT { - output::error("Timed out waiting for run to start. The runner may be unavailable."); + output::error( + "Timed out waiting for run to start. The runner may be unavailable.", + ); return; } @@ -552,9 +563,9 @@ fn is_run_finished(run: &Run) -> bool { fn is_run_started(run: &Run) -> bool { match run.status { - tower_api::models::run::Status::Scheduled | tower_api::models::run::Status::Pending | tower_api::models::run::Status::Starting => { - false - } + tower_api::models::run::Status::Scheduled + | tower_api::models::run::Status::Pending + | tower_api::models::run::Status::Starting => false, _ => true, } } @@ -585,7 +596,9 @@ mod tests { assert_eq!(cmd, "logs"); assert_eq!(sub_matches.get_one::("follow"), Some(&true)); assert_eq!( - sub_matches.get_one::("app_name").map(|s| s.as_str()), + sub_matches + .get_one::("app_name") + .map(|s| s.as_str()), Some("hello-world#11") ); assert_eq!(sub_matches.get_one::("run_number"), None); @@ -599,7 +612,9 @@ mod tests { let (_, sub_matches) = matches.subcommand().unwrap(); assert_eq!( - sub_matches.get_one::("app_name").map(|s| s.as_str()), + sub_matches + .get_one::("app_name") + .map(|s| s.as_str()), Some("hello-world") ); assert_eq!(sub_matches.get_one::("run_number"), Some(&11)); @@ -607,7 +622,12 @@ mod tests { #[test] fn test_terminal_statuses_explicit() { - let non_terminal = [Status::Scheduled, Status::Pending, Status::Running, Status::Retrying]; + let non_terminal = [ + Status::Scheduled, + Status::Pending, + Status::Running, + Status::Retrying, + ]; for status in non_terminal { let run = Run { status, diff --git a/crates/tower-cmd/src/deploy.rs b/crates/tower-cmd/src/deploy.rs index 069c1ca9..c5328f38 100644 --- a/crates/tower-cmd/src/deploy.rs +++ b/crates/tower-cmd/src/deploy.rs @@ -106,12 +106,11 @@ pub async fn deploy_from_dir( let path = dir.join("Towerfile"); let path_display = path.display().to_string(); - let towerfile = Towerfile::from_path(path).map_err(|source| { - crate::Error::TowerfileLoadFailed { + let towerfile = + Towerfile::from_path(path).map_err(|source| crate::Error::TowerfileLoadFailed { path: path_display, source, - } - })?; + })?; let api_config = config.into(); // Add app existence check before proceeding diff --git a/crates/tower-cmd/src/mcp.rs b/crates/tower-cmd/src/mcp.rs index d46ba454..0b069356 100644 --- a/crates/tower-cmd/src/mcp.rs +++ b/crates/tower-cmd/src/mcp.rs @@ -859,12 +859,15 @@ impl TowerService { } let name = request.name.clone(); Self::modify_towerfile(&request.common, |tf| { - tf.set_parameter(&name, Parameter { - name: name.clone(), - description: request.description.unwrap_or_default(), - default: request.default.unwrap_or_default(), - hidden: request.hidden, - }); + tf.set_parameter( + &name, + Parameter { + name: name.clone(), + description: request.description.unwrap_or_default(), + default: request.default.unwrap_or_default(), + hidden: request.hidden, + }, + ); Ok(format!("Added parameter '{name}'")) }) } @@ -878,7 +881,10 @@ impl TowerService { ) -> Result { let name = request.name.clone(); Self::modify_towerfile(&request.common, |tf| { - let existing = tf.parameters.iter().find(|p| p.name == name) + let existing = tf + .parameters + .iter() + .find(|p| p.name == name) .ok_or_else(|| format!("Parameter '{name}' not found"))?; let target_name = request .new_name @@ -889,7 +895,9 @@ impl TowerService { } let param = Parameter { name: target_name, - description: request.description.unwrap_or_else(|| existing.description.clone()), + description: request + .description + .unwrap_or_else(|| existing.description.clone()), default: request.default.unwrap_or_else(|| existing.default.clone()), hidden: request.hidden.unwrap_or(existing.hidden), }; @@ -901,9 +909,7 @@ impl TowerService { }) } - #[tool( - description = "Remove a parameter from the Towerfile. Optional: working_directory." - )] + #[tool(description = "Remove a parameter from the Towerfile. Optional: working_directory.")] async fn tower_file_remove_parameter( &self, Parameters(request): Parameters, diff --git a/crates/tower-cmd/src/run.rs b/crates/tower-cmd/src/run.rs index 3378dc83..190d9f4e 100644 --- a/crates/tower-cmd/src/run.rs +++ b/crates/tower-cmd/src/run.rs @@ -107,10 +107,7 @@ pub async fn do_run(config: Config, args: &ArgMatches) { /// do_run is the primary entrypoint into running apps both locally and remotely in Tower. It will /// use the configuration to determine the requested way of running a Tower app. -pub async fn do_run_inner( - config: Config, - args: &ArgMatches, -) -> Result<(), Error> { +pub async fn do_run_inner(config: Config, args: &ArgMatches) -> Result<(), Error> { let res = get_run_parameters(args); // We always expect there to be an environment due to the fact that there is a @@ -846,7 +843,10 @@ mod tests { #[test] fn app_name_parsed_as_positional_arg() { let m = parse(&["my-app"]).unwrap(); - assert_eq!(m.get_one::("app_name").map(|s| s.as_str()), Some("my-app")); + assert_eq!( + m.get_one::("app_name").map(|s| s.as_str()), + Some("my-app") + ); } #[test] @@ -859,8 +859,14 @@ mod tests { fn unknown_flags_are_rejected() { let err = parse(&["--param", "x=y"]).unwrap_err(); let msg = err.to_string(); - assert!(msg.contains("--param"), "should mention the bad flag: {msg}"); - assert!(msg.contains("--parameter"), "should suggest the correct flag: {msg}"); + assert!( + msg.contains("--param"), + "should mention the bad flag: {msg}" + ); + assert!( + msg.contains("--parameter"), + "should suggest the correct flag: {msg}" + ); } #[test] @@ -878,7 +884,10 @@ mod tests { #[test] fn parameters_after_app_name() { let m = parse(&["my-app", "-p", "key=val"]).unwrap(); - assert_eq!(m.get_one::("app_name").map(|s| s.as_str()), Some("my-app")); + assert_eq!( + m.get_one::("app_name").map(|s| s.as_str()), + Some("my-app") + ); let params: Vec<&String> = m.get_many::("parameters").unwrap().collect(); assert_eq!(params, vec!["key=val"]); } @@ -886,7 +895,10 @@ mod tests { #[test] fn parameters_before_app_name() { let m = parse(&["-p", "key=val", "my-app"]).unwrap(); - assert_eq!(m.get_one::("app_name").map(|s| s.as_str()), Some("my-app")); + assert_eq!( + m.get_one::("app_name").map(|s| s.as_str()), + Some("my-app") + ); let params: Vec<&String> = m.get_many::("parameters").unwrap().collect(); assert_eq!(params, vec!["key=val"]); } diff --git a/crates/tower-cmd/src/schedules.rs b/crates/tower-cmd/src/schedules.rs index 59562cf2..cb6aa499 100644 --- a/crates/tower-cmd/src/schedules.rs +++ b/crates/tower-cmd/src/schedules.rs @@ -171,7 +171,9 @@ pub async fn do_create(config: Config, args: &ArgMatches) { } pub async fn do_update(config: Config, args: &ArgMatches) { - let id_or_name = args.get_one::("id_or_name").expect("id_or_name is required"); + let id_or_name = args + .get_one::("id_or_name") + .expect("id_or_name is required"); let cron = args.get_one::("cron"); let parameters = parse_parameters(args); @@ -185,7 +187,9 @@ pub async fn do_update(config: Config, args: &ArgMatches) { } pub async fn do_delete(config: Config, args: &ArgMatches) { - let schedule_id = args.get_one::("schedule_id").expect("schedule_id is required"); + let schedule_id = args + .get_one::("schedule_id") + .expect("schedule_id is required"); output::with_spinner( "Deleting schedule", diff --git a/crates/tower-cmd/src/secrets.rs b/crates/tower-cmd/src/secrets.rs index e6a95393..f6baf5bd 100644 --- a/crates/tower-cmd/src/secrets.rs +++ b/crates/tower-cmd/src/secrets.rs @@ -185,11 +185,15 @@ pub async fn do_create(config: Config, args: &ArgMatches) { } pub async fn do_delete(config: Config, args: &ArgMatches) { - let secret_name_arg = args.get_one::("secret_name").expect("secret_name is required"); + let secret_name_arg = args + .get_one::("secret_name") + .expect("secret_name is required"); let (environment, name) = if let Some((env, name)) = secret_name_arg.split_once('/') { (env.to_string(), name.to_string()) } else { - let env = args.get_one::("environment").expect("environment has default"); + let env = args + .get_one::("environment") + .expect("environment has default"); (env.clone(), secret_name_arg.clone()) }; debug!("deleting secret, environment={} name={}", environment, name); @@ -240,4 +244,3 @@ async fn encrypt_and_create_secret( .await .map_err(SecretCreationError::CreateFailed) } - diff --git a/crates/tower-cmd/src/session.rs b/crates/tower-cmd/src/session.rs index 409d06cd..32d88987 100644 --- a/crates/tower-cmd/src/session.rs +++ b/crates/tower-cmd/src/session.rs @@ -33,7 +33,8 @@ pub async fn do_login(config: Config, args: &ArgMatches) { eprint!("Do you want to continue? [y/N] "); let mut input = String::new(); - if std::io::stdin().read_line(&mut input).is_err() || !input.trim().eq_ignore_ascii_case("y") + if std::io::stdin().read_line(&mut input).is_err() + || !input.trim().eq_ignore_ascii_case("y") { return; } diff --git a/crates/tower-cmd/src/skill.rs b/crates/tower-cmd/src/skill.rs index 13caca60..be1ee7b7 100644 --- a/crates/tower-cmd/src/skill.rs +++ b/crates/tower-cmd/src/skill.rs @@ -29,10 +29,7 @@ fn generate_skill_md(root: Command) -> String { } fn append_command(out: &mut String, cmd: &Command, path: &[&str], depth: usize) { - let subcommands: Vec<_> = cmd - .get_subcommands() - .filter(|c| !c.is_hide_set()) - .collect(); + let subcommands: Vec<_> = cmd.get_subcommands().filter(|c| !c.is_hide_set()).collect(); for sub in &subcommands { let name = sub.get_name(); @@ -71,12 +68,7 @@ fn append_command(out: &mut String, cmd: &Command, path: &[&str], depth: usize) .get_help() .map(|h| format!(" — {}", h)) .unwrap_or_default(); - out.push_str(&format!( - "- `<{}>` {}{}\n", - arg.get_id(), - req, - help - )); + out.push_str(&format!("- `<{}>` {}{}\n", arg.get_id(), req, help)); } for arg in &named { let long = arg.get_long().unwrap(); @@ -98,10 +90,7 @@ fn append_command(out: &mut String, cmd: &Command, path: &[&str], depth: usize) out.push('\n'); } - let child_subs: Vec<_> = sub - .get_subcommands() - .filter(|c| !c.is_hide_set()) - .collect(); + let child_subs: Vec<_> = sub.get_subcommands().filter(|c| !c.is_hide_set()).collect(); if !child_subs.is_empty() { append_command(out, sub, &full_path, depth + 1); diff --git a/crates/tower-cmd/src/teams.rs b/crates/tower-cmd/src/teams.rs index d0cc2413..abeaa666 100644 --- a/crates/tower-cmd/src/teams.rs +++ b/crates/tower-cmd/src/teams.rs @@ -109,7 +109,9 @@ async fn do_list_via_session(config: &Config) { } pub async fn do_switch(config: Config, args: &ArgMatches) { - let name = args.get_one::("team_name").expect("team_name is required"); + let name = args + .get_one::("team_name") + .expect("team_name is required"); // Refresh the session first to ensure we have the latest teams data let session = refresh_session(&config).await; @@ -140,4 +142,3 @@ pub async fn do_switch(config: Config, args: &ArgMatches) { } } } - diff --git a/crates/tower-cmd/src/util/apps.rs b/crates/tower-cmd/src/util/apps.rs index e6e14524..3b6cf49c 100644 --- a/crates/tower-cmd/src/util/apps.rs +++ b/crates/tower-cmd/src/util/apps.rs @@ -22,6 +22,7 @@ pub async fn ensure_app_exists( start_at: None, end_at: None, timezone: None, + environment: None, }, ) .await; diff --git a/crates/tower-cmd/src/util/deploy.rs b/crates/tower-cmd/src/util/deploy.rs index 5a6d3619..23c56a3c 100644 --- a/crates/tower-cmd/src/util/deploy.rs +++ b/crates/tower-cmd/src/util/deploy.rs @@ -8,8 +8,8 @@ use tower_package::{compute_sha256_file, Package}; use tower_telemetry::debug; use tower_api::apis::configuration::Configuration; -use tower_api::apis::urlencode; use tower_api::apis::default_api::DeployAppError; +use tower_api::apis::urlencode; use tower_api::apis::Error; use tower_api::apis::ResponseContent; use tower_api::models::DeployAppResponse; @@ -122,10 +122,16 @@ pub async fn deploy_app_package( let encoded_app_name = urlencode(app_name); let url = if all_environments { - format!("{}/apps/{}/deploy?all_environments=true", base_url, encoded_app_name) + format!( + "{}/apps/{}/deploy?all_environments=true", + base_url, encoded_app_name + ) } else if let Some(env) = environment { let encoded_environment = urlencode(env); - format!("{}/apps/{}/deploy?environment={}", base_url, encoded_app_name, encoded_environment) + format!( + "{}/apps/{}/deploy?environment={}", + base_url, encoded_app_name, encoded_environment + ) } else { format!("{}/apps/{}/deploy", base_url, encoded_app_name) }; diff --git a/src/tower/tower_api_client/api/default/describe_app.py b/src/tower/tower_api_client/api/default/describe_app.py index c9561e96..e5b4605d 100644 --- a/src/tower/tower_api_client/api/default/describe_app.py +++ b/src/tower/tower_api_client/api/default/describe_app.py @@ -18,6 +18,7 @@ def _get_kwargs( start_at: datetime.datetime | Unset = UNSET, end_at: datetime.datetime | Unset = UNSET, timezone: str | Unset = "UTC", + environment: str | Unset = "default", ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -35,6 +36,8 @@ def _get_kwargs( params["timezone"] = timezone + params["environment"] = environment + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} _kwargs: dict[str, Any] = { @@ -80,6 +83,7 @@ def sync_detailed( start_at: datetime.datetime | Unset = UNSET, end_at: datetime.datetime | Unset = UNSET, timezone: str | Unset = "UTC", + environment: str | Unset = "default", ) -> Response[DescribeAppResponse | ErrorModel]: """Describe app @@ -94,6 +98,8 @@ def sync_detailed( (inclusive). Provide timestamps in ISO-8601 format. timezone (str | Unset): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to UTC. Default: 'UTC'. + environment (str | Unset): The environment to resolve the app version against. Defaults to + 'default'. Default: 'default'. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -109,6 +115,7 @@ def sync_detailed( start_at=start_at, end_at=end_at, timezone=timezone, + environment=environment, ) response = client.get_httpx_client().request( @@ -126,6 +133,7 @@ def sync( start_at: datetime.datetime | Unset = UNSET, end_at: datetime.datetime | Unset = UNSET, timezone: str | Unset = "UTC", + environment: str | Unset = "default", ) -> DescribeAppResponse | ErrorModel | None: """Describe app @@ -140,6 +148,8 @@ def sync( (inclusive). Provide timestamps in ISO-8601 format. timezone (str | Unset): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to UTC. Default: 'UTC'. + environment (str | Unset): The environment to resolve the app version against. Defaults to + 'default'. Default: 'default'. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -156,6 +166,7 @@ def sync( start_at=start_at, end_at=end_at, timezone=timezone, + environment=environment, ).parsed @@ -167,6 +178,7 @@ async def asyncio_detailed( start_at: datetime.datetime | Unset = UNSET, end_at: datetime.datetime | Unset = UNSET, timezone: str | Unset = "UTC", + environment: str | Unset = "default", ) -> Response[DescribeAppResponse | ErrorModel]: """Describe app @@ -181,6 +193,8 @@ async def asyncio_detailed( (inclusive). Provide timestamps in ISO-8601 format. timezone (str | Unset): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to UTC. Default: 'UTC'. + environment (str | Unset): The environment to resolve the app version against. Defaults to + 'default'. Default: 'default'. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -196,6 +210,7 @@ async def asyncio_detailed( start_at=start_at, end_at=end_at, timezone=timezone, + environment=environment, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -211,6 +226,7 @@ async def asyncio( start_at: datetime.datetime | Unset = UNSET, end_at: datetime.datetime | Unset = UNSET, timezone: str | Unset = "UTC", + environment: str | Unset = "default", ) -> DescribeAppResponse | ErrorModel | None: """Describe app @@ -225,6 +241,8 @@ async def asyncio( (inclusive). Provide timestamps in ISO-8601 format. timezone (str | Unset): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to UTC. Default: 'UTC'. + environment (str | Unset): The environment to resolve the app version against. Defaults to + 'default'. Default: 'default'. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -242,5 +260,6 @@ async def asyncio( start_at=start_at, end_at=end_at, timezone=timezone, + environment=environment, ) ).parsed diff --git a/src/tower/tower_api_client/models/__init__.py b/src/tower/tower_api_client/models/__init__.py index d57f7661..c3cdbb98 100644 --- a/src/tower/tower_api_client/models/__init__.py +++ b/src/tower/tower_api_client/models/__init__.py @@ -159,7 +159,6 @@ from .run_log_line import RunLogLine from .run_log_line_channel import RunLogLineChannel from .run_parameter import RunParameter -from .run_parameter_input import RunParameterInput from .run_results import RunResults from .run_retry_policy import RunRetryPolicy from .run_run_initiator_details import RunRunInitiatorDetails @@ -393,7 +392,6 @@ "Runner", "RunnerCredentials", "RunParameter", - "RunParameterInput", "RunResults", "RunRetryPolicy", "RunRunInitiatorDetails", diff --git a/src/tower/tower_api_client/models/acknowledge_alert_response.py b/src/tower/tower_api_client/models/acknowledge_alert_response.py index c82bc172..ccd19b83 100644 --- a/src/tower/tower_api_client/models/acknowledge_alert_response.py +++ b/src/tower/tower_api_client/models/acknowledge_alert_response.py @@ -15,8 +15,8 @@ class AcknowledgeAlertResponse: """ Attributes: status (str): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/AcknowledgeAlertResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/AcknowledgeAlertResponse.json. """ status: str diff --git a/src/tower/tower_api_client/models/acknowledge_all_alerts_response.py b/src/tower/tower_api_client/models/acknowledge_all_alerts_response.py index 0a100799..8f336083 100644 --- a/src/tower/tower_api_client/models/acknowledge_all_alerts_response.py +++ b/src/tower/tower_api_client/models/acknowledge_all_alerts_response.py @@ -16,8 +16,8 @@ class AcknowledgeAllAlertsResponse: Attributes: count (int): Number of alerts that were acknowledged status (str): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/AcknowledgeAllAlertsResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/AcknowledgeAllAlertsResponse.json. """ count: int diff --git a/src/tower/tower_api_client/models/batch_schedule_params.py b/src/tower/tower_api_client/models/batch_schedule_params.py index b44c46b9..73103741 100644 --- a/src/tower/tower_api_client/models/batch_schedule_params.py +++ b/src/tower/tower_api_client/models/batch_schedule_params.py @@ -15,8 +15,8 @@ class BatchScheduleParams: """ Attributes: ids (list[str]): The IDs of the schedules to modify - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/BatchScheduleParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/BatchScheduleParams.json. """ ids: list[str] diff --git a/src/tower/tower_api_client/models/batch_schedule_response.py b/src/tower/tower_api_client/models/batch_schedule_response.py index 499d5b42..a4f05673 100644 --- a/src/tower/tower_api_client/models/batch_schedule_response.py +++ b/src/tower/tower_api_client/models/batch_schedule_response.py @@ -19,8 +19,8 @@ class BatchScheduleResponse: """ Attributes: schedules (list[Schedule]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/BatchScheduleResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/BatchScheduleResponse.json. """ schedules: list[Schedule] diff --git a/src/tower/tower_api_client/models/cancel_run_response.py b/src/tower/tower_api_client/models/cancel_run_response.py index c0719a98..1d2a63a5 100644 --- a/src/tower/tower_api_client/models/cancel_run_response.py +++ b/src/tower/tower_api_client/models/cancel_run_response.py @@ -18,15 +18,19 @@ class CancelRunResponse: """ Attributes: + cancelled_child_runs (int): Number of descendant runs that were also cancelled as part of this cascade. run (Run): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/CancelRunResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CancelRunResponse.json. """ + cancelled_child_runs: int run: Run schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: + cancelled_child_runs = self.cancelled_child_runs + run = self.run.to_dict() schema = self.schema @@ -35,6 +39,7 @@ def to_dict(self) -> dict[str, Any]: field_dict.update( { + "cancelled_child_runs": cancelled_child_runs, "run": run, } ) @@ -48,11 +53,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.run import Run d = dict(src_dict) + cancelled_child_runs = d.pop("cancelled_child_runs") + run = Run.from_dict(d.pop("run")) schema = d.pop("$schema", UNSET) cancel_run_response = cls( + cancelled_child_runs=cancelled_child_runs, run=run, schema=schema, ) diff --git a/src/tower/tower_api_client/models/claim_device_login_ticket_params.py b/src/tower/tower_api_client/models/claim_device_login_ticket_params.py index 8c1be7cb..13fa138d 100644 --- a/src/tower/tower_api_client/models/claim_device_login_ticket_params.py +++ b/src/tower/tower_api_client/models/claim_device_login_ticket_params.py @@ -16,8 +16,8 @@ class ClaimDeviceLoginTicketParams: Attributes: refresh_token (str): The refresh token for the session to delegate to the device. user_code (str): The user code to claim. - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/ClaimDeviceLoginTicketParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ClaimDeviceLoginTicketParams.json. """ refresh_token: str diff --git a/src/tower/tower_api_client/models/claim_device_login_ticket_response.py b/src/tower/tower_api_client/models/claim_device_login_ticket_response.py index 81e889cc..88d9c7be 100644 --- a/src/tower/tower_api_client/models/claim_device_login_ticket_response.py +++ b/src/tower/tower_api_client/models/claim_device_login_ticket_response.py @@ -15,8 +15,8 @@ class ClaimDeviceLoginTicketResponse: """ Attributes: claimed (bool): Whether the code was successfully claimed. - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/ClaimDeviceLoginTicketResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ClaimDeviceLoginTicketResponse.json. """ claimed: bool diff --git a/src/tower/tower_api_client/models/create_account_params.py b/src/tower/tower_api_client/models/create_account_params.py index bbce44bd..ef7caf01 100644 --- a/src/tower/tower_api_client/models/create_account_params.py +++ b/src/tower/tower_api_client/models/create_account_params.py @@ -16,8 +16,8 @@ class CreateAccountParams: Attributes: email (str): password (str): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/CreateAccountParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CreateAccountParams.json. """ email: str diff --git a/src/tower/tower_api_client/models/create_account_response.py b/src/tower/tower_api_client/models/create_account_response.py index 86a66ff0..646d5328 100644 --- a/src/tower/tower_api_client/models/create_account_response.py +++ b/src/tower/tower_api_client/models/create_account_response.py @@ -19,8 +19,8 @@ class CreateAccountResponse: """ Attributes: session (Session): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/CreateAccountResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CreateAccountResponse.json. """ session: Session diff --git a/src/tower/tower_api_client/models/create_api_key_params.py b/src/tower/tower_api_client/models/create_api_key_params.py index f5b36b7e..746a5e96 100644 --- a/src/tower/tower_api_client/models/create_api_key_params.py +++ b/src/tower/tower_api_client/models/create_api_key_params.py @@ -17,8 +17,8 @@ class CreateAPIKeyParams: """ Attributes: name (str): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/CreateAPIKeyParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CreateAPIKeyParams.json. expires_at (datetime.datetime | None | Unset): When this API key expires. scopes (None | str | Unset): Space separated scopes that this API key is valid for. team (None | str | Unset): The team this API key is associated with. This field is optional. You must be a diff --git a/src/tower/tower_api_client/models/create_api_key_response.py b/src/tower/tower_api_client/models/create_api_key_response.py index 96a4dd40..da7ebf59 100644 --- a/src/tower/tower_api_client/models/create_api_key_response.py +++ b/src/tower/tower_api_client/models/create_api_key_response.py @@ -19,8 +19,8 @@ class CreateAPIKeyResponse: """ Attributes: api_key (APIKey): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/CreateAPIKeyResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CreateAPIKeyResponse.json. """ api_key: APIKey diff --git a/src/tower/tower_api_client/models/create_app_params.py b/src/tower/tower_api_client/models/create_app_params.py index a558bd73..fdf0e085 100644 --- a/src/tower/tower_api_client/models/create_app_params.py +++ b/src/tower/tower_api_client/models/create_app_params.py @@ -15,8 +15,8 @@ class CreateAppParams: """ Attributes: name (str): The name of the app. - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/CreateAppParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CreateAppParams.json. is_externally_accessible (bool | Unset): Indicates that web traffic should be routed to this app and that its runs should get a hostname assigned to it. Default: False. short_description (str | Unset): A description of the app. diff --git a/src/tower/tower_api_client/models/create_app_response.py b/src/tower/tower_api_client/models/create_app_response.py index eb0dd5f1..2c727a2e 100644 --- a/src/tower/tower_api_client/models/create_app_response.py +++ b/src/tower/tower_api_client/models/create_app_response.py @@ -19,8 +19,8 @@ class CreateAppResponse: """ Attributes: app (App): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/CreateAppResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CreateAppResponse.json. """ app: App diff --git a/src/tower/tower_api_client/models/create_catalog_params.py b/src/tower/tower_api_client/models/create_catalog_params.py index c0c202ae..f7e7b890 100644 --- a/src/tower/tower_api_client/models/create_catalog_params.py +++ b/src/tower/tower_api_client/models/create_catalog_params.py @@ -23,8 +23,8 @@ class CreateCatalogParams: name (str): properties (list[EncryptedCatalogProperty]): type_ (CreateCatalogParamsType): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/CreateCatalogParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CreateCatalogParams.json. """ environment: str diff --git a/src/tower/tower_api_client/models/create_catalog_response.py b/src/tower/tower_api_client/models/create_catalog_response.py index 50333b9c..6559c70f 100644 --- a/src/tower/tower_api_client/models/create_catalog_response.py +++ b/src/tower/tower_api_client/models/create_catalog_response.py @@ -19,8 +19,8 @@ class CreateCatalogResponse: """ Attributes: catalog (Catalog): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/CreateCatalogResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CreateCatalogResponse.json. """ catalog: Catalog diff --git a/src/tower/tower_api_client/models/create_device_login_ticket_response.py b/src/tower/tower_api_client/models/create_device_login_ticket_response.py index 945593bc..eb5c1ada 100644 --- a/src/tower/tower_api_client/models/create_device_login_ticket_response.py +++ b/src/tower/tower_api_client/models/create_device_login_ticket_response.py @@ -23,8 +23,8 @@ class CreateDeviceLoginTicketResponse: login_url (str): The URL where the user should go to enter the user code. user_code (str): The code that the user needs to enter to authenticate. verification_url (str): The URL that the device should poll to check authentication status. - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/CreateDeviceLoginTicketResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CreateDeviceLoginTicketResponse.json. """ device_code: str diff --git a/src/tower/tower_api_client/models/create_environment_params.py b/src/tower/tower_api_client/models/create_environment_params.py index 7b8d9e80..b111d756 100644 --- a/src/tower/tower_api_client/models/create_environment_params.py +++ b/src/tower/tower_api_client/models/create_environment_params.py @@ -15,8 +15,8 @@ class CreateEnvironmentParams: """ Attributes: name (str): The name of the environment - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/CreateEnvironmentParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CreateEnvironmentParams.json. """ name: str diff --git a/src/tower/tower_api_client/models/create_environment_response.py b/src/tower/tower_api_client/models/create_environment_response.py index 50cd8e95..3bd42020 100644 --- a/src/tower/tower_api_client/models/create_environment_response.py +++ b/src/tower/tower_api_client/models/create_environment_response.py @@ -19,8 +19,8 @@ class CreateEnvironmentResponse: """ Attributes: environment (Environment): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/CreateEnvironmentResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CreateEnvironmentResponse.json. """ environment: Environment diff --git a/src/tower/tower_api_client/models/create_guest_params.py b/src/tower/tower_api_client/models/create_guest_params.py index 1defe854..bd239c34 100644 --- a/src/tower/tower_api_client/models/create_guest_params.py +++ b/src/tower/tower_api_client/models/create_guest_params.py @@ -15,8 +15,8 @@ class CreateGuestParams: """ Attributes: app (str): The name of the externally accessible app this guest can access. - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/CreateGuestParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CreateGuestParams.json. expires_in (int | Unset): The number of seconds the guest session should last. Defaults to 72 hours. Default: 259200. name (str | Unset): Optional display name for the guest. diff --git a/src/tower/tower_api_client/models/create_guest_response.py b/src/tower/tower_api_client/models/create_guest_response.py index bf1ad5de..2b0f4c1b 100644 --- a/src/tower/tower_api_client/models/create_guest_response.py +++ b/src/tower/tower_api_client/models/create_guest_response.py @@ -23,8 +23,8 @@ class CreateGuestResponse: guest (Guest): login_url (str): The URL to share with the guest for logging in. login_url_expires_at (datetime.datetime): When the login URL expires. - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/CreateGuestResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CreateGuestResponse.json. """ guest: Guest diff --git a/src/tower/tower_api_client/models/create_sandbox_secrets_params.py b/src/tower/tower_api_client/models/create_sandbox_secrets_params.py index 59fbb62b..4b8fec17 100644 --- a/src/tower/tower_api_client/models/create_sandbox_secrets_params.py +++ b/src/tower/tower_api_client/models/create_sandbox_secrets_params.py @@ -16,8 +16,8 @@ class CreateSandboxSecretsParams: Attributes: environment (str): Environment to create secrets in secret_keys (list[str]): List of secret keys to create with Tower defaults - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/CreateSandboxSecretsParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CreateSandboxSecretsParams.json. """ environment: str diff --git a/src/tower/tower_api_client/models/create_sandbox_secrets_response.py b/src/tower/tower_api_client/models/create_sandbox_secrets_response.py index 09e0be98..246de164 100644 --- a/src/tower/tower_api_client/models/create_sandbox_secrets_response.py +++ b/src/tower/tower_api_client/models/create_sandbox_secrets_response.py @@ -15,8 +15,8 @@ class CreateSandboxSecretsResponse: """ Attributes: created (list[str]): List of secret keys that were created - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/CreateSandboxSecretsResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CreateSandboxSecretsResponse.json. """ created: list[str] diff --git a/src/tower/tower_api_client/models/create_schedule_params.py b/src/tower/tower_api_client/models/create_schedule_params.py index adfbb2c8..79b0d774 100644 --- a/src/tower/tower_api_client/models/create_schedule_params.py +++ b/src/tower/tower_api_client/models/create_schedule_params.py @@ -12,7 +12,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.run_parameter_input import RunParameterInput + from ..models.run_parameter import RunParameter T = TypeVar("T", bound="CreateScheduleParams") @@ -24,8 +24,8 @@ class CreateScheduleParams: Attributes: app_name (str): The name of the app to create a schedule for cron (str): The cron expression defining when the app should run - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/CreateScheduleParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CreateScheduleParams.json. app_version (None | str | Unset): This property is deprecated and ignored. Schedules inherit the version from their environment. environment (str | Unset): The environment to run the app in Default: 'default'. @@ -33,7 +33,7 @@ class CreateScheduleParams: generated for you. overlap_policy (CreateScheduleParamsOverlapPolicy | Unset): The overlap policy for the schedule Default: CreateScheduleParamsOverlapPolicy.ALLOW. - parameters (list[RunParameterInput] | Unset): Parameters to pass when running the app + parameters (list[RunParameter] | Unset): Parameters to pass when running the app status (CreateScheduleParamsStatus | Unset): The status of the schedule (defaults to active) timezone (None | str | Unset): The IANA timezone identifier that the cron expression should be evaluated in (e.g., 'America/New_York', 'Europe/London'). Defaults to 'UTC'. Default: 'UTC'. @@ -48,7 +48,7 @@ class CreateScheduleParams: overlap_policy: CreateScheduleParamsOverlapPolicy | Unset = ( CreateScheduleParamsOverlapPolicy.ALLOW ) - parameters: list[RunParameterInput] | Unset = UNSET + parameters: list[RunParameter] | Unset = UNSET status: CreateScheduleParamsStatus | Unset = UNSET timezone: None | str | Unset = "UTC" @@ -123,7 +123,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.run_parameter_input import RunParameterInput + from ..models.run_parameter import RunParameter d = dict(src_dict) app_name = d.pop("app_name") @@ -160,11 +160,11 @@ def _parse_name(data: object) -> None | str | Unset: overlap_policy = CreateScheduleParamsOverlapPolicy(_overlap_policy) _parameters = d.pop("parameters", UNSET) - parameters: list[RunParameterInput] | Unset = UNSET + parameters: list[RunParameter] | Unset = UNSET if _parameters is not UNSET: parameters = [] for parameters_item_data in _parameters: - parameters_item = RunParameterInput.from_dict(parameters_item_data) + parameters_item = RunParameter.from_dict(parameters_item_data) parameters.append(parameters_item) diff --git a/src/tower/tower_api_client/models/create_schedule_response.py b/src/tower/tower_api_client/models/create_schedule_response.py index 98128d9f..106ccc5c 100644 --- a/src/tower/tower_api_client/models/create_schedule_response.py +++ b/src/tower/tower_api_client/models/create_schedule_response.py @@ -19,8 +19,8 @@ class CreateScheduleResponse: """ Attributes: schedule (Schedule): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/CreateScheduleResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CreateScheduleResponse.json. """ schedule: Schedule diff --git a/src/tower/tower_api_client/models/create_secret_params.py b/src/tower/tower_api_client/models/create_secret_params.py index a89e0179..f2d22b65 100644 --- a/src/tower/tower_api_client/models/create_secret_params.py +++ b/src/tower/tower_api_client/models/create_secret_params.py @@ -18,8 +18,8 @@ class CreateSecretParams: environment (str): name (str): preview (str): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/CreateSecretParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CreateSecretParams.json. """ encrypted_value: str diff --git a/src/tower/tower_api_client/models/create_secret_response.py b/src/tower/tower_api_client/models/create_secret_response.py index 9f8585c3..1a0d4f0b 100644 --- a/src/tower/tower_api_client/models/create_secret_response.py +++ b/src/tower/tower_api_client/models/create_secret_response.py @@ -19,8 +19,8 @@ class CreateSecretResponse: """ Attributes: secret (Secret): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/CreateSecretResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CreateSecretResponse.json. """ secret: Secret diff --git a/src/tower/tower_api_client/models/create_session_params.py b/src/tower/tower_api_client/models/create_session_params.py index 9840a580..6cf5d381 100644 --- a/src/tower/tower_api_client/models/create_session_params.py +++ b/src/tower/tower_api_client/models/create_session_params.py @@ -16,8 +16,8 @@ class CreateSessionParams: Attributes: password (str): username (str): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/CreateSessionParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CreateSessionParams.json. code (str | Unset): One-time password verification code for two-factor authentication. If the user has two- factor authentication enabled, this code is required to log in. """ diff --git a/src/tower/tower_api_client/models/create_session_response.py b/src/tower/tower_api_client/models/create_session_response.py index cafe99e0..7f0490d1 100644 --- a/src/tower/tower_api_client/models/create_session_response.py +++ b/src/tower/tower_api_client/models/create_session_response.py @@ -19,8 +19,8 @@ class CreateSessionResponse: """ Attributes: session (Session): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/CreateSessionResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CreateSessionResponse.json. """ session: Session diff --git a/src/tower/tower_api_client/models/create_team_params.py b/src/tower/tower_api_client/models/create_team_params.py index 21379b65..58e53f60 100644 --- a/src/tower/tower_api_client/models/create_team_params.py +++ b/src/tower/tower_api_client/models/create_team_params.py @@ -15,8 +15,8 @@ class CreateTeamParams: """ Attributes: name (str): The name of the team to create - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/CreateTeamParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CreateTeamParams.json. """ name: str diff --git a/src/tower/tower_api_client/models/create_team_response.py b/src/tower/tower_api_client/models/create_team_response.py index 342f3f44..ffbdde2e 100644 --- a/src/tower/tower_api_client/models/create_team_response.py +++ b/src/tower/tower_api_client/models/create_team_response.py @@ -19,8 +19,8 @@ class CreateTeamResponse: """ Attributes: team (Team): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/CreateTeamResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CreateTeamResponse.json. """ team: Team diff --git a/src/tower/tower_api_client/models/create_webhook_params.py b/src/tower/tower_api_client/models/create_webhook_params.py index bb009453..ea81c248 100644 --- a/src/tower/tower_api_client/models/create_webhook_params.py +++ b/src/tower/tower_api_client/models/create_webhook_params.py @@ -16,8 +16,8 @@ class CreateWebhookParams: Attributes: name (str): The name of the webhook. url (str): The webhook URL. - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/CreateWebhookParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CreateWebhookParams.json. """ name: str diff --git a/src/tower/tower_api_client/models/create_webhook_response.py b/src/tower/tower_api_client/models/create_webhook_response.py index 1155a59e..307dc4df 100644 --- a/src/tower/tower_api_client/models/create_webhook_response.py +++ b/src/tower/tower_api_client/models/create_webhook_response.py @@ -20,8 +20,8 @@ class CreateWebhookResponse: Attributes: signing_key (str): webhook (Webhook): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/CreateWebhookResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CreateWebhookResponse.json. """ signing_key: str diff --git a/src/tower/tower_api_client/models/delete_api_key_params.py b/src/tower/tower_api_client/models/delete_api_key_params.py index bb18e86b..ed8f4576 100644 --- a/src/tower/tower_api_client/models/delete_api_key_params.py +++ b/src/tower/tower_api_client/models/delete_api_key_params.py @@ -15,8 +15,8 @@ class DeleteAPIKeyParams: """ Attributes: identifier (str): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DeleteAPIKeyParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DeleteAPIKeyParams.json. """ identifier: str diff --git a/src/tower/tower_api_client/models/delete_api_key_response.py b/src/tower/tower_api_client/models/delete_api_key_response.py index 5d126a1b..6620c674 100644 --- a/src/tower/tower_api_client/models/delete_api_key_response.py +++ b/src/tower/tower_api_client/models/delete_api_key_response.py @@ -19,8 +19,8 @@ class DeleteAPIKeyResponse: """ Attributes: api_key (APIKey): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DeleteAPIKeyResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DeleteAPIKeyResponse.json. """ api_key: APIKey diff --git a/src/tower/tower_api_client/models/delete_app_response.py b/src/tower/tower_api_client/models/delete_app_response.py index afbcc3bb..b85ab342 100644 --- a/src/tower/tower_api_client/models/delete_app_response.py +++ b/src/tower/tower_api_client/models/delete_app_response.py @@ -19,8 +19,8 @@ class DeleteAppResponse: """ Attributes: app (App): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DeleteAppResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DeleteAppResponse.json. """ app: App diff --git a/src/tower/tower_api_client/models/delete_catalog_response.py b/src/tower/tower_api_client/models/delete_catalog_response.py index 86841b07..296e6813 100644 --- a/src/tower/tower_api_client/models/delete_catalog_response.py +++ b/src/tower/tower_api_client/models/delete_catalog_response.py @@ -19,8 +19,8 @@ class DeleteCatalogResponse: """ Attributes: catalog (Catalog): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DeleteCatalogResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DeleteCatalogResponse.json. """ catalog: Catalog diff --git a/src/tower/tower_api_client/models/delete_guest_output_body.py b/src/tower/tower_api_client/models/delete_guest_output_body.py index 75b6a344..92e6d613 100644 --- a/src/tower/tower_api_client/models/delete_guest_output_body.py +++ b/src/tower/tower_api_client/models/delete_guest_output_body.py @@ -14,8 +14,8 @@ class DeleteGuestOutputBody: """ Attributes: - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DeleteGuestOutputBody.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DeleteGuestOutputBody.json. """ schema: str | Unset = UNSET diff --git a/src/tower/tower_api_client/models/delete_schedule_params.py b/src/tower/tower_api_client/models/delete_schedule_params.py index 63ebb8fe..81b6f2be 100644 --- a/src/tower/tower_api_client/models/delete_schedule_params.py +++ b/src/tower/tower_api_client/models/delete_schedule_params.py @@ -15,8 +15,8 @@ class DeleteScheduleParams: """ Attributes: ids (list[str]): The IDs of the schedules to delete. - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DeleteScheduleParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DeleteScheduleParams.json. """ ids: list[str] diff --git a/src/tower/tower_api_client/models/delete_schedule_response.py b/src/tower/tower_api_client/models/delete_schedule_response.py index c584a75b..9f18199e 100644 --- a/src/tower/tower_api_client/models/delete_schedule_response.py +++ b/src/tower/tower_api_client/models/delete_schedule_response.py @@ -19,8 +19,8 @@ class DeleteScheduleResponse: """ Attributes: schedules (list[Schedule]): the schedules successfully deleted - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DeleteScheduleResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DeleteScheduleResponse.json. """ schedules: list[Schedule] diff --git a/src/tower/tower_api_client/models/delete_secret_response.py b/src/tower/tower_api_client/models/delete_secret_response.py index 035235ef..296708f1 100644 --- a/src/tower/tower_api_client/models/delete_secret_response.py +++ b/src/tower/tower_api_client/models/delete_secret_response.py @@ -19,8 +19,8 @@ class DeleteSecretResponse: """ Attributes: secret (Secret): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DeleteSecretResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DeleteSecretResponse.json. """ secret: Secret diff --git a/src/tower/tower_api_client/models/delete_session_params.py b/src/tower/tower_api_client/models/delete_session_params.py index fdcb7640..a2972c2f 100644 --- a/src/tower/tower_api_client/models/delete_session_params.py +++ b/src/tower/tower_api_client/models/delete_session_params.py @@ -14,8 +14,8 @@ class DeleteSessionParams: """ Attributes: - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DeleteSessionParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DeleteSessionParams.json. session_id (str | Unset): The ID of the session to delete. If not provided, the current session will be deleted. """ diff --git a/src/tower/tower_api_client/models/delete_session_response.py b/src/tower/tower_api_client/models/delete_session_response.py index 0a102077..144f146d 100644 --- a/src/tower/tower_api_client/models/delete_session_response.py +++ b/src/tower/tower_api_client/models/delete_session_response.py @@ -19,8 +19,8 @@ class DeleteSessionResponse: """ Attributes: session (Session): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DeleteSessionResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DeleteSessionResponse.json. """ session: Session diff --git a/src/tower/tower_api_client/models/delete_team_invitation_params.py b/src/tower/tower_api_client/models/delete_team_invitation_params.py index a32368b6..6f380838 100644 --- a/src/tower/tower_api_client/models/delete_team_invitation_params.py +++ b/src/tower/tower_api_client/models/delete_team_invitation_params.py @@ -15,8 +15,8 @@ class DeleteTeamInvitationParams: """ Attributes: email (str): The email address of the team member to remove - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DeleteTeamInvitationParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DeleteTeamInvitationParams.json. """ email: str diff --git a/src/tower/tower_api_client/models/delete_team_invitation_response.py b/src/tower/tower_api_client/models/delete_team_invitation_response.py index cb492f18..50594e98 100644 --- a/src/tower/tower_api_client/models/delete_team_invitation_response.py +++ b/src/tower/tower_api_client/models/delete_team_invitation_response.py @@ -19,8 +19,8 @@ class DeleteTeamInvitationResponse: """ Attributes: invitation (TeamInvitation): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DeleteTeamInvitationResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DeleteTeamInvitationResponse.json. """ invitation: TeamInvitation diff --git a/src/tower/tower_api_client/models/delete_team_params.py b/src/tower/tower_api_client/models/delete_team_params.py index 01ad8f9e..6621caf9 100644 --- a/src/tower/tower_api_client/models/delete_team_params.py +++ b/src/tower/tower_api_client/models/delete_team_params.py @@ -15,8 +15,8 @@ class DeleteTeamParams: """ Attributes: name (str): The name of the team to delete - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DeleteTeamParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DeleteTeamParams.json. """ name: str diff --git a/src/tower/tower_api_client/models/delete_team_response.py b/src/tower/tower_api_client/models/delete_team_response.py index ed76230d..efb2335f 100644 --- a/src/tower/tower_api_client/models/delete_team_response.py +++ b/src/tower/tower_api_client/models/delete_team_response.py @@ -19,8 +19,8 @@ class DeleteTeamResponse: """ Attributes: team (Team): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DeleteTeamResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DeleteTeamResponse.json. """ team: Team diff --git a/src/tower/tower_api_client/models/delete_webhook_response.py b/src/tower/tower_api_client/models/delete_webhook_response.py index 56b13381..f62d5f75 100644 --- a/src/tower/tower_api_client/models/delete_webhook_response.py +++ b/src/tower/tower_api_client/models/delete_webhook_response.py @@ -19,8 +19,8 @@ class DeleteWebhookResponse: """ Attributes: webhook (Webhook): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DeleteWebhookResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DeleteWebhookResponse.json. """ webhook: Webhook diff --git a/src/tower/tower_api_client/models/deploy_app_response.py b/src/tower/tower_api_client/models/deploy_app_response.py index ca4e1400..f79f32b2 100644 --- a/src/tower/tower_api_client/models/deploy_app_response.py +++ b/src/tower/tower_api_client/models/deploy_app_response.py @@ -19,8 +19,8 @@ class DeployAppResponse: """ Attributes: version (AppVersion): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DeployAppResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DeployAppResponse.json. """ version: AppVersion diff --git a/src/tower/tower_api_client/models/describe_account_body.py b/src/tower/tower_api_client/models/describe_account_body.py index 4ebbe0d3..dd52a92e 100644 --- a/src/tower/tower_api_client/models/describe_account_body.py +++ b/src/tower/tower_api_client/models/describe_account_body.py @@ -19,8 +19,8 @@ class DescribeAccountBody: """ Attributes: account (Account): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DescribeAccountBody.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DescribeAccountBody.json. """ account: Account diff --git a/src/tower/tower_api_client/models/describe_app_response.py b/src/tower/tower_api_client/models/describe_app_response.py index 8126dc8e..6609f92d 100644 --- a/src/tower/tower_api_client/models/describe_app_response.py +++ b/src/tower/tower_api_client/models/describe_app_response.py @@ -21,8 +21,8 @@ class DescribeAppResponse: Attributes: app (App): runs (list[Run]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DescribeAppResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DescribeAppResponse.json. """ app: App diff --git a/src/tower/tower_api_client/models/describe_app_version_response.py b/src/tower/tower_api_client/models/describe_app_version_response.py index 917a68d7..a073e3e5 100644 --- a/src/tower/tower_api_client/models/describe_app_version_response.py +++ b/src/tower/tower_api_client/models/describe_app_version_response.py @@ -19,8 +19,8 @@ class DescribeAppVersionResponse: """ Attributes: version (AppVersion): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DescribeAppVersionResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DescribeAppVersionResponse.json. """ version: AppVersion diff --git a/src/tower/tower_api_client/models/describe_authentication_context_body.py b/src/tower/tower_api_client/models/describe_authentication_context_body.py index 222638ad..b0e5b414 100644 --- a/src/tower/tower_api_client/models/describe_authentication_context_body.py +++ b/src/tower/tower_api_client/models/describe_authentication_context_body.py @@ -19,8 +19,8 @@ class DescribeAuthenticationContextBody: """ Attributes: authentication_context (AuthenticationContext): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DescribeAuthenticationContextBody.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DescribeAuthenticationContextBody.json. """ authentication_context: AuthenticationContext diff --git a/src/tower/tower_api_client/models/describe_catalog_response.py b/src/tower/tower_api_client/models/describe_catalog_response.py index 2649d4ed..a4ff7be9 100644 --- a/src/tower/tower_api_client/models/describe_catalog_response.py +++ b/src/tower/tower_api_client/models/describe_catalog_response.py @@ -19,8 +19,8 @@ class DescribeCatalogResponse: """ Attributes: catalog (Catalog): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DescribeCatalogResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DescribeCatalogResponse.json. """ catalog: Catalog diff --git a/src/tower/tower_api_client/models/describe_device_login_session_response.py b/src/tower/tower_api_client/models/describe_device_login_session_response.py index ae4492bd..807a7cd0 100644 --- a/src/tower/tower_api_client/models/describe_device_login_session_response.py +++ b/src/tower/tower_api_client/models/describe_device_login_session_response.py @@ -19,8 +19,8 @@ class DescribeDeviceLoginSessionResponse: """ Attributes: session (Session): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DescribeDeviceLoginSessionResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DescribeDeviceLoginSessionResponse.json. """ session: Session diff --git a/src/tower/tower_api_client/models/describe_email_preferences_body.py b/src/tower/tower_api_client/models/describe_email_preferences_body.py index 20c97dda..9c554994 100644 --- a/src/tower/tower_api_client/models/describe_email_preferences_body.py +++ b/src/tower/tower_api_client/models/describe_email_preferences_body.py @@ -19,8 +19,8 @@ class DescribeEmailPreferencesBody: """ Attributes: subscriptions (EmailSubscriptions): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DescribeEmailPreferencesBody.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DescribeEmailPreferencesBody.json. """ subscriptions: EmailSubscriptions diff --git a/src/tower/tower_api_client/models/describe_plan_response.py b/src/tower/tower_api_client/models/describe_plan_response.py index 32bb942a..3b6e8416 100644 --- a/src/tower/tower_api_client/models/describe_plan_response.py +++ b/src/tower/tower_api_client/models/describe_plan_response.py @@ -19,8 +19,8 @@ class DescribePlanResponse: """ Attributes: plan (Plan): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DescribePlanResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DescribePlanResponse.json. """ plan: Plan diff --git a/src/tower/tower_api_client/models/describe_run_graph_response.py b/src/tower/tower_api_client/models/describe_run_graph_response.py index a93b0a78..2f3d3230 100644 --- a/src/tower/tower_api_client/models/describe_run_graph_response.py +++ b/src/tower/tower_api_client/models/describe_run_graph_response.py @@ -19,8 +19,8 @@ class DescribeRunGraphResponse: """ Attributes: runs (list[RunGraphNode]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DescribeRunGraphResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DescribeRunGraphResponse.json. """ runs: list[RunGraphNode] diff --git a/src/tower/tower_api_client/models/describe_run_logs_response.py b/src/tower/tower_api_client/models/describe_run_logs_response.py index 97fccf35..9140272f 100644 --- a/src/tower/tower_api_client/models/describe_run_logs_response.py +++ b/src/tower/tower_api_client/models/describe_run_logs_response.py @@ -19,8 +19,8 @@ class DescribeRunLogsResponse: """ Attributes: log_lines (list[RunLogLine]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DescribeRunLogsResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DescribeRunLogsResponse.json. """ log_lines: list[RunLogLine] diff --git a/src/tower/tower_api_client/models/describe_run_response.py b/src/tower/tower_api_client/models/describe_run_response.py index 2cb66487..eb1a0fa8 100644 --- a/src/tower/tower_api_client/models/describe_run_response.py +++ b/src/tower/tower_api_client/models/describe_run_response.py @@ -21,8 +21,8 @@ class DescribeRunResponse: Attributes: links (DescribeRunLinks): run (Run): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DescribeRunResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DescribeRunResponse.json. """ links: DescribeRunLinks diff --git a/src/tower/tower_api_client/models/describe_secrets_key_response.py b/src/tower/tower_api_client/models/describe_secrets_key_response.py index dee9b03c..855a4cdd 100644 --- a/src/tower/tower_api_client/models/describe_secrets_key_response.py +++ b/src/tower/tower_api_client/models/describe_secrets_key_response.py @@ -15,8 +15,8 @@ class DescribeSecretsKeyResponse: """ Attributes: public_key (str): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DescribeSecretsKeyResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DescribeSecretsKeyResponse.json. """ public_key: str diff --git a/src/tower/tower_api_client/models/describe_session_response.py b/src/tower/tower_api_client/models/describe_session_response.py index 95997b8d..132b2c0b 100644 --- a/src/tower/tower_api_client/models/describe_session_response.py +++ b/src/tower/tower_api_client/models/describe_session_response.py @@ -19,8 +19,8 @@ class DescribeSessionResponse: """ Attributes: session (Session): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DescribeSessionResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DescribeSessionResponse.json. """ session: Session diff --git a/src/tower/tower_api_client/models/describe_team_response.py b/src/tower/tower_api_client/models/describe_team_response.py index ac89f1b3..1d065bef 100644 --- a/src/tower/tower_api_client/models/describe_team_response.py +++ b/src/tower/tower_api_client/models/describe_team_response.py @@ -23,8 +23,8 @@ class DescribeTeamResponse: invitations (list[TeamInvitation]): Pending team invitations members (list[User]): The members of the team team (Team): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DescribeTeamResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DescribeTeamResponse.json. """ invitations: list[TeamInvitation] diff --git a/src/tower/tower_api_client/models/describe_webhook_response.py b/src/tower/tower_api_client/models/describe_webhook_response.py index 0467bf0c..0d34a83e 100644 --- a/src/tower/tower_api_client/models/describe_webhook_response.py +++ b/src/tower/tower_api_client/models/describe_webhook_response.py @@ -19,8 +19,8 @@ class DescribeWebhookResponse: """ Attributes: webhook (Webhook): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/DescribeWebhookResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DescribeWebhookResponse.json. """ webhook: Webhook diff --git a/src/tower/tower_api_client/models/error_model.py b/src/tower/tower_api_client/models/error_model.py index 9cc7e12d..64710047 100644 --- a/src/tower/tower_api_client/models/error_model.py +++ b/src/tower/tower_api_client/models/error_model.py @@ -18,8 +18,8 @@ class ErrorModel: """ Attributes: - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/ErrorModel.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ErrorModel.json. detail (str | Unset): A human-readable explanation specific to this occurrence of the problem. Example: Property foo is required but is missing.. errors (list[ErrorDetail] | Unset): Optional list of individual error details diff --git a/src/tower/tower_api_client/models/export_catalogs_params.py b/src/tower/tower_api_client/models/export_catalogs_params.py index 39fccb5c..8183ce47 100644 --- a/src/tower/tower_api_client/models/export_catalogs_params.py +++ b/src/tower/tower_api_client/models/export_catalogs_params.py @@ -19,8 +19,8 @@ class ExportCatalogsParams: page (int): The page number to fetch. Default: 1. page_size (int): The number of records to fetch on each page. Default: 20. public_key (str): The PEM-encoded public key you want to use to encrypt sensitive catalog properties. - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/ExportCatalogsParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ExportCatalogsParams.json. """ public_key: str diff --git a/src/tower/tower_api_client/models/export_catalogs_response.py b/src/tower/tower_api_client/models/export_catalogs_response.py index 70242dc1..967665bf 100644 --- a/src/tower/tower_api_client/models/export_catalogs_response.py +++ b/src/tower/tower_api_client/models/export_catalogs_response.py @@ -21,8 +21,8 @@ class ExportCatalogsResponse: Attributes: catalogs (list[ExportedCatalog]): pages (Pagination): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/ExportCatalogsResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ExportCatalogsResponse.json. """ catalogs: list[ExportedCatalog] diff --git a/src/tower/tower_api_client/models/export_secrets_params.py b/src/tower/tower_api_client/models/export_secrets_params.py index ce797c76..a4ffbedc 100644 --- a/src/tower/tower_api_client/models/export_secrets_params.py +++ b/src/tower/tower_api_client/models/export_secrets_params.py @@ -19,8 +19,8 @@ class ExportSecretsParams: page (int): The page number to fetch. Default: 1. page_size (int): The number of records to fetch on each page. Default: 20. public_key (str): The PEM-encoded public key you want to use to encrypt sensitive secret values. - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/ExportSecretsParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ExportSecretsParams.json. """ public_key: str diff --git a/src/tower/tower_api_client/models/export_secrets_response.py b/src/tower/tower_api_client/models/export_secrets_response.py index 960846e1..7002e11e 100644 --- a/src/tower/tower_api_client/models/export_secrets_response.py +++ b/src/tower/tower_api_client/models/export_secrets_response.py @@ -21,8 +21,8 @@ class ExportSecretsResponse: Attributes: pages (Pagination): secrets (list[ExportedSecret]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/ExportSecretsResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ExportSecretsResponse.json. """ pages: Pagination diff --git a/src/tower/tower_api_client/models/generate_app_statistics_response.py b/src/tower/tower_api_client/models/generate_app_statistics_response.py index ecfca9f5..175f6ed0 100644 --- a/src/tower/tower_api_client/models/generate_app_statistics_response.py +++ b/src/tower/tower_api_client/models/generate_app_statistics_response.py @@ -19,8 +19,8 @@ class GenerateAppStatisticsResponse: """ Attributes: statistics (AppStatistics): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/GenerateAppStatisticsResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/GenerateAppStatisticsResponse.json. """ statistics: AppStatistics diff --git a/src/tower/tower_api_client/models/generate_organization_usage_time_series_response.py b/src/tower/tower_api_client/models/generate_organization_usage_time_series_response.py index 72d5a040..eb71c6a8 100644 --- a/src/tower/tower_api_client/models/generate_organization_usage_time_series_response.py +++ b/src/tower/tower_api_client/models/generate_organization_usage_time_series_response.py @@ -19,8 +19,8 @@ class GenerateOrganizationUsageTimeSeriesResponse: """ Attributes: series (list[UsageMetricTimeSeriesPoint]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/GenerateOrganizationUsageTimeSeriesResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/GenerateOrganizationUsageTimeSeriesResponse.json. """ series: list[UsageMetricTimeSeriesPoint] diff --git a/src/tower/tower_api_client/models/generate_run_statistics_response.py b/src/tower/tower_api_client/models/generate_run_statistics_response.py index 3224b33f..babee7b8 100644 --- a/src/tower/tower_api_client/models/generate_run_statistics_response.py +++ b/src/tower/tower_api_client/models/generate_run_statistics_response.py @@ -23,8 +23,8 @@ class GenerateRunStatisticsResponse: series (list[RunTimeseriesPoint]): settings (StatisticsSettings): stats (RunStatistics): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/GenerateRunStatisticsResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/GenerateRunStatisticsResponse.json. """ series: list[RunTimeseriesPoint] diff --git a/src/tower/tower_api_client/models/generate_runner_credentials_response.py b/src/tower/tower_api_client/models/generate_runner_credentials_response.py index 9a968308..f00c2ac3 100644 --- a/src/tower/tower_api_client/models/generate_runner_credentials_response.py +++ b/src/tower/tower_api_client/models/generate_runner_credentials_response.py @@ -19,8 +19,8 @@ class GenerateRunnerCredentialsResponse: """ Attributes: credentials (RunnerCredentials): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/GenerateRunnerCredentialsResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/GenerateRunnerCredentialsResponse.json. """ credentials: RunnerCredentials diff --git a/src/tower/tower_api_client/models/get_feature_flag_response_body.py b/src/tower/tower_api_client/models/get_feature_flag_response_body.py index 585f1db2..6dbae81b 100644 --- a/src/tower/tower_api_client/models/get_feature_flag_response_body.py +++ b/src/tower/tower_api_client/models/get_feature_flag_response_body.py @@ -21,8 +21,8 @@ class GetFeatureFlagResponseBody: key (str): The feature flag key value (Any): The flag value (type depends on value_type) value_type (GetFeatureFlagResponseBodyValueType): The type of the value - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/GetFeatureFlagResponseBody.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/GetFeatureFlagResponseBody.json. """ enabled: bool diff --git a/src/tower/tower_api_client/models/invite_team_member_params.py b/src/tower/tower_api_client/models/invite_team_member_params.py index 2eb7b30b..7d651150 100644 --- a/src/tower/tower_api_client/models/invite_team_member_params.py +++ b/src/tower/tower_api_client/models/invite_team_member_params.py @@ -19,8 +19,8 @@ class InviteTeamMemberParams: newline separated, etc.) and it will be parsed into individual addresses role (InviteTeamMemberParamsRole): The role to assign to the invitations Default: InviteTeamMemberParamsRole.DEVELOPER. - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/InviteTeamMemberParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/InviteTeamMemberParams.json. message (str | Unset): Optional message to include in the invite email """ diff --git a/src/tower/tower_api_client/models/invite_team_member_response.py b/src/tower/tower_api_client/models/invite_team_member_response.py index 8535d83a..8e2faf3e 100644 --- a/src/tower/tower_api_client/models/invite_team_member_response.py +++ b/src/tower/tower_api_client/models/invite_team_member_response.py @@ -19,8 +19,8 @@ class InviteTeamMemberResponse: """ Attributes: team_invitations (list[TeamInvitation]): The team invitation that you created - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/InviteTeamMemberResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/InviteTeamMemberResponse.json. """ team_invitations: list[TeamInvitation] diff --git a/src/tower/tower_api_client/models/leave_team_response.py b/src/tower/tower_api_client/models/leave_team_response.py index 85ec9246..381a9b26 100644 --- a/src/tower/tower_api_client/models/leave_team_response.py +++ b/src/tower/tower_api_client/models/leave_team_response.py @@ -19,8 +19,8 @@ class LeaveTeamResponse: """ Attributes: team (Team): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/LeaveTeamResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/LeaveTeamResponse.json. """ team: Team diff --git a/src/tower/tower_api_client/models/list_alerts_response.py b/src/tower/tower_api_client/models/list_alerts_response.py index 5b2ea4d9..d08e0e19 100644 --- a/src/tower/tower_api_client/models/list_alerts_response.py +++ b/src/tower/tower_api_client/models/list_alerts_response.py @@ -21,8 +21,8 @@ class ListAlertsResponse: Attributes: alerts (list[Alert]): List of alerts pages (Pagination): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/ListAlertsResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ListAlertsResponse.json. """ alerts: list[Alert] diff --git a/src/tower/tower_api_client/models/list_api_keys_response.py b/src/tower/tower_api_client/models/list_api_keys_response.py index 17522d1b..9ae9a7e6 100644 --- a/src/tower/tower_api_client/models/list_api_keys_response.py +++ b/src/tower/tower_api_client/models/list_api_keys_response.py @@ -21,8 +21,8 @@ class ListAPIKeysResponse: Attributes: api_keys (list[APIKey]): List of API keys pages (Pagination): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/ListAPIKeysResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ListAPIKeysResponse.json. """ api_keys: list[APIKey] diff --git a/src/tower/tower_api_client/models/list_app_environments_response.py b/src/tower/tower_api_client/models/list_app_environments_response.py index 8ce1020e..6eacb692 100644 --- a/src/tower/tower_api_client/models/list_app_environments_response.py +++ b/src/tower/tower_api_client/models/list_app_environments_response.py @@ -15,8 +15,8 @@ class ListAppEnvironmentsResponse: """ Attributes: environments (list[str]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/ListAppEnvironmentsResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ListAppEnvironmentsResponse.json. """ environments: list[str] diff --git a/src/tower/tower_api_client/models/list_app_versions_response.py b/src/tower/tower_api_client/models/list_app_versions_response.py index 37be4742..28013c23 100644 --- a/src/tower/tower_api_client/models/list_app_versions_response.py +++ b/src/tower/tower_api_client/models/list_app_versions_response.py @@ -19,8 +19,8 @@ class ListAppVersionsResponse: """ Attributes: versions (list[AppVersion]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/ListAppVersionsResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ListAppVersionsResponse.json. """ versions: list[AppVersion] diff --git a/src/tower/tower_api_client/models/list_apps_response.py b/src/tower/tower_api_client/models/list_apps_response.py index 28da64ab..6804cec0 100644 --- a/src/tower/tower_api_client/models/list_apps_response.py +++ b/src/tower/tower_api_client/models/list_apps_response.py @@ -21,8 +21,8 @@ class ListAppsResponse: Attributes: apps (list[AppSummary]): pages (Pagination): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/ListAppsResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ListAppsResponse.json. """ apps: list[AppSummary] diff --git a/src/tower/tower_api_client/models/list_catalogs_response.py b/src/tower/tower_api_client/models/list_catalogs_response.py index 04518938..53e12797 100644 --- a/src/tower/tower_api_client/models/list_catalogs_response.py +++ b/src/tower/tower_api_client/models/list_catalogs_response.py @@ -21,8 +21,8 @@ class ListCatalogsResponse: Attributes: catalogs (list[Catalog]): pages (Pagination): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/ListCatalogsResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ListCatalogsResponse.json. """ catalogs: list[Catalog] diff --git a/src/tower/tower_api_client/models/list_environments_response.py b/src/tower/tower_api_client/models/list_environments_response.py index 73feff5e..0078a00f 100644 --- a/src/tower/tower_api_client/models/list_environments_response.py +++ b/src/tower/tower_api_client/models/list_environments_response.py @@ -21,8 +21,8 @@ class ListEnvironmentsResponse: Attributes: environments (list[Environment]): pages (Pagination): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/ListEnvironmentsResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ListEnvironmentsResponse.json. """ environments: list[Environment] diff --git a/src/tower/tower_api_client/models/list_guests_response.py b/src/tower/tower_api_client/models/list_guests_response.py index 93fb1221..d574a7cb 100644 --- a/src/tower/tower_api_client/models/list_guests_response.py +++ b/src/tower/tower_api_client/models/list_guests_response.py @@ -19,8 +19,8 @@ class ListGuestsResponse: """ Attributes: guests (list[Guest]): List of guests. - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/ListGuestsResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ListGuestsResponse.json. """ guests: list[Guest] diff --git a/src/tower/tower_api_client/models/list_my_team_invitations_response.py b/src/tower/tower_api_client/models/list_my_team_invitations_response.py index b6fc1a80..3723ec83 100644 --- a/src/tower/tower_api_client/models/list_my_team_invitations_response.py +++ b/src/tower/tower_api_client/models/list_my_team_invitations_response.py @@ -19,8 +19,8 @@ class ListMyTeamInvitationsResponse: """ Attributes: team_invitations (list[TeamInvitation]): All of team invitations - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/ListMyTeamInvitationsResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ListMyTeamInvitationsResponse.json. """ team_invitations: list[TeamInvitation] diff --git a/src/tower/tower_api_client/models/list_runners_response.py b/src/tower/tower_api_client/models/list_runners_response.py index fc85d748..dfb1be95 100644 --- a/src/tower/tower_api_client/models/list_runners_response.py +++ b/src/tower/tower_api_client/models/list_runners_response.py @@ -21,8 +21,8 @@ class ListRunnersResponse: Attributes: pages (Pagination): runners (list[Runner]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/ListRunnersResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ListRunnersResponse.json. """ pages: Pagination diff --git a/src/tower/tower_api_client/models/list_runs_response.py b/src/tower/tower_api_client/models/list_runs_response.py index 75be46f1..a58100a0 100644 --- a/src/tower/tower_api_client/models/list_runs_response.py +++ b/src/tower/tower_api_client/models/list_runs_response.py @@ -21,8 +21,8 @@ class ListRunsResponse: Attributes: pages (Pagination): runs (list[Run]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/ListRunsResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ListRunsResponse.json. """ pages: Pagination diff --git a/src/tower/tower_api_client/models/list_schedules_response.py b/src/tower/tower_api_client/models/list_schedules_response.py index 7670394f..766adbae 100644 --- a/src/tower/tower_api_client/models/list_schedules_response.py +++ b/src/tower/tower_api_client/models/list_schedules_response.py @@ -21,8 +21,8 @@ class ListSchedulesResponse: Attributes: pages (Pagination): schedules (list[Schedule]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/ListSchedulesResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ListSchedulesResponse.json. """ pages: Pagination diff --git a/src/tower/tower_api_client/models/list_secret_environments_response.py b/src/tower/tower_api_client/models/list_secret_environments_response.py index 799a78eb..0b44f822 100644 --- a/src/tower/tower_api_client/models/list_secret_environments_response.py +++ b/src/tower/tower_api_client/models/list_secret_environments_response.py @@ -15,8 +15,8 @@ class ListSecretEnvironmentsResponse: """ Attributes: environments (list[str]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/ListSecretEnvironmentsResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ListSecretEnvironmentsResponse.json. """ environments: list[str] diff --git a/src/tower/tower_api_client/models/list_secrets_response.py b/src/tower/tower_api_client/models/list_secrets_response.py index d1a299ec..04fac0e7 100644 --- a/src/tower/tower_api_client/models/list_secrets_response.py +++ b/src/tower/tower_api_client/models/list_secrets_response.py @@ -21,8 +21,8 @@ class ListSecretsResponse: Attributes: pages (Pagination): secrets (list[Secret]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/ListSecretsResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ListSecretsResponse.json. """ pages: Pagination diff --git a/src/tower/tower_api_client/models/list_team_invitations_response.py b/src/tower/tower_api_client/models/list_team_invitations_response.py index 0fd34e11..52846ca3 100644 --- a/src/tower/tower_api_client/models/list_team_invitations_response.py +++ b/src/tower/tower_api_client/models/list_team_invitations_response.py @@ -19,8 +19,8 @@ class ListTeamInvitationsResponse: """ Attributes: team_invitations (list[TeamInvitation]): All of team invitations - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/ListTeamInvitationsResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ListTeamInvitationsResponse.json. """ team_invitations: list[TeamInvitation] diff --git a/src/tower/tower_api_client/models/list_team_members_response.py b/src/tower/tower_api_client/models/list_team_members_response.py index c20150f2..7c5921be 100644 --- a/src/tower/tower_api_client/models/list_team_members_response.py +++ b/src/tower/tower_api_client/models/list_team_members_response.py @@ -19,8 +19,8 @@ class ListTeamMembersResponse: """ Attributes: team_members (list[TeamMembership]): All of the members of a team - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/ListTeamMembersResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ListTeamMembersResponse.json. """ team_members: list[TeamMembership] diff --git a/src/tower/tower_api_client/models/list_teams_response.py b/src/tower/tower_api_client/models/list_teams_response.py index 961554d6..bff5edee 100644 --- a/src/tower/tower_api_client/models/list_teams_response.py +++ b/src/tower/tower_api_client/models/list_teams_response.py @@ -21,8 +21,8 @@ class ListTeamsResponse: Attributes: pages (Pagination): teams (list[Team]): List of teams - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/ListTeamsResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ListTeamsResponse.json. """ pages: Pagination diff --git a/src/tower/tower_api_client/models/list_webhooks_response.py b/src/tower/tower_api_client/models/list_webhooks_response.py index c6e55a66..b10e5c4e 100644 --- a/src/tower/tower_api_client/models/list_webhooks_response.py +++ b/src/tower/tower_api_client/models/list_webhooks_response.py @@ -21,8 +21,8 @@ class ListWebhooksResponse: Attributes: pages (Pagination): webhooks (list[Webhook]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/ListWebhooksResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ListWebhooksResponse.json. """ pages: Pagination diff --git a/src/tower/tower_api_client/models/organization_usage.py b/src/tower/tower_api_client/models/organization_usage.py index a1d98ca3..74bda4e3 100644 --- a/src/tower/tower_api_client/models/organization_usage.py +++ b/src/tower/tower_api_client/models/organization_usage.py @@ -25,8 +25,8 @@ class OrganizationUsage: members (UsageLimit): organization_name (str): The name of the organization. self_hosted_runners (UsageLimit): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/OrganizationUsage.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/OrganizationUsage.json. """ active_schedules: UsageLimit diff --git a/src/tower/tower_api_client/models/refresh_session_params.py b/src/tower/tower_api_client/models/refresh_session_params.py index eda44ee8..bbf86d5f 100644 --- a/src/tower/tower_api_client/models/refresh_session_params.py +++ b/src/tower/tower_api_client/models/refresh_session_params.py @@ -14,8 +14,8 @@ class RefreshSessionParams: """ Attributes: - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/RefreshSessionParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/RefreshSessionParams.json. refresh_token (str | Unset): The refresh token associated with the session to refresh. """ diff --git a/src/tower/tower_api_client/models/refresh_session_response.py b/src/tower/tower_api_client/models/refresh_session_response.py index 6a89f6f6..f694faa8 100644 --- a/src/tower/tower_api_client/models/refresh_session_response.py +++ b/src/tower/tower_api_client/models/refresh_session_response.py @@ -22,8 +22,8 @@ class RefreshSessionResponse: Attributes: refreshed_at (datetime.datetime): A timestamp that indicates the last time the session data was refreshed. session (Session): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/RefreshSessionResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/RefreshSessionResponse.json. """ refreshed_at: datetime.datetime diff --git a/src/tower/tower_api_client/models/regenerate_guest_login_url_params.py b/src/tower/tower_api_client/models/regenerate_guest_login_url_params.py index 19df8977..7d8caf40 100644 --- a/src/tower/tower_api_client/models/regenerate_guest_login_url_params.py +++ b/src/tower/tower_api_client/models/regenerate_guest_login_url_params.py @@ -14,8 +14,8 @@ class RegenerateGuestLoginURLParams: """ Attributes: - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/RegenerateGuestLoginURLParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/RegenerateGuestLoginURLParams.json. expires_in (int | Unset): The number of seconds the guest session should last. Defaults to 72 hours. Default: 259200. redirect_url (str | Unset): Where to redirect the guest after they log in. diff --git a/src/tower/tower_api_client/models/regenerate_guest_login_url_response.py b/src/tower/tower_api_client/models/regenerate_guest_login_url_response.py index e88cb120..062f0623 100644 --- a/src/tower/tower_api_client/models/regenerate_guest_login_url_response.py +++ b/src/tower/tower_api_client/models/regenerate_guest_login_url_response.py @@ -18,8 +18,8 @@ class RegenerateGuestLoginURLResponse: Attributes: login_url (str): The new login URL to share with the guest. login_url_expires_at (datetime.datetime): When the login URL expires. - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/RegenerateGuestLoginURLResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/RegenerateGuestLoginURLResponse.json. """ login_url: str diff --git a/src/tower/tower_api_client/models/remove_team_member_params.py b/src/tower/tower_api_client/models/remove_team_member_params.py index b852edc7..4f2cebfc 100644 --- a/src/tower/tower_api_client/models/remove_team_member_params.py +++ b/src/tower/tower_api_client/models/remove_team_member_params.py @@ -15,8 +15,8 @@ class RemoveTeamMemberParams: """ Attributes: email (str): The email address of the team member to remove - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/RemoveTeamMemberParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/RemoveTeamMemberParams.json. """ email: str diff --git a/src/tower/tower_api_client/models/remove_team_member_response.py b/src/tower/tower_api_client/models/remove_team_member_response.py index cbcb1551..bfc98bcd 100644 --- a/src/tower/tower_api_client/models/remove_team_member_response.py +++ b/src/tower/tower_api_client/models/remove_team_member_response.py @@ -19,8 +19,8 @@ class RemoveTeamMemberResponse: """ Attributes: team_member (User): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/RemoveTeamMemberResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/RemoveTeamMemberResponse.json. """ team_member: User diff --git a/src/tower/tower_api_client/models/resend_team_invitation_params.py b/src/tower/tower_api_client/models/resend_team_invitation_params.py index 3a9db89e..66142e9e 100644 --- a/src/tower/tower_api_client/models/resend_team_invitation_params.py +++ b/src/tower/tower_api_client/models/resend_team_invitation_params.py @@ -15,8 +15,8 @@ class ResendTeamInvitationParams: """ Attributes: email (str): The email address of team invitation to resend - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/ResendTeamInvitationParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ResendTeamInvitationParams.json. message (str | Unset): Optional message to include in the invite email """ diff --git a/src/tower/tower_api_client/models/resend_team_invitation_response.py b/src/tower/tower_api_client/models/resend_team_invitation_response.py index 4f7bf899..6821b60a 100644 --- a/src/tower/tower_api_client/models/resend_team_invitation_response.py +++ b/src/tower/tower_api_client/models/resend_team_invitation_response.py @@ -19,8 +19,8 @@ class ResendTeamInvitationResponse: """ Attributes: team_invitation (TeamInvitation): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/ResendTeamInvitationResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ResendTeamInvitationResponse.json. """ team_invitation: TeamInvitation diff --git a/src/tower/tower_api_client/models/run_app_params.py b/src/tower/tower_api_client/models/run_app_params.py index f403796f..943b4a12 100644 --- a/src/tower/tower_api_client/models/run_app_params.py +++ b/src/tower/tower_api_client/models/run_app_params.py @@ -22,8 +22,8 @@ class RunAppParams: Attributes: environment (str): The environment to run this app in. parameters (RunAppParamsParameters): The parameters to pass into this app. - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/RunAppParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/RunAppParams.json. initiator (RunAppInitiatorData | Unset): parent_run_id (None | str | Unset): The ID of the run that invoked this run, if relevant. Should be null, if none. diff --git a/src/tower/tower_api_client/models/run_app_response.py b/src/tower/tower_api_client/models/run_app_response.py index 87686714..ae1464b6 100644 --- a/src/tower/tower_api_client/models/run_app_response.py +++ b/src/tower/tower_api_client/models/run_app_response.py @@ -19,8 +19,8 @@ class RunAppResponse: """ Attributes: run (Run): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/RunAppResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/RunAppResponse.json. """ run: Run diff --git a/src/tower/tower_api_client/models/run_parameter.py b/src/tower/tower_api_client/models/run_parameter.py index b58232f3..6d805c9b 100644 --- a/src/tower/tower_api_client/models/run_parameter.py +++ b/src/tower/tower_api_client/models/run_parameter.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -14,57 +14,69 @@ class RunParameter: """ Attributes: - is_override (bool): Whether this parameter's value was supplied as an override at run/schedule creation time - (true) or comes from the app version's default (false). Default: False. name (str): value (str): hidden (bool | Unset): Whether this parameter is hidden/secret. Defaults to false. Default: False. + is_override (bool | None | Unset): Whether this parameter's value was supplied as an override at run/schedule + creation time (true) or comes from the app version's default (false). """ name: str value: str - is_override: bool = False hidden: bool | Unset = False + is_override: bool | None | Unset = UNSET def to_dict(self) -> dict[str, Any]: - is_override = self.is_override - name = self.name value = self.value hidden = self.hidden + is_override: bool | None | Unset + if isinstance(self.is_override, Unset): + is_override = UNSET + else: + is_override = self.is_override + field_dict: dict[str, Any] = {} field_dict.update( { - "is_override": is_override, "name": name, "value": value, } ) if hidden is not UNSET: field_dict["hidden"] = hidden + if is_override is not UNSET: + field_dict["is_override"] = is_override return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - is_override = d.pop("is_override") - name = d.pop("name") value = d.pop("value") hidden = d.pop("hidden", UNSET) + def _parse_is_override(data: object) -> bool | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(bool | None | Unset, data) + + is_override = _parse_is_override(d.pop("is_override", UNSET)) + run_parameter = cls( - is_override=is_override, name=name, value=value, hidden=hidden, + is_override=is_override, ) return run_parameter diff --git a/src/tower/tower_api_client/models/run_parameter_input.py b/src/tower/tower_api_client/models/run_parameter_input.py deleted file mode 100644 index ee6b3028..00000000 --- a/src/tower/tower_api_client/models/run_parameter_input.py +++ /dev/null @@ -1,61 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="RunParameterInput") - - -@_attrs_define -class RunParameterInput: - """ - Attributes: - name (str): - value (str): - hidden (bool | Unset): Whether this parameter is hidden/secret. Defaults to false. Default: False. - """ - - name: str - value: str - hidden: bool | Unset = False - - def to_dict(self) -> dict[str, Any]: - name = self.name - - value = self.value - - hidden = self.hidden - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "name": name, - "value": value, - } - ) - if hidden is not UNSET: - field_dict["hidden"] = hidden - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - name = d.pop("name") - - value = d.pop("value") - - hidden = d.pop("hidden", UNSET) - - run_parameter_input = cls( - name=name, - value=value, - hidden=hidden, - ) - - return run_parameter_input diff --git a/src/tower/tower_api_client/models/search_runs_response.py b/src/tower/tower_api_client/models/search_runs_response.py index 978416c3..365ae75c 100644 --- a/src/tower/tower_api_client/models/search_runs_response.py +++ b/src/tower/tower_api_client/models/search_runs_response.py @@ -21,8 +21,8 @@ class SearchRunsResponse: Attributes: pages (Pagination): runs (list[Run]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/SearchRunsResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/SearchRunsResponse.json. """ pages: Pagination diff --git a/src/tower/tower_api_client/models/test_webhook_response.py b/src/tower/tower_api_client/models/test_webhook_response.py index 687ac6b7..fc269b07 100644 --- a/src/tower/tower_api_client/models/test_webhook_response.py +++ b/src/tower/tower_api_client/models/test_webhook_response.py @@ -19,8 +19,8 @@ class TestWebhookResponse: """ Attributes: webhook (Webhook): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/TestWebhookResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/TestWebhookResponse.json. """ webhook: Webhook diff --git a/src/tower/tower_api_client/models/update_account_params.py b/src/tower/tower_api_client/models/update_account_params.py index 6e51da42..d59cdf63 100644 --- a/src/tower/tower_api_client/models/update_account_params.py +++ b/src/tower/tower_api_client/models/update_account_params.py @@ -17,8 +17,8 @@ class UpdateAccountParams: """ Attributes: - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/UpdateAccountParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateAccountParams.json. execution_region (UpdateAccountParamsExecutionRegion | Unset): The execution region for runs (eu-central-1 or us-east-1) is_self_hosted_only (bool | Unset): Whether the account is for self-hosted use only diff --git a/src/tower/tower_api_client/models/update_account_response.py b/src/tower/tower_api_client/models/update_account_response.py index a3fa5875..df301652 100644 --- a/src/tower/tower_api_client/models/update_account_response.py +++ b/src/tower/tower_api_client/models/update_account_response.py @@ -19,8 +19,8 @@ class UpdateAccountResponse: """ Attributes: account (Account): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/UpdateAccountResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateAccountResponse.json. """ account: Account diff --git a/src/tower/tower_api_client/models/update_app_environment_params.py b/src/tower/tower_api_client/models/update_app_environment_params.py index 26f09c97..14fc1f28 100644 --- a/src/tower/tower_api_client/models/update_app_environment_params.py +++ b/src/tower/tower_api_client/models/update_app_environment_params.py @@ -15,8 +15,8 @@ class UpdateAppEnvironmentParams: """ Attributes: version (str): The version to deploy to this environment, e.g. 'v1', 'v2'. - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/UpdateAppEnvironmentParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateAppEnvironmentParams.json. """ version: str diff --git a/src/tower/tower_api_client/models/update_app_environment_response.py b/src/tower/tower_api_client/models/update_app_environment_response.py index f0432792..a64310e4 100644 --- a/src/tower/tower_api_client/models/update_app_environment_response.py +++ b/src/tower/tower_api_client/models/update_app_environment_response.py @@ -16,8 +16,8 @@ class UpdateAppEnvironmentResponse: Attributes: environment (str): version (str): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/UpdateAppEnvironmentResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateAppEnvironmentResponse.json. """ environment: str diff --git a/src/tower/tower_api_client/models/update_app_params.py b/src/tower/tower_api_client/models/update_app_params.py index c1d71216..c970dfd0 100644 --- a/src/tower/tower_api_client/models/update_app_params.py +++ b/src/tower/tower_api_client/models/update_app_params.py @@ -18,8 +18,8 @@ class UpdateAppParams: """ Attributes: - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/UpdateAppParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateAppParams.json. description (None | str | Unset): New description for the App is_externally_accessible (bool | None | Unset): Indicates that web traffic should be routed to this app and that its runs should get a hostname assigned to it. diff --git a/src/tower/tower_api_client/models/update_app_response.py b/src/tower/tower_api_client/models/update_app_response.py index 2cc99f8f..d5d9817d 100644 --- a/src/tower/tower_api_client/models/update_app_response.py +++ b/src/tower/tower_api_client/models/update_app_response.py @@ -20,8 +20,8 @@ class UpdateAppResponse: Attributes: App (App): app (App): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/UpdateAppResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateAppResponse.json. """ App: App diff --git a/src/tower/tower_api_client/models/update_catalog_params.py b/src/tower/tower_api_client/models/update_catalog_params.py index 7df04285..673099c9 100644 --- a/src/tower/tower_api_client/models/update_catalog_params.py +++ b/src/tower/tower_api_client/models/update_catalog_params.py @@ -20,8 +20,8 @@ class UpdateCatalogParams: Attributes: environment (str): New environment for the catalog properties (list[EncryptedCatalogProperty]): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/UpdateCatalogParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateCatalogParams.json. """ environment: str diff --git a/src/tower/tower_api_client/models/update_catalog_response.py b/src/tower/tower_api_client/models/update_catalog_response.py index 64a41120..6a8cd272 100644 --- a/src/tower/tower_api_client/models/update_catalog_response.py +++ b/src/tower/tower_api_client/models/update_catalog_response.py @@ -19,8 +19,8 @@ class UpdateCatalogResponse: """ Attributes: catalog (Catalog): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/UpdateCatalogResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateCatalogResponse.json. """ catalog: Catalog diff --git a/src/tower/tower_api_client/models/update_email_preferences_body.py b/src/tower/tower_api_client/models/update_email_preferences_body.py index c6029d63..0b810b28 100644 --- a/src/tower/tower_api_client/models/update_email_preferences_body.py +++ b/src/tower/tower_api_client/models/update_email_preferences_body.py @@ -19,8 +19,8 @@ class UpdateEmailPreferencesBody: """ Attributes: subscriptions (EmailSubscriptions): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/UpdateEmailPreferencesBody.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateEmailPreferencesBody.json. """ subscriptions: EmailSubscriptions diff --git a/src/tower/tower_api_client/models/update_environment_params.py b/src/tower/tower_api_client/models/update_environment_params.py index fc12ec91..bfab90bd 100644 --- a/src/tower/tower_api_client/models/update_environment_params.py +++ b/src/tower/tower_api_client/models/update_environment_params.py @@ -15,8 +15,8 @@ class UpdateEnvironmentParams: """ Attributes: new_name (str): The desired new name of the environment - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/UpdateEnvironmentParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateEnvironmentParams.json. """ new_name: str diff --git a/src/tower/tower_api_client/models/update_environment_response.py b/src/tower/tower_api_client/models/update_environment_response.py index 9368644b..1fd5d864 100644 --- a/src/tower/tower_api_client/models/update_environment_response.py +++ b/src/tower/tower_api_client/models/update_environment_response.py @@ -19,8 +19,8 @@ class UpdateEnvironmentResponse: """ Attributes: environment (Environment): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/UpdateEnvironmentResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateEnvironmentResponse.json. """ environment: Environment diff --git a/src/tower/tower_api_client/models/update_my_team_invitation_params.py b/src/tower/tower_api_client/models/update_my_team_invitation_params.py index a6f1f041..88efaa64 100644 --- a/src/tower/tower_api_client/models/update_my_team_invitation_params.py +++ b/src/tower/tower_api_client/models/update_my_team_invitation_params.py @@ -16,8 +16,8 @@ class UpdateMyTeamInvitationParams: Attributes: accepted (bool): Whether or not the invitation was accepted. If false, it's considered rejected. name (str): The name of the team invitation to update - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/UpdateMyTeamInvitationParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateMyTeamInvitationParams.json. """ accepted: bool diff --git a/src/tower/tower_api_client/models/update_my_team_invitation_response.py b/src/tower/tower_api_client/models/update_my_team_invitation_response.py index ea503aaa..ec74b580 100644 --- a/src/tower/tower_api_client/models/update_my_team_invitation_response.py +++ b/src/tower/tower_api_client/models/update_my_team_invitation_response.py @@ -14,8 +14,8 @@ class UpdateMyTeamInvitationResponse: """ Attributes: - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/UpdateMyTeamInvitationResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateMyTeamInvitationResponse.json. """ schema: str | Unset = UNSET diff --git a/src/tower/tower_api_client/models/update_organization_params.py b/src/tower/tower_api_client/models/update_organization_params.py index eba86aeb..877b7b2a 100644 --- a/src/tower/tower_api_client/models/update_organization_params.py +++ b/src/tower/tower_api_client/models/update_organization_params.py @@ -14,8 +14,8 @@ class UpdateOrganizationParams: """ Attributes: - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/UpdateOrganizationParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateOrganizationParams.json. name (str | Unset): The name of the organization to update. This is optional, if you supply null it will not update the organization name. """ diff --git a/src/tower/tower_api_client/models/update_organization_response.py b/src/tower/tower_api_client/models/update_organization_response.py index 3bb4501f..06af12a5 100644 --- a/src/tower/tower_api_client/models/update_organization_response.py +++ b/src/tower/tower_api_client/models/update_organization_response.py @@ -19,8 +19,8 @@ class UpdateOrganizationResponse: """ Attributes: organization (Organization): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/UpdateOrganizationResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateOrganizationResponse.json. """ organization: Organization diff --git a/src/tower/tower_api_client/models/update_plan_params.py b/src/tower/tower_api_client/models/update_plan_params.py index 975cab1a..61e124aa 100644 --- a/src/tower/tower_api_client/models/update_plan_params.py +++ b/src/tower/tower_api_client/models/update_plan_params.py @@ -15,8 +15,8 @@ class UpdatePlanParams: """ Attributes: base_plan_name (str): The name of the base plan to use. - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/UpdatePlanParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdatePlanParams.json. """ base_plan_name: str diff --git a/src/tower/tower_api_client/models/update_plan_response.py b/src/tower/tower_api_client/models/update_plan_response.py index eb96f53f..196b5503 100644 --- a/src/tower/tower_api_client/models/update_plan_response.py +++ b/src/tower/tower_api_client/models/update_plan_response.py @@ -19,8 +19,8 @@ class UpdatePlanResponse: """ Attributes: plan (Plan): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/UpdatePlanResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdatePlanResponse.json. """ plan: Plan diff --git a/src/tower/tower_api_client/models/update_schedule_params.py b/src/tower/tower_api_client/models/update_schedule_params.py index fab0a6c0..fdb50089 100644 --- a/src/tower/tower_api_client/models/update_schedule_params.py +++ b/src/tower/tower_api_client/models/update_schedule_params.py @@ -12,7 +12,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.run_parameter_input import RunParameterInput + from ..models.run_parameter import RunParameter T = TypeVar("T", bound="UpdateScheduleParams") @@ -22,15 +22,15 @@ class UpdateScheduleParams: """ Attributes: - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/UpdateScheduleParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateScheduleParams.json. app_version (None | str | Unset): This property is deprecated and ignored. Schedules inherit the version from their environment. cron (str | Unset): The cron expression defining when the app should run environment (str | Unset): The environment to run the app in Default: 'default'. name (None | str | Unset): The name for this schedule. Must be unique per team. overlap_policy (UpdateScheduleParamsOverlapPolicy | Unset): The overlap policy for the schedule - parameters (list[RunParameterInput] | Unset): Parameters to pass when running the app + parameters (list[RunParameter] | Unset): Parameters to pass when running the app status (UpdateScheduleParamsStatus | Unset): The status of the schedule timezone (None | str | Unset): The IANA timezone identifier that the cron expression should be evaluated in (e.g., 'America/New_York', 'Europe/London'). @@ -42,7 +42,7 @@ class UpdateScheduleParams: environment: str | Unset = "default" name: None | str | Unset = UNSET overlap_policy: UpdateScheduleParamsOverlapPolicy | Unset = UNSET - parameters: list[RunParameterInput] | Unset = UNSET + parameters: list[RunParameter] | Unset = UNSET status: UpdateScheduleParamsStatus | Unset = UNSET timezone: None | str | Unset = UNSET @@ -112,7 +112,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.run_parameter_input import RunParameterInput + from ..models.run_parameter import RunParameter d = dict(src_dict) schema = d.pop("$schema", UNSET) @@ -147,11 +147,11 @@ def _parse_name(data: object) -> None | str | Unset: overlap_policy = UpdateScheduleParamsOverlapPolicy(_overlap_policy) _parameters = d.pop("parameters", UNSET) - parameters: list[RunParameterInput] | Unset = UNSET + parameters: list[RunParameter] | Unset = UNSET if _parameters is not UNSET: parameters = [] for parameters_item_data in _parameters: - parameters_item = RunParameterInput.from_dict(parameters_item_data) + parameters_item = RunParameter.from_dict(parameters_item_data) parameters.append(parameters_item) diff --git a/src/tower/tower_api_client/models/update_schedule_response.py b/src/tower/tower_api_client/models/update_schedule_response.py index 45313433..d1a534b8 100644 --- a/src/tower/tower_api_client/models/update_schedule_response.py +++ b/src/tower/tower_api_client/models/update_schedule_response.py @@ -19,8 +19,8 @@ class UpdateScheduleResponse: """ Attributes: schedule (Schedule): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/UpdateScheduleResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateScheduleResponse.json. """ schedule: Schedule diff --git a/src/tower/tower_api_client/models/update_secret_params.py b/src/tower/tower_api_client/models/update_secret_params.py index d759ab36..072e0f74 100644 --- a/src/tower/tower_api_client/models/update_secret_params.py +++ b/src/tower/tower_api_client/models/update_secret_params.py @@ -17,8 +17,8 @@ class UpdateSecretParams: encrypted_value (str): environment (str): preview (str): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/UpdateSecretParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateSecretParams.json. """ encrypted_value: str diff --git a/src/tower/tower_api_client/models/update_secret_response.py b/src/tower/tower_api_client/models/update_secret_response.py index 9897ee11..6fa42112 100644 --- a/src/tower/tower_api_client/models/update_secret_response.py +++ b/src/tower/tower_api_client/models/update_secret_response.py @@ -19,8 +19,8 @@ class UpdateSecretResponse: """ Attributes: secret (Secret): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/UpdateSecretResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateSecretResponse.json. """ secret: Secret diff --git a/src/tower/tower_api_client/models/update_team_member_params.py b/src/tower/tower_api_client/models/update_team_member_params.py index ad8d0c5a..626d50f1 100644 --- a/src/tower/tower_api_client/models/update_team_member_params.py +++ b/src/tower/tower_api_client/models/update_team_member_params.py @@ -16,8 +16,8 @@ class UpdateTeamMemberParams: """ Attributes: email (str): The email address of the team member to update - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/UpdateTeamMemberParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateTeamMemberParams.json. role (UpdateTeamMemberParamsRole | Unset): The role to update the team member to """ diff --git a/src/tower/tower_api_client/models/update_team_member_response.py b/src/tower/tower_api_client/models/update_team_member_response.py index 9d8e0b98..f736a542 100644 --- a/src/tower/tower_api_client/models/update_team_member_response.py +++ b/src/tower/tower_api_client/models/update_team_member_response.py @@ -19,8 +19,8 @@ class UpdateTeamMemberResponse: """ Attributes: team_member (TeamMembership): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/UpdateTeamMemberResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateTeamMemberResponse.json. """ team_member: TeamMembership diff --git a/src/tower/tower_api_client/models/update_team_params.py b/src/tower/tower_api_client/models/update_team_params.py index 4f82cc5b..83392ef6 100644 --- a/src/tower/tower_api_client/models/update_team_params.py +++ b/src/tower/tower_api_client/models/update_team_params.py @@ -17,8 +17,8 @@ class UpdateTeamParams: Attributes: name (None | str): The name of the team to update. This is optional, if you supply null it will not update the team name. - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/UpdateTeamParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateTeamParams.json. execution_region (UpdateTeamParamsExecutionRegion | Unset): The execution region for runs (eu-central-1 or us- east-1) """ diff --git a/src/tower/tower_api_client/models/update_team_response.py b/src/tower/tower_api_client/models/update_team_response.py index e1e98f7b..fe2bc66b 100644 --- a/src/tower/tower_api_client/models/update_team_response.py +++ b/src/tower/tower_api_client/models/update_team_response.py @@ -19,8 +19,8 @@ class UpdateTeamResponse: """ Attributes: team (Team): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/UpdateTeamResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateTeamResponse.json. """ team: Team diff --git a/src/tower/tower_api_client/models/update_user_params.py b/src/tower/tower_api_client/models/update_user_params.py index e441ebd4..79efdc87 100644 --- a/src/tower/tower_api_client/models/update_user_params.py +++ b/src/tower/tower_api_client/models/update_user_params.py @@ -14,8 +14,8 @@ class UpdateUserParams: """ Attributes: - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/UpdateUserParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateUserParams.json. company (None | str | Unset): country (None | str | Unset): first_name (None | str | Unset): diff --git a/src/tower/tower_api_client/models/update_user_response.py b/src/tower/tower_api_client/models/update_user_response.py index 76524c4a..38069893 100644 --- a/src/tower/tower_api_client/models/update_user_response.py +++ b/src/tower/tower_api_client/models/update_user_response.py @@ -19,8 +19,8 @@ class UpdateUserResponse: """ Attributes: user (User): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/UpdateUserResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateUserResponse.json. """ user: User diff --git a/src/tower/tower_api_client/models/update_webhook_params.py b/src/tower/tower_api_client/models/update_webhook_params.py index 84f1532f..f286e619 100644 --- a/src/tower/tower_api_client/models/update_webhook_params.py +++ b/src/tower/tower_api_client/models/update_webhook_params.py @@ -15,8 +15,8 @@ class UpdateWebhookParams: """ Attributes: name (str): The new name of the webhook. - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/UpdateWebhookParams.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateWebhookParams.json. """ name: str diff --git a/src/tower/tower_api_client/models/update_webhook_response.py b/src/tower/tower_api_client/models/update_webhook_response.py index 188eaa37..fe698626 100644 --- a/src/tower/tower_api_client/models/update_webhook_response.py +++ b/src/tower/tower_api_client/models/update_webhook_response.py @@ -19,8 +19,8 @@ class UpdateWebhookResponse: """ Attributes: webhook (Webhook): - schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.staging.tower- - dev.net/v1/schemas/UpdateWebhookResponse.json. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateWebhookResponse.json. """ webhook: Webhook From e13587c1f1de8038ab3b19b447b6ac3fef988722 Mon Sep 17 00:00:00 2001 From: Brad Heller Date: Fri, 8 May 2026 09:59:30 +0200 Subject: [PATCH 8/9] fix(tests): add new starting fields to mock API server The OpenAPI spec bump to v0.10.24 made `Run.starting_at` and `RunResults.starting` required (the former is `Option::deserialize`, so the JSON key must be present even if null). The mock server wasn't emitting them, so the new generated client deserialization fell into `UnknownValue` and surfaced as 204/"wasn't able to understand" errors across the integration suite. --- tests/mock-api-server/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/mock-api-server/main.py b/tests/mock-api-server/main.py index 7faff7d0..f8dedb09 100644 --- a/tests/mock-api-server/main.py +++ b/tests/mock-api-server/main.py @@ -69,6 +69,7 @@ async def log_requests(request: Request, call_next): "pending": 0, "retrying": 0, "running": 0, + "starting": 0, }, "subdomain": None, "is_externally_accessible": False, @@ -160,6 +161,7 @@ async def create_app(app_data: Dict[str, Any]): "pending": 0, "retrying": 0, "running": 0, + "starting": 0, }, "schedule": None, "short_description": description or "", @@ -283,6 +285,7 @@ async def run_app(name: str, run_params: Dict[str, Any]): "created_at": datetime.datetime.now().isoformat(), "scheduled_at": datetime.datetime.now().isoformat(), "cancelled_at": None, + "starting_at": datetime.datetime.now().isoformat(), "started_at": datetime.datetime.now().isoformat(), "ended_at": None, "app_version": mock_apps_db[name].get("version", "1.0.0"), From 6f92cc313a3276ed439a70b7958745159f883e2a Mon Sep 17 00:00:00 2001 From: Brad Heller Date: Tue, 12 May 2026 15:37:27 +0100 Subject: [PATCH 9/9] chore: Add cancelled_child_runs to mock cancel response Regenerated CancelRunResponse now has a required cancelled_child_runs field; mock server was returning only {"run": ...} which broke deserialization and produced empty CLI output in integration tests. Co-Authored-By: Claude Opus 4.7 (1M context) --- tests/mock-api-server/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/mock-api-server/main.py b/tests/mock-api-server/main.py index f8dedb09..185c743a 100644 --- a/tests/mock-api-server/main.py +++ b/tests/mock-api-server/main.py @@ -358,7 +358,7 @@ async def cancel_run(name: str, seq: int): run_data["status"] = "cancelled" run_data["status_group"] = "successful" run_data["cancelled_at"] = now_iso() - return {"run": run_data} + return {"run": run_data, "cancelled_child_runs": 0} raise HTTPException( status_code=404, detail=f"Run sequence {seq} not found for app '{name}'"